#include "cs_defs.h"#include <assert.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "bft_mem.h"#include "bft_error.h"#include "bft_printf.h"#include "cs_array.h"#include "cs_field.h"#include "cs_field_pointer.h"#include "cs_log.h"#include "cs_map.h"#include "cs_parall.h"#include "cs_mesh_location.h"#include "cs_physical_constants.h"#include "cs_air_props.h"#include "cs_field_operator.h"#include "cs_field_default.h"#include "cs_xdef.h"#include "cs_cf_model.h"#include "cs_thermal_model.h" Include dependency graph for cs_thermal_model.c:
 Include dependency graph for cs_thermal_model.c:| Functions | |
| cs_field_t * | cs_thermal_model_field (void) | 
| cs_thermal_model_t * | cs_get_glob_thermal_model (void) | 
| void | cs_thermal_model_log_setup (void) | 
| void | cs_thermal_model_init (void) | 
| Initialize thermal variables if needed.  More... | |
| void | cs_thermal_model_c_square (const cs_real_t cp[], const cs_real_t temp[], const cs_real_t pres[], const cs_real_t fracv[], const cs_real_t fracm[], const cs_real_t frace[], cs_real_t dc2[]) | 
| Compute the inverse of the square of sound velocity multiplied by gamma.  More... | |
| cs_real_t | cs_thermal_model_demdt (cs_real_t pres, cs_real_t temp, cs_real_t yw) | 
| Compute the derivative of the internal energy related to the temperature at constant pressure.  More... | |
| cs_real_t | cs_thermal_model_demdt_ecsnt (cs_real_t pres, cs_real_t temp, cs_real_t yw, cs_real_t cpa, cs_real_t cpv, cs_real_t cpl, cs_real_t l00) | 
| Compute the derivative of the internal energy related to the temperature at constant internal energy.  More... | |
| void | cs_thermal_model_kinetic_st_prepare (const cs_real_t imasfl[], const cs_real_t bmasfl[], const cs_real_t vela[][3], const cs_real_t vel[][3]) | 
| First pass to compute the contribution of the kinetic energy based source term from the prediction step.  More... | |
| void | cs_thermal_model_kinetic_st_finalize (const cs_real_t cromk1[], const cs_real_t cromk[]) | 
| Finalize the computation of the kinetic energy based source term.  More... | |
| void | cs_thermal_model_add_kst (cs_real_t smbrs[]) | 
| Add the kinetic source term if needed.  More... | |
| void | cs_thermal_model_cflp (const cs_real_t croma[], const cs_real_t trav2[][3], const cs_real_t cvara_pr[], const cs_real_t imasfl[], cs_real_t cflp[]) | 
| Compute the CFL number related to the pressure equation.  More... | |
| void | cs_thermal_model_cv (cs_real_t *xcvv) | 
| Compute the isochoric heat capacity.  More... | |
| void | cs_thermal_model_dissipation (const cs_real_t vistot[], const cs_real_t gradv[][3][3], cs_real_t smbrs[]) | 
| Compute and add the dissipation term of the thermal equation to its right hand side.  More... | |
| void | cs_thermal_model_newton_t (int method, const cs_real_t *pk1, const cs_real_t th_scal[], const cs_real_t cvar_pr[], const cs_real_t cvara_pr[], const cs_real_t yw[], cs_real_t yv[], cs_real_t temp[]) | 
| Perform the Newton method to compute the temperature from the internal energy.  More... | |
| void | cs_thermal_model_pdivu (cs_real_t smbrs[restrict]) | 
| Add the term pdivu to the thermal equation rhs.  More... | |
| void | cs_thermal_model_cflt (const cs_real_t croma[], const cs_real_t tempk[], const cs_real_t tempka[], const cs_real_t xcvv[], const cs_real_t vel[][3], const cs_real_t imasfl[], cs_real_t cflt[restrict]) | 
| Compute the CFL number related to the thermal equation.  More... | |
base thermal model data.
| cs_thermal_model_t* cs_get_glob_thermal_model | ( | void | ) | 
| void cs_thermal_model_add_kst | ( | cs_real_t | smbrs[] | ) | 
Add the kinetic source term if needed.
| [in,out] | smbrs | RHS of the thermal equation | 
| void cs_thermal_model_c_square | ( | const cs_real_t | cp[], | 
| const cs_real_t | temp[], | ||
| const cs_real_t | pres[], | ||
| const cs_real_t | fracv[], | ||
| const cs_real_t | fracm[], | ||
| const cs_real_t | frace[], | ||
| cs_real_t | dc2[] | ||
| ) | 
Compute the inverse of the square of sound velocity multiplied by gamma.
| [in] | cp | array of isobaric specific heat values for dry air | 
| [in] | temp | array of temperature values | 
| [in] | pres | array of pressure values | 
| [in,out] | fracv | array of volume fraction values | 
| [in,out] | fracm | array of mass fraction values | 
| [in,out] | frace | array of energy fraction values | 
| [out] | dc2 | array of the values of the square of sound velocity | 
| void cs_thermal_model_cflp | ( | const cs_real_t | croma[], | 
| const cs_real_t | trav2[][3], | ||
| const cs_real_t | cvara_pr[], | ||
| const cs_real_t | imasfl[], | ||
| cs_real_t | cflp[] | ||
| ) | 
Compute the CFL number related to the pressure equation.
| [in] | croma | density values at the last time iteration | 
| [in] | trav2 | predicted velocity | 
| [in] | cvara_pr | pressure values at the last time iteration | 
| [in] | imasfl | face mass fluxes | 
| [in,out] | cflp | CFL condition related to the pressure equation | 
| void cs_thermal_model_cflt | ( | const cs_real_t | croma[], | 
| const cs_real_t | tempk[], | ||
| const cs_real_t | tempka[], | ||
| const cs_real_t | xcvv[], | ||
| const cs_real_t | vel[][3], | ||
| const cs_real_t | imasfl[], | ||
| cs_real_t | cflt[restrict] | ||
| ) | 
Compute the CFL number related to the thermal equation.
| [in] | croma | array of density values at the last time iteration | 
| [in] | tempk | array of the temperature | 
| [in] | tempka | array of the temperature at the previous time step | 
| [in] | xcvv | array of the isochoric heat capacity | 
| [in] | vel | array of the velocity | 
| [in] | imasfl | array of the faces mass fluxes | 
| [in] | cflt | CFL condition related to thermal equation | 
| void cs_thermal_model_cv | ( | cs_real_t * | xcvv | ) | 
Compute the isochoric heat capacity.
| [in] | xcvv | isobaric heat capacity | 
Compute the derivative of the internal energy related to the temperature at constant pressure.
| [in] | pres | array of pressure values | 
| [in] | temp | array of temperature values (in Kelvin) | 
| [in] | yw | array of the total water mass fraction | 
| cs_real_t cs_thermal_model_demdt_ecsnt | ( | cs_real_t | pres, | 
| cs_real_t | temp, | ||
| cs_real_t | yw, | ||
| cs_real_t | cpa, | ||
| cs_real_t | cpv, | ||
| cs_real_t | cpl, | ||
| cs_real_t | l00 | ||
| ) | 
Compute the derivative of the internal energy related to the temperature at constant internal energy.
| [in] | pres | array of pressure values | 
| [in] | temp | array of temperature values (in Kelvin) | 
| [in] | yw | array of the total water mass fraction | 
| [in] | cpa | heat capacity of the dry air | 
| [in] | cpv | heat capacity of the water in its gaseous phase | 
| [in] | cpl | heat capacity of the water in its liquid phase | 
| [in] | l00 | water latent heat | 
| void cs_thermal_model_dissipation | ( | const cs_real_t | vistot[], | 
| const cs_real_t | gradv[][3][3], | ||
| cs_real_t | smbrs[] | ||
| ) | 
Compute and add the dissipation term of the thermal equation to its right hand side.
| [in] | vistot | array for the total viscosity | 
| [in] | gradv | tensor for the velocity gradient | 
| [in,out] | smbrs | array of equation right hand side | 
| cs_field_t* cs_thermal_model_field | ( | void | ) | 
| void cs_thermal_model_init | ( | void | ) | 
Initialize thermal variables if needed.
Finalize the computation of the kinetic energy based source term.
| [in] | cromk1 | density values at time n+1/2,k-1 | 
| [in] | cromk | density values at time n+1/2,k | 
| void cs_thermal_model_kinetic_st_prepare | ( | const cs_real_t | imasfl[], | 
| const cs_real_t | bmasfl[], | ||
| const cs_real_t | vela[][3], | ||
| const cs_real_t | vel[][3] | ||
| ) | 
First pass to compute the contribution of the kinetic energy based source term from the prediction step.
| [in] | imasfl | inner mass flux used in the momentum equation | 
| [in] | bmasfl | boundary mass flux used in the momentum equation | 
| [in] | vela | velocity at previous time step | 
| [in] | vel | velocity at iteration k | 
| void cs_thermal_model_log_setup | ( | void | ) | 
| void cs_thermal_model_newton_t | ( | int | method, | 
| const cs_real_t * | pk1, | ||
| const cs_real_t | th_scal[], | ||
| const cs_real_t | cvar_pr[], | ||
| const cs_real_t | cvara_pr[], | ||
| const cs_real_t | yw[], | ||
| cs_real_t | yv[], | ||
| cs_real_t | temp[] | ||
| ) | 
Perform the Newton method to compute the temperature from the internal energy.
| [in] | method | method used to compute the temperature | 
| [in] | pk1 | pressure values at the last inner iteration | 
| [in] | th_scal | internal energy values | 
| [in] | cvar_pr | pressure values | 
| [in] | cvara_pr | pressure values at the last time iteration | 
| [in] | yw | total water mass fraction | 
| [in,out] | yv | vapor of water mass fraction | 
| [in,out] | temp | temperature values | 
| void cs_thermal_model_pdivu | ( | cs_real_t | smbrs[restrict] | ) | 
Add the term pdivu to the thermal equation rhs.
| [in,out] | smbrs | array of the right hand side |