1 #ifndef __CS_CF_THERMO_H__
2 #define __CS_CF_THERMO_H__
111 tmp1 = energ - Q - vol*Pinf;
114 if (tmp1 >
eps) s += CV*log(tmp1);
115 if (tmp2 >
eps) s += CV*(
gamma-1.)*log(tmp2);
198 e = Q + CV*T*(P+
gamma*Pinf) / tmp;
224 tau = (
gamma-1.)*CV*T / tmp;
253 - CV*(
gamma-1.)*log(tmp) + Qprim;
284 tmp2 = exp((s - Qprim) / CV);
285 e = Q +
v * Pinf + tmp1*tmp2;
318 for (
cs_lnum_t ii = 0; ii < l_size; ii++) {
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"));
331 for (
cs_lnum_t ii = 0; ii < l_size; ii++)
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
@ 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.c:935
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:477
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:223
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:1691
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:135
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:1833
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:1610
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_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:725
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:881
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:187
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:269
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:240
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:163
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:845
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:302
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:409
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:796
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:214
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:622
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:1283
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:263
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:553
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:339
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:298
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:99
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:1038
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define _(String)
Definition: cs_defs.h:63
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
@ gamma
Definition: cs_field_pointer.h:221
@ eps
Definition: cs_field_pointer.h:71
@ cv
Definition: cs_field_pointer.h:101
@ vel
Definition: cs_field_pointer.h:68
@ cp
Definition: cs_field_pointer.h:100
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
int ieos
Definition: cs_cf_model.h:51
double gammasg
Definition: cs_cf_model.h:59
double precision, dimension(ncharm), save beta
Definition: cpincl.f90:96
double precision, dimension(ncharm), save c2
Definition: cpincl.f90:235
Definition: cs_cf_thermo.h:54
cs_real_t cv
Definition: cs_cf_thermo.h:56
cs_real_t q
Definition: cs_cf_thermo.h:60
cs_real_t qprim
Definition: cs_cf_thermo.h:59
cs_real_t gamma
Definition: cs_cf_thermo.h:57
cs_real_t pinf
Definition: cs_cf_thermo.h:58