My Project
programmer's documentation
Loading...
Searching...
No Matches
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-2019 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
31#include "cs_defs.h"
32
33/*----------------------------------------------------------------------------
34 * Standard C library headers
35 *----------------------------------------------------------------------------*/
36
37/*----------------------------------------------------------------------------
38 * Local headers
39 *----------------------------------------------------------------------------*/
40
42#include "cs_cf_model.h"
43
44/*----------------------------------------------------------------------------*/
45
47
48/*============================================================================
49 * Type definitions
50 *============================================================================*/
51
52/* Stiffened gas thermodynamic parameters */
53/*---------------------------------------*/
54
55typedef struct {
56
61 cs_real_t q; /* FIXME to be taken into account in equilibrium functions.
62 Should be set to 0 until it is fully taken into account. */
63
65
68/*============================================================================
69 * Static variables
70 *============================================================================*/
71
72static cs_real_t _eps_log_lim = 1.e-11;
73
76/*============================================================================
77 * Public inlined function
78 *============================================================================*/
79
80/*----------------------------------------------------------------------------*/
97/*----------------------------------------------------------------------------*/
98
99inline static cs_real_t
101 cs_real_t energ,
103{
104 cs_real_t CV = sg.cv;
105 cs_real_t gamma = sg.gamma;
106 cs_real_t Pinf = sg.pinf;
107 cs_real_t Qprim = sg.qprim;
108 cs_real_t Q = sg.q;
109
110 cs_real_t eps = _eps_log_lim;
111 cs_real_t s, tmp1, tmp2;
112 tmp1 = energ - Q - vol*Pinf;
113 tmp2 = vol;
114 s = Qprim;
115 if (tmp1 > eps) s += CV*log(tmp1);
116 if (tmp2 > eps) s += CV*(gamma-1.)*log(tmp2);
117
118 return s;
119}
120
121/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134
135inline static cs_real_t
137 cs_real_t energ,
139{
140 cs_real_t CV = sg.cv;
141 cs_real_t Pinf = sg.pinf;
142 cs_real_t Q = sg.q;
143
144 cs_real_t T = (energ-Q-Pinf*vol) / CV;
145
146 return T;
147}
148
149/*----------------------------------------------------------------------------*/
161/*----------------------------------------------------------------------------*/
162
163inline static cs_real_t
165 cs_real_t energ,
167{
168 cs_real_t gamma = sg.gamma;
169 cs_real_t Pinf = sg.pinf;
170 cs_real_t Q = sg.q;
171
172 cs_real_t P = (gamma-1.)*(energ-Q) / vol-Pinf*gamma;
173
174 return P;
175}
176
177/*----------------------------------------------------------------------------*/
185/*----------------------------------------------------------------------------*/
186
187inline static cs_real_t
189 cs_real_t P,
191{
192 cs_real_t CV = sg.cv;
193 cs_real_t gamma = sg.gamma;
194 cs_real_t Pinf = sg.pinf;
195 cs_real_t Q = sg.q;
196
197 cs_real_t e, tmp;
198 tmp = P + Pinf;
199 e = Q + CV*T*(P+gamma*Pinf) / tmp;
200
201 return e;
202}
203
204/*----------------------------------------------------------------------------*/
212/*----------------------------------------------------------------------------*/
213
214inline static cs_real_t
216 cs_real_t P,
218{
219 cs_real_t CV = sg.cv;
220 cs_real_t gamma = sg.gamma;
221 cs_real_t Pinf = sg.pinf;
222
223 cs_real_t tau,tmp;
224 tmp = P + Pinf;
225 tau = (gamma-1.)*CV*T / tmp;
226
227 return tau;
228}
229
230/*----------------------------------------------------------------------------*/
238/*----------------------------------------------------------------------------*/
239
240inline static cs_real_t
242 cs_real_t P,
244{
245 cs_real_t CV = sg.cv;
246 cs_real_t gamma = sg.gamma;
247 cs_real_t Pinf = sg.pinf;
248 cs_real_t Qprim = sg.qprim;
249
250 cs_real_t s;
251 cs_real_t tmp = P + Pinf;
252
253 s = CV*gamma*log(CV*T) + CV*(gamma-1.)*log(gamma-1.)
254 - CV*(gamma-1.)*log(tmp) + Qprim;
255
256 return s;
257}
258
259/*----------------------------------------------------------------------------*/
267/*----------------------------------------------------------------------------*/
268
269inline static cs_real_t
271 cs_real_t v,
273{
274 cs_real_t CV = sg.cv;
275 cs_real_t gamma = sg.gamma;
276 cs_real_t Pinf = sg.pinf;
277 cs_real_t Qprim = sg.qprim;
278 cs_real_t Q = sg.q;
279
280 cs_real_t tmp1, tmp2;
281 cs_real_t e = -1.;
282
283 tmp1 = pow(v, 1.-gamma);
284
285 tmp2 = exp((s - Qprim) / CV);
286 e = Q + v * Pinf + tmp1*tmp2;
287
288 return e;
289}
290
291/*----------------------------------------------------------------------------*/
300/*----------------------------------------------------------------------------*/
301
302inline static void
304 cs_real_t *cv,
306 cs_lnum_t l_size)
307{
308 /* Local variables */
309 int ieos = cs_glob_cf_model->ieos;
310
311 /* Gamma is supposed to be superior or equal to 1.
312 It is computed at each call, even if this may seem costly,
313 to be coherent with the "constant gamma" case for which this
314 constant is not saved. */
315
316 /* single ideal gas - constant gamma
317 or ideal gas mix - gamma for the mixture */
318 if (ieos == 1 || ieos == 3) {
319 for (cs_lnum_t ii = 0; ii < l_size; ii++) {
320 gamma[ii] = cp[ii]/cv[ii];
321 if (gamma[ii] < 1.)
322 bft_error(__FILE__, __LINE__, 0,
323 _("Error in thermodynamics computations for "
324 "compressible flows:\n"
325 "Value of gamma smaller to 1. encountered.\n"
326 "Gamma (specific heat ratio) must be a real number "
327 "greater or equal to 1.\n"));
328 }
329 }
330 /* stiffened gas - constant gamma (parameter of the law) */
331 else if (ieos == 2) {
332 for (cs_lnum_t ii = 0; ii < l_size; ii++)
334 }
335}
336
337/*=============================================================================
338 * Public function prototypes
339 *============================================================================*/
340
341/*----------------------------------------------------------------------------
342 * Set variability of isobaric specific heat and isochoric specific heat
343 * according to the chosen thermodynamic law.
344 *----------------------------------------------------------------------------*/
345
346void
348
349/*----------------------------------------------------------------------------
350 * Initialize density, total energy and isochoric specific heat
351 * according to the chosen thermodynamic law using the default parameters.
352 *----------------------------------------------------------------------------*/
353
354void
356
357// TODO: the check function should be generalized (pass the name as argument).
358
359/*----------------------------------------------------------------------------
360 * Check the positivity of the pressure.
361 *
362 * parameters:
363 * pres <-- array of pressure values
364 * l_size <-- l_size of the array
365 *----------------------------------------------------------------------------*/
366
367void
369 cs_lnum_t l_size);
370
371/*----------------------------------------------------------------------------
372 * Check the positivity of the internal energy.
373 *
374 * parameters:
375 * ener <-- array of total energy values
376 * l_size <-- l_size of the array
377 * vel <-- array of velocity values
378 *----------------------------------------------------------------------------*/
379
380void
382 cs_lnum_t l_size,
384
385/*----------------------------------------------------------------------------
386 * Check the positivity of the density given by the user.
387 *
388 * parameters:
389 * dens <-- array of density values
390 * l_size <-- l_size of the array
391 *----------------------------------------------------------------------------*/
392
393void
395 cs_lnum_t l_size);
396
397/*----------------------------------------------------------------------------
398 * Check strict positivity of temperature (Celsius) given by the user.
399 *
400 * parameters:
401 * temp <-- array of temperature values
402 * l_size <-- l_size of the array
403 *----------------------------------------------------------------------------*/
404
405void
407 cs_lnum_t l_size);
408
409/*----------------------------------------------------------------------------
410 * Compute temperature and total energy from density and pressure.
411 *
412 * parameters:
413 * cp <-- array of isobaric specific heat values
414 * cv <-- array of isochoric specific heat values
415 * pres <-- array of pressure values
416 * dens <-- array of density values
417 * temp --> array of temperature values
418 * ener --> array of total energy values
419 * vel <-- array of velocity component values
420 * l_size <-- l_size of the array
421 *----------------------------------------------------------------------------*/
422
423void
425 cs_real_t *cv,
426 cs_real_t *pres,
427 cs_real_t *dens,
428 cs_real_t *temp,
429 cs_real_t *ener,
431 cs_lnum_t l_size);
432
433/*----------------------------------------------------------------------------
434 * Compute density and total energy from pressure and temperature
435 *
436 * parameters:
437 * cp <-- array of isobaric specific heat values
438 * cv <-- array of isochoric specific heat values
439 * pres <-- array of pressure values
440 * temp <-- array of temperature values
441 * dens --> array of density values
442 * ener --> array of total energy values
443 * vel <-- array of velocity component values
444 * l_size <-- l_size of the array
445 *----------------------------------------------------------------------------*/
446
447void
449 cs_real_t *cv,
450 cs_real_t *pres,
451 cs_real_t *temp,
452 cs_real_t *dens,
453 cs_real_t *ener,
455 cs_lnum_t l_size);
456
457/*----------------------------------------------------------------------------
458 * Compute density and temperature from pressure and total energy.
459 *
460 * parameters:
461 * cp <-- array of isobaric specific heat values
462 * cv <-- array of isochoric specific heat values
463 * pres <-- array of pressure values
464 * ener <-- array of total energy values
465 * dens --> array of density values
466 * temp --> array of temperature values
467 * vel <-- array of velocity component values
468 * l_size <-- l_size of the array
469 *----------------------------------------------------------------------------*/
470
471void
473 cs_real_t *cv,
474 cs_real_t *pres,
475 cs_real_t *ener,
476 cs_real_t *dens,
477 cs_real_t *temp,
479 cs_lnum_t l_size);
480
481/*----------------------------------------------------------------------------
482 * Compute pressure and total energy from density and temperature
483 *
484 * parameters:
485 * cp <-- array of isobaric specific heat values
486 * cv <-- array of isochoric specific heat values
487 * dens <-- array of density values
488 * temp <-- array of temperature values
489 * pres --> array of pressure values
490 * ener --> array of total energy values
491 * vel <-- array of velocity component values
492 * l_size <-- l_size of the array
493 *----------------------------------------------------------------------------*/
494
495void
497 cs_real_t *cv,
498 cs_real_t *dens,
499 cs_real_t *temp,
500 cs_real_t *pres,
501 cs_real_t *ener,
503 cs_lnum_t l_size);
504
505/*----------------------------------------------------------------------------
506 * Compute pressure and temperature from density and total energy.
507 *
508 * parameters:
509 * cp <-- array of isobaric specific heat values
510 * cv <-- array of isochoric specific heat values
511 * dens <-- array of density values
512 * ener <-- array of total energy values
513 * pres --> array of pressure values
514 * temp --> array of temperature values
515 * vel <-- array of velocity component values
516 * fracv <-- array of volume fraction values
517 * fracm <-- array of mass fraction values
518 * frace <-- array of energy fraction values
519 * l_size <-- l_size of the array
520 *----------------------------------------------------------------------------*/
521
522void
524 cs_real_t *cv,
525 cs_real_t *dens,
526 cs_real_t *ener,
527 cs_real_t *pres,
528 cs_real_t *temp,
530 cs_real_t *fracv,
531 cs_real_t *fracm,
532 cs_real_t *frace,
533 cs_lnum_t l_size);
534
535/*----------------------------------------------------------------------------
536 * Compute square of sound velocity for perfect gas.
537 *
538 * parameters:
539 * cp <-- array of isobaric specific heat values
540 * cv <-- array of isochoric specific heat values
541 * pres <-- array of pressure values
542 * dens <-- array of density values
543 * c2 --> array of the values of the square of sound velocity
544 * l_size <-- l_size of the array
545 *----------------------------------------------------------------------------*/
546
547void
549 cs_real_t *cv,
550 cs_real_t *pres,
551 cs_real_t *dens,
552 cs_real_t *fracv,
553 cs_real_t *fracm,
554 cs_real_t *frace,
555 cs_real_t *c2,
556 cs_lnum_t l_size);
557
558/*----------------------------------------------------------------------------
559 * Compute the thermal expansion coefficient for a perfect gas.
560 *
561 * parameters:
562 * cp <-- array of isobaric specific heat values
563 * cv <-- array of isochoric specific heat values
564 * dens <-- array of density values
565 * beta --> array of beta values
566 * l_size <-- l_size of the array
567 *----------------------------------------------------------------------------*/
568
569void
571 cs_real_t *cv,
572 cs_real_t *dens,
573 cs_real_t *beta,
574 cs_lnum_t l_size);
575
576/*----------------------------------------------------------------------------
577 * Compute the isochoric specific heat:
578 *
579 * parameters:
580 * cp <-- array of isobaric specific heat values
581 * xmasml <-- array of molar mass values
582 * cv --> array of isochoric specific heat values
583 * l_size <-- l_size of the array
584 *----------------------------------------------------------------------------*/
585
586void
588 cs_real_t *xmasml,
589 cs_real_t *cv,
590 cs_lnum_t l_size);
591
592/*----------------------------------------------------------------------------
593 * Compute entropy from pressure and density:
594 *
595 * parameters:
596 * cp <-- array of isobaric specific heat values
597 * cv <-- array of isochoric specific heat values
598 * dens <-- array of density values
599 * pres <-- array of pressure values
600 * entr --> array of total energy values
601 * l_size <-- l_size of the array
602 *----------------------------------------------------------------------------*/
603
604void
606 cs_real_t *cv,
607 cs_real_t *dens,
608 cs_real_t *pres,
609 cs_real_t *entr,
610 cs_lnum_t l_size);
611
612/*----------------------------------------------------------------------------
613 * Compute wall boundary condition values.
614 *
615 * parameters:
616 * wbfa --> output work array
617 * wbfb --> output work array
618 * face_id <-- boundary face index
619 *----------------------------------------------------------------------------*/
620
621void
623 cs_real_t *wbfb,
624 cs_lnum_t face_id);
625
626/*----------------------------------------------------------------------------
627 * Compute subsonic outlet boundary conditions values.
628 *
629 * parameters:
630 * bc_en <--> total energy values at boundary faces
631 * bc_pr <--> pressure values at boundary faces
632 * bc_vel <--> velocity values at boundary faces
633 * face_id <-- boundary face index
634 *----------------------------------------------------------------------------*/
635
636void
638 cs_real_t *bc_pr,
639 cs_real_3_t *bc_vel,
640 cs_lnum_t face_id);
641
642/*----------------------------------------------------------------------------
643 * Compute inlet boundary condition with total pressure and total
644 * enthalpy imposed.
645 *
646 * parameters:
647 * bc_en <--> total energy values at boundary faces
648 * bc_pr <--> pressure values at boundary faces
649 * bc_vel <--> velocity values at boundary faces
650 * face_id <-- boundary face number
651 *----------------------------------------------------------------------------*/
652
653void
655 cs_real_t *bc_pr,
656 cs_real_3_t *bc_vel,
657 cs_lnum_t face_id);
658
659/*----------------------------------------------------------------------------
660 * Compute epsilon sup for perfect gas.
661 *
662 * parameters:
663 * dens <-- array of density values
664 * eps_sup --> epsilon sup array
665 * l_size <-- l_size of the array
666 *----------------------------------------------------------------------------*/
667
668void
670 cs_real_t *eps_sup,
671 cs_lnum_t l_size);
672
673/*----------------------------------------------------------------------------
674 * This subroutine is a driver allowing to call the appropriate
675 * thermodynamical functions depending on the quantities provided by the user.
676 * Hence it is only used during the initialization step and at the boundaries
677 * of type supersonic inlet. It is described in the following how to select the
678 * quantity to be returned.
679 *
680 * When calling the user subroutine, the integer 'iccfth' specifies which
681 * calculation has to be performed (and which quantity has to be returned).
682 * The values for 'iccfth' for each case are provided below.
683 *
684 * The variables are referred to using a different index i:
685 *
686 * - pressure: 2
687 * - density: 3
688 * - temperature: 5
689 * - internal energy: 7
690 * - entropy: 13
691 *
692 * iccfth is as follows, depending on which quantity needs to be computed:
693 * - variables at cell centers from variable i and variable j (i<j):
694 * iccfth = i*j*10000
695 * - variables at boundary faces from variable i and variable j (i<j):
696 * iccfth = i*j*10000+900
697 *
698 * Detailed values of iccfth and corresponding computations:
699 *
700 * Values at the cell centers:
701 *
702 * - temperature and energy from pressure and density: iccfth = 60000
703 * - density and energy from pressure and temperature: iccfth = 100000
704 * - density and temperature from pressure and energy: iccfth = 140000
705 * - pressure and energy from density and temperature: iccfth = 150000
706 * - pressure and temperature from density and energy: iccfth = 210000
707 *
708 * Values at the faces for boundary conditions:
709 * - temperature and energy from pressure and density: iccfth = 60900
710 * - density and energy from pressure and temperature: iccfth = 100900
711 * - density and temperature from pressure and energy: iccfth = 140900
712 * - pressure and energy from density and temperature: iccfth = 150900
713 * - pressure and temperature from density and energy: iccfth = 210900
714 *
715 * parameters:
716 * iccfth --> id of computation
717 * face_id --> face index if the computation is for a B.C.
718 * bc_en <-- total energy values at boundary faces
719 * bc_pr <-- pressure values at boundary faces
720 * bc_tk <-- temperature values at boundary faces
721 * bc_vel <-- velocity values at boundary faces
722 * bc_fracv <-- volume fraction values at boundary faces
723 * bc_fracm <-- mass fraction values at boundary faces
724 * bc_frace <-- energy fraction values at boundary faces
725 *----------------------------------------------------------------------------*/
726
727void
728cs_cf_thermo(const int iccfth,
729 cs_lnum_t face_id,
730 cs_real_t *bc_en,
731 cs_real_t *bc_pr,
732 cs_real_t *bc_tk,
733 cs_real_3_t *bc_vel,
734 cs_real_t *bc_fracv,
735 cs_real_t *bc_fracm,
736 cs_real_t *bc_frace);
737
738/*----------------------------------------------------------------------------*/
739
741
742#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.c:193
const cs_cf_model_t * cs_glob_cf_model
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.c:937
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.c:479
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.c:224
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:136
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.c:120
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, cs_real_t *bc_fracv, cs_real_t *bc_fracm, cs_real_t *bc_frace)
This subroutine is a driver allowing to call the appropriate thermodynamical functions depending on t...
Definition cs_cf_thermo.c:1692
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.c:727
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.c:883
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:188
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:270
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:241
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:164
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.c:847
void cs_cf_thermo_eps_sup(cs_real_t *dens, cs_real_t *eps_sup, cs_lnum_t l_size)
Compute epsilon sup:
Definition cs_cf_thermo.c:1610
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:303
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.c:411
void cs_cf_check_pressure(cs_real_t *pres, cs_lnum_t l_size)
Check the positivity of the pressure.
Definition cs_cf_thermo.c:185
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.c:798
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:215
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.c:624
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.c:1285
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.c:265
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.c:95
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.c:555
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.c:341
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.c:300
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:100
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.c:1040
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
#define _(String)
Definition cs_defs.h:52
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:315
#define END_C_DECLS
Definition cs_defs.h:468
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:298
@ gamma
Definition cs_field_pointer.h:223
@ eps
Definition cs_field_pointer.h:71
@ cv
Definition cs_field_pointer.h:107
@ vel
Definition cs_field_pointer.h:68
@ cp
Definition cs_field_pointer.h:106
int ieos
Definition cs_cf_model.h:54
double gammasg
Definition cs_cf_model.h:62
Definition cs_cf_thermo.h:55
cs_real_t cv
Definition cs_cf_thermo.h:57
cs_real_t q
Definition cs_cf_thermo.h:61
cs_real_t qprim
Definition cs_cf_thermo.h:60
cs_real_t gamma
Definition cs_cf_thermo.h:58
cs_real_t pinf
Definition cs_cf_thermo.h:59