9.2
general documentation
cs_cf_thermo.h
Go to the documentation of this file.
1#ifndef CS_CF_THERMO_H
2#define CS_CF_THERMO_H
3
4/*============================================================================
5 * Thermodynamic laws for the compressible module
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#include "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Standard C library headers
34 *----------------------------------------------------------------------------*/
35
36/*----------------------------------------------------------------------------
37 * Local headers
38 *----------------------------------------------------------------------------*/
39
41#include "cfbl/cs_cf_model.h"
42
43/*============================================================================
44 * Type definitions
45 *============================================================================*/
46
47/* Stiffened gas thermodynamic parameters */
48/*---------------------------------------*/
49
50typedef struct {
51
56 cs_real_t q; /* FIXME to be taken into account in equilibrium functions.
57 Should be set to 0 until it is fully taken into account. */
58
60
63/*============================================================================
64 * Static variables
65 *============================================================================*/
66
67static cs_real_t _eps_log_lim = 1.e-11;
68
71/*============================================================================
72 * Public inlined function
73 *============================================================================*/
74
75/*----------------------------------------------------------------------------*/
92/*----------------------------------------------------------------------------*/
93
94inline static cs_real_t
96 cs_real_t energ,
98{
99 cs_real_t CV = sg.cv;
100 cs_real_t gamma = sg.gamma;
101 cs_real_t Pinf = sg.pinf;
102 cs_real_t Qprim = sg.qprim;
103 cs_real_t Q = sg.q;
104
105 cs_real_t eps = _eps_log_lim;
106 cs_real_t s, tmp1, tmp2;
107 tmp1 = energ - Q - vol*Pinf;
108 tmp2 = vol;
109 s = Qprim;
110 if (tmp1 > eps) s += CV*log(tmp1);
111 if (tmp2 > eps) s += CV*(gamma-1.)*log(tmp2);
112
113 return s;
114}
115
116/*----------------------------------------------------------------------------*/
128/*----------------------------------------------------------------------------*/
129
130inline static cs_real_t
132 cs_real_t energ,
134{
135 cs_real_t CV = sg.cv;
136 cs_real_t Pinf = sg.pinf;
137 cs_real_t Q = sg.q;
138
139 cs_real_t T = (energ-Q-Pinf*vol) / CV;
140
141 return T;
142}
143
144/*----------------------------------------------------------------------------*/
156/*----------------------------------------------------------------------------*/
157
158inline static cs_real_t
160 cs_real_t energ,
162{
163 cs_real_t gamma = sg.gamma;
164 cs_real_t Pinf = sg.pinf;
165 cs_real_t Q = sg.q;
166
167 cs_real_t P = (gamma-1.)*(energ-Q) / vol-Pinf*gamma;
168
169 return P;
170}
171
172/*----------------------------------------------------------------------------*/
180/*----------------------------------------------------------------------------*/
181
182inline static cs_real_t
184 cs_real_t P,
186{
187 cs_real_t CV = sg.cv;
188 cs_real_t gamma = sg.gamma;
189 cs_real_t Pinf = sg.pinf;
190 cs_real_t Q = sg.q;
191
192 cs_real_t e, tmp;
193 tmp = P + Pinf;
194 e = Q + CV*T*(P+gamma*Pinf) / tmp;
195
196 return e;
197}
198
199/*----------------------------------------------------------------------------*/
207/*----------------------------------------------------------------------------*/
208
209inline static cs_real_t
211 cs_real_t P,
213{
214 cs_real_t CV = sg.cv;
215 cs_real_t gamma = sg.gamma;
216 cs_real_t Pinf = sg.pinf;
217
218 cs_real_t tau,tmp;
219 tmp = P + Pinf;
220 tau = (gamma-1.)*CV*T / tmp;
221
222 return tau;
223}
224
225/*----------------------------------------------------------------------------*/
233/*----------------------------------------------------------------------------*/
234
235inline static cs_real_t
237 cs_real_t P,
239{
240 cs_real_t CV = sg.cv;
241 cs_real_t gamma = sg.gamma;
242 cs_real_t Pinf = sg.pinf;
243 cs_real_t Qprim = sg.qprim;
244
245 cs_real_t s;
246 cs_real_t tmp = P + Pinf;
247
248 s = CV*gamma*log(CV*T) + CV*(gamma-1.)*log(gamma-1.)
249 - CV*(gamma-1.)*log(tmp) + Qprim;
250
251 return s;
252}
253
254/*----------------------------------------------------------------------------*/
262/*----------------------------------------------------------------------------*/
263
264inline static cs_real_t
266 cs_real_t v,
268{
269 cs_real_t CV = sg.cv;
270 cs_real_t gamma = sg.gamma;
271 cs_real_t Pinf = sg.pinf;
272 cs_real_t Qprim = sg.qprim;
273 cs_real_t Q = sg.q;
274
275 cs_real_t tmp1, tmp2;
276 cs_real_t e = -1.;
277
278 tmp1 = pow(v, 1.-gamma);
279
280 tmp2 = exp((s - Qprim) / CV);
281 e = Q + v * Pinf + tmp1*tmp2;
282
283 return e;
284}
285
286/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297inline static void
299 cs_real_t *cv,
301 cs_lnum_t l_size)
302{
303 /* Local variables */
304 int ieos = cs_glob_cf_model->ieos;
305
306 /* Gamma is supposed to be superior or equal to 1.
307 It is computed at each call, even if this may seem costly,
308 to be coherent with the "constant gamma" case for which this
309 constant is not saved. */
310
311 /* single ideal gas - constant gamma
312 or ideal gas mix - gamma for the mixture */
313 if (ieos == CS_EOS_IDEAL_GAS || ieos == CS_EOS_GAS_MIX) {
314 for (cs_lnum_t ii = 0; ii < l_size; ii++) {
315 gamma[ii] = cp[ii]/cv[ii];
316 if (gamma[ii] < 1.)
317 bft_error(__FILE__, __LINE__, 0,
318 _("Error in thermodynamics computations for "
319 "compressible flows:\n"
320 "Value of gamma smaller to 1. encountered.\n"
321 "Gamma (specific heat ratio) must be a real number "
322 "greater or equal to 1.\n"));
323 }
324 }
325 /* stiffened gas - constant gamma (parameter of the law) */
326 else if (ieos == CS_EOS_STIFFENED_GAS) {
327 for (cs_lnum_t ii = 0; ii < l_size; ii++)
329 }
330}
331
332/*=============================================================================
333 * Public function prototypes
334 *============================================================================*/
335
336/*----------------------------------------------------------------------------
337 * Set variability of isobaric specific heat and isochoric specific heat
338 * according to the chosen thermodynamic law.
339 *----------------------------------------------------------------------------*/
340
341void
343
344/*----------------------------------------------------------------------------
345 * Initialize density, total energy and isochoric specific heat
346 * according to the chosen thermodynamic law using the default parameters.
347 *----------------------------------------------------------------------------*/
348
349void
351
352// TODO: the check function should be generalized (pass the name as argument).
353
354/*----------------------------------------------------------------------------
355 * Check the positivity of the pressure.
356 *
357 * parameters:
358 * pres <-- array of pressure values
359 * l_size <-- l_size of the array
360 *----------------------------------------------------------------------------*/
361
362void
364 cs_lnum_t l_size);
365
366/*----------------------------------------------------------------------------
367 * Check the positivity of the internal energy.
368 *
369 * parameters:
370 * ener <-- array of total energy values
371 * l_size <-- l_size of the array
372 * vel <-- array of velocity values
373 *----------------------------------------------------------------------------*/
374
375void
377 cs_lnum_t l_size,
379
380/*----------------------------------------------------------------------------
381 * Check the positivity of the density given by the user.
382 *
383 * parameters:
384 * dens <-- array of density values
385 * l_size <-- l_size of the array
386 *----------------------------------------------------------------------------*/
387
388void
390 cs_lnum_t l_size);
391
392/*----------------------------------------------------------------------------
393 * Check strict positivity of temperature (Celsius) given by the user.
394 *
395 * parameters:
396 * temp <-- array of temperature values
397 * l_size <-- l_size of the array
398 *----------------------------------------------------------------------------*/
399
400void
402 cs_lnum_t l_size);
403
404/*----------------------------------------------------------------------------
405 * Compute temperature and total energy from density and pressure.
406 *
407 * parameters:
408 * cp <-- array of isobaric specific heat values
409 * cv <-- array of isochoric specific heat values
410 * pres <-- array of pressure values
411 * dens <-- array of density values
412 * temp --> array of temperature values
413 * ener --> array of total energy values
414 * vel <-- array of velocity component values
415 * l_size <-- l_size of the array
416 *----------------------------------------------------------------------------*/
417
418void
420 cs_real_t *cv,
421 cs_real_t *pres,
422 cs_real_t *dens,
423 cs_real_t *temp,
424 cs_real_t *ener,
426 cs_lnum_t l_size);
427
428/*----------------------------------------------------------------------------
429 * Compute density and total energy from pressure and temperature
430 *
431 * parameters:
432 * cp <-- array of isobaric specific heat values
433 * cv <-- array of isochoric specific heat values
434 * pres <-- array of pressure values
435 * temp <-- array of temperature values
436 * dens --> array of density values
437 * ener --> array of total energy values
438 * vel <-- array of velocity component values
439 * l_size <-- l_size of the array
440 *----------------------------------------------------------------------------*/
441
442void
444 cs_real_t *cv,
445 cs_real_t *pres,
446 cs_real_t *temp,
447 cs_real_t *dens,
448 cs_real_t *ener,
450 cs_lnum_t l_size);
451
452/*----------------------------------------------------------------------------
453 * Compute density and temperature from pressure and total energy.
454 *
455 * parameters:
456 * cp <-- array of isobaric specific heat values
457 * cv <-- array of isochoric specific heat values
458 * pres <-- array of pressure values
459 * ener <-- array of total energy values
460 * dens --> array of density values
461 * temp --> array of temperature values
462 * vel <-- array of velocity component values
463 * l_size <-- l_size of the array
464 *----------------------------------------------------------------------------*/
465
466void
468 cs_real_t *cv,
469 cs_real_t *pres,
470 cs_real_t *ener,
471 cs_real_t *dens,
472 cs_real_t *temp,
474 cs_lnum_t l_size);
475
476/*----------------------------------------------------------------------------
477 * Compute pressure and total energy from density and temperature
478 *
479 * parameters:
480 * cp <-- array of isobaric specific heat values
481 * cv <-- array of isochoric specific heat values
482 * dens <-- array of density values
483 * temp <-- array of temperature values
484 * pres --> array of pressure values
485 * ener --> array of total energy values
486 * vel <-- array of velocity component values
487 * l_size <-- l_size of the array
488 *----------------------------------------------------------------------------*/
489
490void
492 cs_real_t *cv,
493 cs_real_t *dens,
494 cs_real_t *temp,
495 cs_real_t *pres,
496 cs_real_t *ener,
498 cs_lnum_t l_size);
499
500/*----------------------------------------------------------------------------
501 * Compute pressure and temperature from density and total energy.
502 *
503 * parameters:
504 * cp <-- array of isobaric specific heat values
505 * cv <-- array of isochoric specific heat values
506 * dens <-- array of density values
507 * ener <-- array of total energy values
508 * pres --> array of pressure values
509 * temp --> array of temperature values
510 * vel <-- array of velocity component values
511 * fracv <-- array of volume fraction values
512 * fracm <-- array of mass fraction values
513 * frace <-- array of energy fraction values
514 * l_size <-- l_size of the array
515 *----------------------------------------------------------------------------*/
516
517void
519 cs_real_t *cv,
520 cs_real_t *dens,
521 cs_real_t *ener,
522 cs_real_t *pres,
523 cs_real_t *temp,
525 cs_real_t *fracv,
526 cs_real_t *fracm,
527 cs_real_t *frace,
528 cs_lnum_t l_size);
529
530/*----------------------------------------------------------------------------
531 * Compute square of sound velocity for perfect gas.
532 *
533 * parameters:
534 * cp <-- array of isobaric specific heat values
535 * cv <-- array of isochoric specific heat values
536 * pres <-- array of pressure values
537 * dens <-- array of density values
538 * c2 --> array of the values of the square of sound velocity
539 * l_size <-- l_size of the array
540 *----------------------------------------------------------------------------*/
541
542void
544 cs_real_t *cv,
545 cs_real_t *pres,
546 cs_real_t *dens,
547 cs_real_t *fracv,
548 cs_real_t *fracm,
549 cs_real_t *frace,
550 cs_real_t *c2,
551 cs_lnum_t l_size);
552
553/*----------------------------------------------------------------------------
554 * Compute the thermal expansion coefficient for a perfect gas.
555 *
556 * parameters:
557 * cp <-- array of isobaric specific heat values
558 * cv <-- array of isochoric specific heat values
559 * dens <-- array of density values
560 * beta --> array of beta values
561 * l_size <-- l_size of the array
562 *----------------------------------------------------------------------------*/
563
564void
566 cs_real_t *cv,
567 cs_real_t *dens,
568 cs_real_t *beta,
569 cs_lnum_t l_size);
570
571/*----------------------------------------------------------------------------
572 * Compute the isochoric specific heat:
573 *
574 * parameters:
575 * cp <-- array of isobaric specific heat values
576 * xmasml <-- array of molar mass values
577 * cv --> array of isochoric specific heat values
578 * l_size <-- l_size of the array
579 *----------------------------------------------------------------------------*/
580
581void
583 cs_real_t *xmasml,
584 cs_real_t *cv,
585 cs_lnum_t l_size);
586
587/*----------------------------------------------------------------------------
588 * Compute entropy from pressure and density:
589 *
590 * parameters:
591 * cp <-- array of isobaric specific heat values
592 * cv <-- array of isochoric specific heat values
593 * dens <-- array of density values
594 * pres <-- array of pressure values
595 * entr --> array of total energy values
596 * l_size <-- l_size of the array
597 *----------------------------------------------------------------------------*/
598
599void
601 cs_real_t *cv,
602 cs_real_t *dens,
603 cs_real_t *pres,
604 cs_real_t *entr,
605 cs_lnum_t l_size);
606
607/*----------------------------------------------------------------------------
608 * Compute wall boundary condition values.
609 *
610 * parameters:
611 * wbfa --> output work array
612 * wbfb --> output work array
613 * face_id <-- boundary face index
614 *----------------------------------------------------------------------------*/
615
616void
618 cs_real_t *wbfb,
619 cs_lnum_t face_id);
620
621/*----------------------------------------------------------------------------
622 * Compute subsonic outlet boundary conditions values.
623 *
624 * parameters:
625 * bc_en <--> total energy values at boundary faces
626 * bc_pr <--> pressure values at boundary faces
627 * bc_vel <--> velocity values at boundary faces
628 * face_id <-- boundary face index
629 *----------------------------------------------------------------------------*/
630
631void
633 cs_real_t *bc_pr,
634 cs_real_3_t *bc_vel,
635 cs_lnum_t face_id);
636
637/*----------------------------------------------------------------------------
638 * Compute inlet boundary condition with total pressure and total
639 * enthalpy imposed.
640 *
641 * parameters:
642 * bc_en <--> total energy values at boundary faces
643 * bc_pr <--> pressure values at boundary faces
644 * bc_vel <--> velocity values at boundary faces
645 * face_id <-- boundary face number
646 *----------------------------------------------------------------------------*/
647
648void
650 cs_real_t *bc_pr,
651 cs_real_3_t *bc_vel,
652 cs_lnum_t face_id);
653
654/*----------------------------------------------------------------------------
655 * Compute epsilon sup for perfect gas.
656 *
657 * parameters:
658 * dens <-- array of density values
659 * eps_sup --> epsilon sup array
660 * l_size <-- l_size of the array
661 *----------------------------------------------------------------------------*/
662
663void
665 cs_real_t *eps_sup,
666 cs_lnum_t l_size);
667
668/*----------------------------------------------------------------------------
669 * This function is a driver allowing to call the appropriate
670 * thermodynamical functions depending on the quantities provided by the user.
671 * Hence it is only used during the initialization step and at the boundaries
672 * of type supersonic inlet. It is described in the following how to select the
673 * quantity to be returned.
674 *
675 * When calling the user subroutine, the integer 'iccfth' specifies which
676 * calculation has to be performed (and which quantity has to be returned).
677 * The values for 'iccfth' for each case are provided below.
678 *
679 * The variables are referred to using a different index i:
680 *
681 * - pressure: 2
682 * - density: 3
683 * - temperature: 5
684 * - internal energy: 7
685 * - entropy: 13
686 *
687 * iccfth is as follows, depending on which quantity needs to be computed:
688 * - variables at cell centers from variable i and variable j (i<j):
689 * iccfth = i*j*10000
690 * - variables at boundary faces from variable i and variable j (i<j):
691 * iccfth = i*j*10000+900
692 *
693 * Detailed values of iccfth and corresponding computations:
694 *
695 * Values at the cell centers:
696 *
697 * - temperature and energy from pressure and density: iccfth = 60000
698 * - density and energy from pressure and temperature: iccfth = 100000
699 * - density and temperature from pressure and energy: iccfth = 140000
700 * - pressure and energy from density and temperature: iccfth = 150000
701 * - pressure and temperature from density and energy: iccfth = 210000
702 *
703 * Values at the faces for boundary conditions:
704 * - temperature and energy from pressure and density: iccfth = 60900
705 * - density and energy from pressure and temperature: iccfth = 100900
706 * - density and temperature from pressure and energy: iccfth = 140900
707 * - pressure and energy from density and temperature: iccfth = 150900
708 * - pressure and temperature from density and energy: iccfth = 210900
709 *
710 * parameters:
711 * iccfth --> id of computation
712 * face_id --> face index if the computation is for a B.C.
713 * bc_en <-- total energy values at boundary faces
714 * bc_pr <-- pressure values at boundary faces
715 * bc_tk <-- temperature values at boundary faces
716 * bc_vel <-- velocity values at boundary faces
717 *----------------------------------------------------------------------------*/
718
719void
720cs_cf_thermo(const int iccfth,
721 cs_lnum_t face_id,
722 cs_real_t *bc_en,
723 cs_real_t *bc_pr,
724 cs_real_t *bc_tk,
725 cs_real_3_t *bc_vel);
726
727/*----------------------------------------------------------------------------*/
739/*----------------------------------------------------------------------------*/
740
743 cs_real_t bc_pr,
744 cs_real_t bc_tk);
745
746/*----------------------------------------------------------------------------*/
747
748#endif /* CS_CF_THERMO_H */
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.cpp:187
const cs_cf_model_t * cs_glob_cf_model
@ CS_EOS_STIFFENED_GAS
Definition: cs_cf_model.h:73
@ CS_EOS_IDEAL_GAS
Definition: cs_cf_model.h:72
@ CS_EOS_GAS_MIX
Definition: cs_cf_model.h:74
void cs_cf_thermo_wall_bc(cs_real_t *wbfa, cs_real_t *wbfb, cs_lnum_t face_id)
Compute wall boundary condition values.
Definition: cs_cf_thermo.cpp:913
void cs_cf_thermo_dt_from_pe(cs_real_t *cp, cs_real_t *cv, cs_real_t *pres, cs_real_t *ener, cs_real_t *dens, cs_real_t *temp, cs_real_3_t *vel, cs_lnum_t l_size)
Compute density and temperature from pressure and total energy;.
Definition: cs_cf_thermo.cpp:467
void cs_cf_check_internal_energy(cs_real_t *ener, cs_lnum_t l_size, cs_real_3_t *vel)
Check the positivity of the internal energy.
Definition: cs_cf_thermo.cpp:220
void cs_cf_thermo(const int iccfth, cs_lnum_t face_id, cs_real_t *bc_en, cs_real_t *bc_pr, cs_real_t *bc_tk, cs_real_3_t *bc_vel)
This function is a driver allowing to call the appropriate thermodynamical functions depending on the...
Definition: cs_cf_thermo.cpp:1641
static cs_real_t cs_cf_thermo_temperature_sg_ve(cs_real_t vol, cs_real_t energ, cs_stiffened_gas_t sg)
Computation of the temperature.
Definition: cs_cf_thermo.h:131
cs_real_t cs_cf_thermo_b_rho_from_pt(cs_lnum_t face_id, cs_real_t bc_pr, cs_real_t bc_tk)
Compute density at boundary based on pressure and temperature.
Definition: cs_cf_thermo.cpp:1782
void cs_cf_thermo_eps_sup(const cs_real_t *dens, cs_real_t *eps_sup, cs_lnum_t l_size)
Compute epsilon sup:
Definition: cs_cf_thermo.cpp:1560
void cs_cf_thermo_default_init(void)
Initialize density, total energy and isochoric specific heat according to the chosen thermodynamic la...
Definition: cs_cf_thermo.cpp:117
void cs_cf_thermo_c_square(cs_real_t *cp, cs_real_t *cv, cs_real_t *pres, cs_real_t *dens, cs_real_t *fracv, cs_real_t *fracm, cs_real_t *frace, cs_real_t *c2, cs_lnum_t l_size)
Compute square of sound velocity:
Definition: cs_cf_thermo.cpp:709
void cs_cf_thermo_s_from_dp(cs_real_t *cp, cs_real_t *cv, cs_real_t *dens, cs_real_t *pres, cs_real_t *entr, cs_lnum_t l_size)
Compute entropy from pressure and density:
Definition: cs_cf_thermo.cpp:861
static cs_real_t cs_cf_thermo_internal_energy_sg_tp(cs_real_t T, cs_real_t P, cs_stiffened_gas_t sg)
Computation of internal energy in plane (T,P).
Definition: cs_cf_thermo.h:183
static cs_real_t cs_cf_thermo_internal_energy_sg_sv(cs_real_t s, cs_real_t v, cs_stiffened_gas_t sg)
Computation of internal energy in plane (s,v).
Definition: cs_cf_thermo.h:265
static cs_real_t cs_cf_thermo_entropy_sg_tp(cs_real_t T, cs_real_t P, cs_stiffened_gas_t sg)
Computation of entropy in plane (T,P).
Definition: cs_cf_thermo.h:236
static cs_real_t cs_cf_thermo_pressure_sg_ve(cs_real_t vol, cs_real_t energ, cs_stiffened_gas_t sg)
Computation of the pressure.
Definition: cs_cf_thermo.h:159
void cs_cf_thermo_cv(cs_real_t *cp, cs_real_t *xmasml, cs_real_t *cv, cs_lnum_t l_size)
Compute the isochoric specific heat:
Definition: cs_cf_thermo.cpp:825
static void cs_cf_thermo_gamma(cs_real_t *cp, cs_real_t *cv, cs_real_t *gamma, cs_lnum_t l_size)
Compute .
Definition: cs_cf_thermo.h:298
void cs_cf_thermo_de_from_pt(cs_real_t *cp, cs_real_t *cv, cs_real_t *pres, cs_real_t *temp, cs_real_t *dens, cs_real_t *ener, cs_real_3_t *vel, cs_lnum_t l_size)
Compute density and total energy from pressure and temperature.
Definition: cs_cf_thermo.cpp:401
void cs_cf_check_pressure(cs_real_t *pres, cs_lnum_t l_size)
Check the positivity of the pressure.
Definition: cs_cf_thermo.cpp:182
void cs_cf_thermo_beta(cs_real_t *cp, cs_real_t *cv, cs_real_t *dens, cs_real_t *beta, cs_lnum_t l_size)
Compute the thermal expansion coefficient:
Definition: cs_cf_thermo.cpp:778
static cs_real_t cs_cf_thermo_specific_volume_sg_tp(cs_real_t T, cs_real_t P, cs_stiffened_gas_t sg)
Computation of specific volume in plane (T,P).
Definition: cs_cf_thermo.h:210
void cs_cf_thermo_pt_from_de(cs_real_t *cp, cs_real_t *cv, cs_real_t *dens, cs_real_t *ener, cs_real_t *pres, cs_real_t *temp, cs_real_3_t *vel, cs_real_t *fracv, cs_real_t *fracm, cs_real_t *frace, cs_lnum_t l_size)
Compute pressure and temperature from density and total energy.
Definition: cs_cf_thermo.cpp:608
void cs_cf_thermo_ph_inlet_bc(cs_real_t *bc_en, cs_real_t *bc_pr, cs_real_3_t *bc_vel, cs_lnum_t face_id)
Compute inlet boundary condition with total pressure and total enthalpy imposed.
Definition: cs_cf_thermo.cpp:1251
void cs_cf_check_density(cs_real_t *dens, cs_lnum_t l_size)
Check the positivity of the density given by the user.
Definition: cs_cf_thermo.cpp:260
void cs_cf_set_thermo_options(void)
Set variability of isobaric specific heat and isochoric specific heat according to the chosen thermod...
Definition: cs_cf_thermo.cpp:92
void cs_cf_thermo_pe_from_dt(cs_real_t *cp, cs_real_t *cv, cs_real_t *dens, cs_real_t *temp, cs_real_t *pres, cs_real_t *ener, cs_real_3_t *vel, cs_lnum_t l_size)
Compute pressure and total energy from density and temperature.
Definition: cs_cf_thermo.cpp:541
void cs_cf_thermo_te_from_dp(cs_real_t *cp, cs_real_t *cv, cs_real_t *pres, cs_real_t *dens, cs_real_t *temp, cs_real_t *ener, cs_real_3_t *vel, cs_lnum_t l_size)
Compute temperature and total energy from density and pressure.
Definition: cs_cf_thermo.cpp:333
void cs_cf_check_temperature(cs_real_t *temp, cs_lnum_t l_size)
Check strict positivity of temperature (Celsius) given by the user.
Definition: cs_cf_thermo.cpp:295
static cs_real_t cs_cf_thermo_entropy_sg_ve(cs_real_t vol, cs_real_t energ, cs_stiffened_gas_t sg)
Computation of entropy in plane (v,e) with a stiffened gas law.
Definition: cs_cf_thermo.h:95
void cs_cf_thermo_subsonic_outlet_bc(cs_real_t *bc_en, cs_real_t *bc_pr, cs_real_3_t *bc_vel, cs_lnum_t face_id)
Compute subsonic outlet boundary conditions values.
Definition: cs_cf_thermo.cpp:1013
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define _(String)
Definition: cs_defs.h:61
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
@ gamma
Definition: cs_field_pointer.h:197
@ eps
Definition: cs_field_pointer.h:69
@ cv
Definition: cs_field_pointer.h:100
@ vel
Definition: cs_field_pointer.h:66
@ cp
Definition: cs_field_pointer.h:99
int ieos
Definition: cs_cf_model.h:49
double gammasg
Definition: cs_cf_model.h:60
Definition: cs_cf_thermo.h:50
cs_real_t cv
Definition: cs_cf_thermo.h:52
cs_real_t q
Definition: cs_cf_thermo.h:56
cs_real_t qprim
Definition: cs_cf_thermo.h:55
cs_real_t gamma
Definition: cs_cf_thermo.h:53
cs_real_t pinf
Definition: cs_cf_thermo.h:54