Functions to handle the cs_thermal_system_t structure. This module can be used stand alone or linked with another module such as Navier-Stokes, groundwater flows or Maxwell... The temperature field is automatically defined when this module is activated. More...
#include "cs_advection_field.h"
#include "cs_equation.h"
#include "cs_field.h"
#include "cs_property.h"
#include "cs_mesh.h"
#include "cs_source_term.h"
#include "cs_time_step.h"
#include "cs_xdef.h"
Go to the source code of this file.
Data Structures | |
struct | cs_thermal_system_t |
Macros | |
#define | CS_THERMAL_EQNAME "thermal_equation" |
#define | CS_THERMAL_CP_NAME "thermal_capacity" |
#define | CS_THERMAL_LAMBDA_NAME "thermal_conductivity" |
Flags specifying automatic post-processing for the thermal module | |
#define | CS_THERMAL_POST_ENTHALPY (1 << 0) /* 1 */ |
Create a field storing the enthalpy for post-processing and extra-operation. More... | |
Typedefs | |
typedef cs_flag_t | cs_thermal_model_type_t |
Enumerations | |
enum | cs_thermal_model_type_bit_t { CS_THERMAL_MODEL_STEADY = 1<<0, CS_THERMAL_MODEL_NAVSTO_ADVECTION = 1<<1, CS_THERMAL_MODEL_USE_TEMPERATURE = 1<<2, CS_THERMAL_MODEL_USE_ENTHALPY = 1<<3, CS_THERMAL_MODEL_USE_TOTAL_ENERGY = 1<<4, CS_THERMAL_MODEL_ANISOTROPIC_CONDUCTIVITY = 1<<5, CS_THERMAL_MODEL_IN_CELSIUS = 1<<7 } |
Bit values for physical modelling related to thermal system. More... | |
Functions | |
cs_real_t | cs_thermal_system_get_reference_temperature (void) |
Retrieve the value of the reference temperature associated to a thermal system. More... | |
void | cs_thermal_system_set_reference_temperature (cs_real_t ref) |
Set the value of the reference temperature associated to the thermal system. More... | |
cs_flag_t | cs_thermal_system_get_model (void) |
Retrieve the model flag related to a thermal system. More... | |
bool | cs_thermal_system_needs_navsto (void) |
Does the thermal system rely on the advection field associated to the Navier-Stokes equations ? More... | |
bool | cs_thermal_system_is_activated (void) |
Check if the resolution of the thermal system has been activated. More... | |
cs_thermal_system_t * | cs_thermal_system_activate (cs_flag_t model, cs_flag_t numeric, cs_flag_t post) |
Allocate and initialize the thermal system. More... | |
void | cs_thermal_system_destroy (void) |
Free the main structure related to the thermal system. More... | |
cs_equation_t * | cs_thermal_system_get_equation (void) |
Retrieve the main equation related to the thermal system. More... | |
cs_real_t * | cs_thermal_system_get_face_temperature (void) |
Retrieve the current temperature at face values. More... | |
void | cs_thermal_system_init_setup (void) |
Start setting-up the thermal system At this stage, numerical settings should be completely determined but connectivity and geometrical information is not yet available. More... | |
void | cs_thermal_system_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
Last step of the setup of the thermal system. More... | |
void | cs_thermal_system_compute_steady_state (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
Build and solve a steady-state thermal system. More... | |
void | cs_thermal_system_compute (bool cur2prev, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
Build and solve the thermal system. More... | |
void | cs_thermal_system_init_values (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts) |
Set an initial values for all quantities related to this module This is done after the setup step. More... | |
void | cs_thermal_system_update (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, bool cur2prev) |
Update the quantities related to the thermal module. More... | |
void | cs_thermal_system_extra_op (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq) |
Predefined extra-operations for the thermal system. More... | |
void | cs_thermal_system_extra_post (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step) |
Predefined post-processing output for the thermal system. The prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More... | |
void | cs_thermal_system_log_setup (void) |
Summary of the main options related to cs_thermal_system_t structure. More... | |
Functions to handle the cs_thermal_system_t structure. This module can be used stand alone or linked with another module such as Navier-Stokes, groundwater flows or Maxwell... The temperature field is automatically defined when this module is activated.
Moreover, one considers according to the modelling rho the volumetric mass (mass density) Cp the heat capacity lambda the heat conductivity
#define CS_THERMAL_CP_NAME "thermal_capacity" |
#define CS_THERMAL_EQNAME "thermal_equation" |
#define CS_THERMAL_LAMBDA_NAME "thermal_conductivity" |
#define CS_THERMAL_POST_ENTHALPY (1 << 0) /* 1 */ |
Create a field storing the enthalpy for post-processing and extra-operation.
typedef cs_flag_t cs_thermal_model_type_t |
cs_thermal_system_t* cs_thermal_system_activate | ( | cs_thermal_model_type_t | model, |
cs_flag_t | numeric, | ||
cs_flag_t | post | ||
) |
Allocate and initialize the thermal system.
[in] | model | model flag related to the thermal system |
[in] | numeric | (optional) numerical flag settings |
[in] | post | (optional) post-processing flag settings |
void cs_thermal_system_compute | ( | bool | cur2prev, |
const cs_mesh_t * | mesh, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step | ||
) |
Build and solve the thermal system.
[in] | cur2prev | true="current to previous" operation is performed |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
void cs_thermal_system_compute_steady_state | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step | ||
) |
Build and solve a steady-state thermal system.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
void cs_thermal_system_destroy | ( | void | ) |
Free the main structure related to the thermal system.
void cs_thermal_system_extra_op | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | cdoq | ||
) |
Predefined extra-operations for the thermal system.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
Predefined extra-operations for the thermal system.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
void cs_thermal_system_extra_post | ( | void * | input, |
int | mesh_id, | ||
int | cat_id, | ||
int | ent_flag[5], | ||
cs_lnum_t | n_cells, | ||
cs_lnum_t | n_i_faces, | ||
cs_lnum_t | n_b_faces, | ||
const cs_lnum_t | cell_ids[], | ||
const cs_lnum_t | i_face_ids[], | ||
const cs_lnum_t | b_face_ids[], | ||
const cs_time_step_t * | time_step | ||
) |
Predefined post-processing output for the thermal system. The prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)
[in,out] | input | pointer to a optional structure (here a cs_thermal_system_t structure) |
[in] | mesh_id | id of the output mesh for the current call |
[in] | cat_id | category id of the output mesh for this call |
[in] | ent_flag | indicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4]) |
[in] | n_cells | local number of cells of post_mesh |
[in] | n_i_faces | local number of interior faces of post_mesh |
[in] | n_b_faces | local number of boundary faces of post_mesh |
[in] | cell_ids | list of cells (0 to n-1) |
[in] | i_face_ids | list of interior faces (0 to n-1) |
[in] | b_face_ids | list of boundary faces (0 to n-1) |
[in] | time_step | pointer to a cs_time_step_t struct. |
void cs_thermal_system_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step | ||
) |
Last step of the setup of the thermal system.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
cs_equation_t* cs_thermal_system_get_equation | ( | void | ) |
Retrieve the main equation related to the thermal system.
cs_real_t* cs_thermal_system_get_face_temperature | ( | void | ) |
Retrieve the current temperature at face values.
cs_flag_t cs_thermal_system_get_model | ( | void | ) |
Retrieve the model flag related to a thermal system.
cs_real_t cs_thermal_system_get_reference_temperature | ( | void | ) |
Retrieve the value of the reference temperature associated to a thermal system.
void cs_thermal_system_init_setup | ( | void | ) |
Start setting-up the thermal system At this stage, numerical settings should be completely determined but connectivity and geometrical information is not yet available.
void cs_thermal_system_init_values | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts | ||
) |
Set an initial values for all quantities related to this module This is done after the setup step.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
bool cs_thermal_system_is_activated | ( | void | ) |
Check if the resolution of the thermal system has been activated.
void cs_thermal_system_log_setup | ( | void | ) |
Summary of the main options related to cs_thermal_system_t structure.
bool cs_thermal_system_needs_navsto | ( | void | ) |
Does the thermal system rely on the advection field associated to the Navier-Stokes equations ?
void cs_thermal_system_set_reference_temperature | ( | cs_real_t | ref | ) |
Set the value of the reference temperature associated to the thermal system.
[in] | ref | value of the reference temperature |
void cs_thermal_system_update | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts, | ||
bool | cur2prev | ||
) |
Update the quantities related to the thermal module.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
[in] | cur2prev | true or false |