My Project
programmer's documentation
|
#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_printf.h"
#include "cs_field.h"
#include "cs_field_pointer.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_parameters.h"
#include "cs_thermal_model.h"
#include "cs_cf_model.h"
#include "cs_hgn_thermo.h"
#include "cs_cf_thermo.h"
Functions | |
void | cs_cf_set_thermo_options (void) |
Set variability of isobaric specific heat and isochoric specific heat according to the chosen thermodynamic law. More... | |
void | cs_cf_thermo_default_init (void) |
Initialize density, total energy and isochoric specific heat according to the chosen thermodynamic law using the default parameters. More... | |
void | cs_cf_check_pressure (cs_real_t *pres, cs_lnum_t l_size) |
Check the positivity of the pressure. More... | |
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. More... | |
void | cs_cf_check_density (cs_real_t *dens, cs_lnum_t l_size) |
Check the positivity of the density given by the user. More... | |
void | cs_cf_check_temperature (cs_real_t *temp, cs_lnum_t l_size) |
Check strict positivity of temperature (Celsius) given by the user. More... | |
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. More... | |
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. More... | |
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;. More... | |
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. More... | |
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. More... | |
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: More... | |
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: More... | |
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: More... | |
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: More... | |
void | cs_cf_thermo_wall_bc (cs_real_t *wbfa, cs_real_t *wbfb, cs_lnum_t face_id) |
Compute wall boundary condition values. More... | |
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. More... | |
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. More... | |
void | cs_cf_thermo_eps_sup (cs_real_t *dens, cs_real_t *eps_sup, cs_lnum_t l_size) |
Compute epsilon sup: More... | |
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 the quantities provided by the user. Hence it is only used during the initialization step and at the boundaries of type supersonic inlet. It is described in the following how to select the quantity to be returned. More... | |
Define thermodynamic laws for the compressible flow module. Only the perfect gas law is available for now. The molar mass has to be provided either in the GUI or in cs_user_parameters.f90.
Check the positivity of the density given by the user.
[in] | dens | array of density values |
[in] | l_size | l_size of the array |
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.
[in] | ener | array of total energy values |
[in] | l_size | l_size of the array |
[in] | vel | array of velocity values |
Check the positivity of the pressure.
[in] | pres | array of pressure values |
[in] | l_size | l_size of the array |
Check strict positivity of temperature (Celsius) given by the user.
[in] | temp | array of temperature values |
[in] | l_size | l_size of the array |
void cs_cf_set_thermo_options | ( | void | ) |
Set variability of isobaric specific heat and isochoric specific heat according to the chosen thermodynamic law.
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 the quantities provided by the user. Hence it is only used during the initialization step and at the boundaries of type supersonic inlet. It is described in the following how to select the quantity to be returned.
When calling the user subroutine, the integer 'iccfth' specifies which calculation has to be performed (and which quantity has to be returned). The values for 'iccfth' for each case are provided below.
The variables are referred to using a different index i:
iccfth is as follows, depending on which quantity needs to be computed:
Detailed values of iccfth and corresponding computations:
Values at the cell centers:
Values at the faces for boundary conditions:
[in] | iccfth | id of computation |
[in] | face_id | face index if the computation is for a B.C. -1 if the computation is located on cells |
[in,out] | bc_en | total energy values at boundary faces |
[in,out] | bc_pr | pressure values at boundary faces |
[in,out] | bc_tk | temperature values at boundary faces |
[in,out] | bc_vel | velocity values at boundary faces |
[in,out] | bc_fracv | volume fraction values at boundary faces |
[in,out] | bc_fracm | mass fraction values at boundary faces |
[in,out] | bc_frace | energy fraction values at boundary faces |
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:
for a perfect gas, the explicit formula is:
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | dens | array of density values |
[out] | beta | array of beta values |
[in] | l_size | l_size of the array |
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:
;
for perfect gas, this expression simply writes:
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | pres | array of pressure values |
[in] | dens | array of density 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] | c2 | array of the values of the square of sound velocity |
[in] | l_size | l_size of the array |
Compute the isochoric specific heat:
[in] | cp | array of isobaric specific heat values |
[in] | xmasml | array of molar mass values |
[out] | cv | array of isochoric specific heat values |
[in] | l_size | l_size of the array |
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.
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | pres | array of pressure values |
[in] | temp | array of temperature values |
[out] | dens | array of density values |
[out] | ener | array of total energy values |
[in] | vel | array of velocity component values |
[in] | l_size | l_size of the array |
void cs_cf_thermo_default_init | ( | void | ) |
Initialize density, total energy and isochoric specific heat according to the chosen thermodynamic law using the default parameters.
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;.
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | pres | array of pressure values |
[in] | ener | array of total energy values |
[out] | dens | array of density values |
[out] | temp | array of temperature values |
[in] | vel | array of velocity component values |
[in] | l_size | l_size of the array |
Compute epsilon sup:
for perfect gas:
[in] | dens | array of density values |
[out] | eps_sup | epsilon sup array |
[in] | l_size | l_size of the array |
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.
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | dens | array of density values |
[in] | temp | array of temperature values |
[out] | pres | array of pressure values |
[out] | ener | array of total energy values |
[in] | vel | array of velocity component values |
[in] | l_size | l_size of the array |
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.
[in,out] | bc_en | total energy values at boundary faces |
[in,out] | bc_pr | pressure values at boundary faces |
[in,out] | bc_vel | velocity values at boundary faces |
[in] | face_id | boundary face index |
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.
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | dens | array of density values |
[in] | ener | array of total energy values |
[out] | pres | array of pressure values |
[out] | temp | array of temperature values |
[in] | vel | array of velocity component 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 |
[in] | l_size | l_size of the array |
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:
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | dens | array of density values |
[in] | pres | array of pressure values |
[out] | entr | array of total energy values |
[in] | l_size | l_size of the array |
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.
[in,out] | bc_en | total energy values at boundary faces |
[in,out] | bc_pr | pressure values at boundary faces |
[in,out] | bc_vel | velocity values at boundary faces |
[in] | face_id | boundary face index |
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.
[in] | cp | array of isobaric specific heat values |
[in] | cv | array of isochoric specific heat values |
[in] | pres | array of pressure values |
[in] | dens | array of density values |
[out] | temp | array of temperature values |
[out] | ener | array of total energy values |
[in] | vel | array of velocity component values |
[in] | l_size | l_size of the array |