9.0
general documentation
Loading...
Searching...
No Matches
cs_thermal_model.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "bft/bft_mem.h"
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "atmo/cs_air_props.h"
#include "base/cs_array.h"
#include "base/cs_dispatch.h"
#include "base/cs_field.h"
#include "base/cs_field_default.h"
#include "base/cs_field_operator.h"
#include "base/cs_field_pointer.h"
#include "base/cs_log.h"
#include "base/cs_map.h"
#include "mesh/cs_mesh_location.h"
#include "base/cs_parall.h"
#include "base/cs_physical_constants.h"
#include "cdo/cs_xdef.h"
#include "cfbl/cs_cf_model.h"
#include "base/cs_thermal_model.h"
Include dependency graph for cs_thermal_model.cpp:

Functions

cs_field_tcs_thermal_model_field (void)
cs_thermal_model_tcs_get_glob_thermal_model (void)
void cs_thermal_model_log_setup (void)
void cs_thermal_model_init (void)
 Initialize thermal variables if needed.
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.
CS_F_HOST_DEVICE cs_real_t cs_thermal_model_demdt (const cs_real_t pres, const cs_real_t temp, const cs_real_t yw, const cs_real_t rvsra, const cs_real_t cva, const cs_real_t cvv, const cs_real_t cpl, const cs_real_t l00)
 Compute the derivative of the internal energy related to the temperature at constant pressure.
CS_F_HOST_DEVICE cs_real_t cs_thermal_model_demdt_ecsnt (const cs_real_t pres, const cs_real_t temp, const cs_real_t yw, const cs_real_t rvsra, const cs_real_t cva, const cs_real_t cvv, const cs_real_t cpl, const cs_real_t l00)
 Compute the derivative of the internal energy related to the temperature at constant internal energy.
void cs_thermal_model_kinetic_st_prepare (const cs_real_t i_massflux[], const cs_real_t b_massflux[], 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.
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.
void cs_thermal_model_add_kst (cs_real_t smbrs[])
 Add the kinetic source term if needed.
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 i_massflux[], cs_real_t cflp[])
 Compute the CFL number related to the pressure equation.
void cs_thermal_model_cv (cs_real_t *xcvv)
 Compute the isochoric heat capacity.
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.
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.
void cs_thermal_model_pdivu (cs_real_t smbrs[])
 Add the term pdivu to the thermal equation rhs.
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 i_massflux[], const cs_real_t b_massflux[], cs_real_t cflt[])
 Compute the CFL number related to the thermal equation.

Detailed Description

base thermal model data.

Function Documentation

◆ cs_get_glob_thermal_model()

cs_thermal_model_t * cs_get_glob_thermal_model ( void )

◆ cs_thermal_model_add_kst()

void cs_thermal_model_add_kst ( cs_real_t smbrs[])

Add the kinetic source term if needed.

Parameters
[in,out]smbrsRHS of the thermal equation

◆ cs_thermal_model_c_square()

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.

Parameters
[in]cparray of isobaric specific heat values for dry air
[in]temparray of temperature values
[in]presarray of pressure values
[in,out]fracvarray of volume fraction values
[in,out]fracmarray of mass fraction values
[in,out]fracearray of energy fraction values
[out]dc2array of the values of the square of sound velocity

◆ cs_thermal_model_cflp()

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 i_massflux[],
cs_real_t cflp[] )

Compute the CFL number related to the pressure equation.

Parameters
[in]cromadensity values at the last time iteration
[in]trav2predicted velocity
[in]cvara_prpressure values at the last time iteration
[in]i_massfluxface mass fluxes
[in,out]cflpCFL condition related to the pressure equation

◆ cs_thermal_model_cflt()

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 i_massflux[],
const cs_real_t b_massflux[],
cs_real_t cflt[] )

Compute the CFL number related to the thermal equation.

Parameters
[in]cromaarray of density values at the last time iteration
[in]tempkarray of the temperature
[in]tempkaarray of the temperature at the previous time step
[in]xcvvarray of the isochoric heat capacity
[in]velarray of the velocity
[in]i_massfluxarray of the inner faces mass fluxes
[in]b_massfluxarray of the boundary faces mass fluxes
[in]cfltCFL condition related to thermal equation

◆ cs_thermal_model_cv()

void cs_thermal_model_cv ( cs_real_t * xcvv)

Compute the isochoric heat capacity.

Parameters
[in]xcvvisobaric heat capacity

◆ cs_thermal_model_demdt()

CS_F_HOST_DEVICE cs_real_t cs_thermal_model_demdt ( const cs_real_t pres,
const cs_real_t temp,
const cs_real_t yw,
const cs_real_t rvsra,
const cs_real_t cva,
const cs_real_t cvv,
const cs_real_t cpl,
const cs_real_t l00 )

Compute the derivative of the internal energy related to the temperature at constant pressure.

Parameters
[in]presarray of pressure values
[in]temparray of temperature values (in Kelvin)
[in]ywarray of the total water mass fraction
[in]rvsraratio gas constant h2o / dry air
[in]cvadifference between heat capacity of the dry air and r_pg_const
[in]cvvdifference beteween heat capacity of the water in its gaseous phase and r_v_cnst
[in]cplheat capacity of the water in its liquid phase
[in]l00water latent heat

◆ cs_thermal_model_demdt_ecsnt()

CS_F_HOST_DEVICE cs_real_t cs_thermal_model_demdt_ecsnt ( const cs_real_t pres,
const cs_real_t temp,
const cs_real_t yw,
const cs_real_t rvsra,
const cs_real_t cva,
const cs_real_t cvv,
const cs_real_t cpl,
const cs_real_t l00 )

Compute the derivative of the internal energy related to the temperature at constant internal energy.

Parameters
[in]presarray of pressure values
[in]temparray of temperature values (in Kelvin)
[in]ywarray of the total water mass fraction
[in]rvsraratio gas constant h2o / dry air
[in]cvadifference between heat capacity of the dry air and r_pg_const
[in]cvvdifference beteween heat capacity of the water in its gaseous phase and r_v_cnst
[in]cplheat capacity of the water in its liquid phase
[in]l00water latent heat

◆ cs_thermal_model_dissipation()

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.

Parameters
[in]vistotarray for the total viscosity
[in]gradvtensor for the velocity gradient
[in,out]smbrsarray of equation right hand side

◆ cs_thermal_model_field()

cs_field_t * cs_thermal_model_field ( void )

◆ cs_thermal_model_init()

void cs_thermal_model_init ( void )

Initialize thermal variables if needed.

◆ cs_thermal_model_kinetic_st_finalize()

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.

Parameters
[in]cromk1density values at time n+1/2,k-1
[in]cromkdensity values at time n+1/2,k

◆ cs_thermal_model_kinetic_st_prepare()

void cs_thermal_model_kinetic_st_prepare ( const cs_real_t i_massflux[],
const cs_real_t b_massflux[],
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.

Parameters
[in]i_massfluxinner mass flux used in the momentum equation
[in]b_massfluxboundary mass flux used in the momentum equation
[in]velavelocity at previous time step
[in]velvelocity at iteration k

◆ cs_thermal_model_log_setup()

void cs_thermal_model_log_setup ( void )

◆ cs_thermal_model_newton_t()

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.

Parameters
[in]methodmethod used to compute the temperature
[in]pk1pressure values at the last inner iteration
[in]th_scalinternal energy values
[in]cvar_prpressure values
[in]cvara_prpressure values at the last time iteration
[in]ywtotal water mass fraction
[in,out]yvvapor of water mass fraction
[in,out]temptemperature values

◆ cs_thermal_model_pdivu()

void cs_thermal_model_pdivu ( cs_real_t smbrs[])

Add the term pdivu to the thermal equation rhs.

Parameters
[in,out]smbrsarray of the right hand side