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