![]() |
programmer's documentation
|
Structure and routines handling the specific settings related to a cs_equation_t structure. More...
#include "cs_param.h"
#include "cs_param_cdo.h"
#include "cs_property.h"
#include "cs_advection_field.h"
#include "cs_xdef.h"
Go to the source code of this file.
Data Structures | |
struct | cs_equation_param_t |
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources. More... | |
Macros | |
Flags specifying which term is needed for an equation. | |
#define | CS_EQUATION_LOCKED (1 << 0) |
Parameters for setting an equation are not modifiable anymore. More... | |
#define | CS_EQUATION_UNSTEADY (1 << 1) |
Unsteady term is needed. More... | |
#define | CS_EQUATION_CONVECTION (1 << 2) |
Convection term is needed. More... | |
#define | CS_EQUATION_DIFFUSION (1 << 3) |
Diffusion term is needed. More... | |
#define | CS_EQUATION_REACTION (1 << 4) |
Reaction term is needed. More... | |
Flags specifying which extra operation is needed for an equation. | |
#define | CS_EQUATION_POST_PECLET (1 << 0) |
Compute and postprocess the Peclet number. More... | |
#define | CS_EQUATION_POST_UPWIND_COEF (1 << 1) |
Postprocess the value of the upwinding coefficient. More... | |
Functions | |
static bool | cs_equation_param_has_diffusion (const cs_equation_param_t *eqp) |
Ask if the parameters of the equation needs a diffusion term. More... | |
static bool | cs_equation_param_has_convection (const cs_equation_param_t *eqp) |
Ask if the parameters of the equation needs a convection term. More... | |
static bool | cs_equation_param_has_reaction (const cs_equation_param_t *eqp) |
Ask if the parameters of the equation needs a reaction term. More... | |
static bool | cs_equation_param_has_time (const cs_equation_param_t *eqp) |
Ask if the parameters of the equation needs an unsteady term. More... | |
static bool | cs_equation_param_has_sourceterm (const cs_equation_param_t *eqp) |
Ask if the parameters of the equation needs a source term. More... | |
cs_equation_param_t * | cs_equation_create_param (cs_equation_type_t type, int dim, cs_param_bc_type_t default_bc) |
Create a cs_equation_param_t. More... | |
cs_equation_param_t * | cs_equation_free_param (cs_equation_param_t *eqp) |
Free a cs_equation_param_t. More... | |
void | cs_equation_set_param (cs_equation_param_t *eqp, cs_equation_key_t key, const char *keyval) |
Set a parameter attached to a keyname in a cs_equation_param_t structure. More... | |
void | cs_equation_param_set_sles (const char *eqname, cs_equation_param_t *eqp, int field_id) |
Set parameters for initializing SLES structures used for the resolution of the linear system. Settings are related to this equation. More... | |
void | cs_equation_summary_param (const char *eqname, const cs_equation_param_t *eqp) |
Summary of a cs_equation_param_t structure. More... | |
void | cs_equation_add_ic_by_value (cs_equation_param_t *eqp, const char *z_name, cs_real_t *val) |
Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location. More... | |
void | cs_equation_add_ic_by_qov (cs_equation_param_t *eqp, const char *z_name, double quantity) |
Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity. More... | |
void | cs_equation_add_ic_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *analytic, void *input) |
Define the initial condition for the unknown related to this equation. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function. More... | |
void | cs_equation_add_bc_by_value (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_real_t *values) |
Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t. More... | |
void | cs_equation_add_bc_by_array (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc, cs_real_t *array, cs_lnum_t *index) |
Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t. More... | |
void | cs_equation_add_bc_by_analytic (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_analytic_func_t *analytic, void *input) |
Define and initialize a new structure to set a boundary condition related to the given equation param structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t. More... | |
void | cs_equation_add_diffusion (cs_equation_param_t *eqp, cs_property_t *property) |
Define and initialize a new structure to store parameters related to a diffusion term. More... | |
void | cs_equation_add_time (cs_equation_param_t *eqp, cs_property_t *property) |
Define and initialize a new structure to store parameters related to an unsteady term. More... | |
void | cs_equation_add_advection (cs_equation_param_t *eqp, cs_adv_field_t *adv_field) |
Define and initialize a new structure to store parameters related to an advection term. More... | |
int | cs_equation_add_reaction (cs_equation_param_t *eqp, cs_property_t *property) |
Define and initialize a new structure to store parameters related to a reaction term. More... | |
cs_xdef_t * | cs_equation_add_source_term_by_val (cs_equation_param_t *eqp, const char *z_name, cs_real_t *val) |
Define a new source term structure and initialize it by value. More... | |
cs_xdef_t * | cs_equation_add_source_term_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *ana, void *input) |
Define a new source term structure and initialize it by an analytical function. More... | |
cs_xdef_t * | cs_equation_add_source_term_by_array (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc, cs_real_t *array, cs_lnum_t *index) |
Define a new source term defined by an array. More... | |
Structure and routines handling the specific settings related to a cs_equation_t structure.
#define CS_EQUATION_CONVECTION (1 << 2) |
Convection term is needed.
#define CS_EQUATION_DIFFUSION (1 << 3) |
Diffusion term is needed.
#define CS_EQUATION_LOCKED (1 << 0) |
Parameters for setting an equation are not modifiable anymore.
#define CS_EQUATION_POST_PECLET (1 << 0) |
Compute and postprocess the Peclet number.
#define CS_EQUATION_POST_UPWIND_COEF (1 << 1) |
Postprocess the value of the upwinding coefficient.
#define CS_EQUATION_REACTION (1 << 4) |
Reaction term is needed.
#define CS_EQUATION_UNSTEADY (1 << 1) |
Unsteady term is needed.
enum cs_equation_key_t |
List of available keys for setting the parameters of an equation.
enum cs_equation_type_t |
Type of equations managed by the solver.
void cs_equation_add_advection | ( | cs_equation_param_t * | eqp, |
cs_adv_field_t * | adv_field | ||
) |
Define and initialize a new structure to store parameters related to an advection term.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | adv_field | pointer to a cs_adv_field_t structure |
void cs_equation_add_bc_by_analytic | ( | cs_equation_param_t * | eqp, |
const cs_param_bc_type_t | bc_type, | ||
const char * | z_name, | ||
cs_analytic_func_t * | analytic, | ||
void * | input | ||
) |
Define and initialize a new structure to set a boundary condition related to the given equation param structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function defining the value |
[in] | input | NULL or pointer to a structure cast on-the-fly |
void cs_equation_add_bc_by_array | ( | cs_equation_param_t * | eqp, |
const cs_param_bc_type_t | bc_type, | ||
const char * | z_name, | ||
cs_flag_t | loc, | ||
cs_real_t * | array, | ||
cs_lnum_t * | index | ||
) |
Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the related boundary zone |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | index | optional pointer to the array index |
void cs_equation_add_bc_by_value | ( | cs_equation_param_t * | eqp, |
const cs_param_bc_type_t | bc_type, | ||
const char * | z_name, | ||
cs_real_t * | values | ||
) |
Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the related boundary zone |
[in] | values | pointer to a array storing the values |
void cs_equation_add_diffusion | ( | cs_equation_param_t * | eqp, |
cs_property_t * | property | ||
) |
Define and initialize a new structure to store parameters related to a diffusion term.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
void cs_equation_add_ic_by_analytic | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
cs_analytic_func_t * | analytic, | ||
void * | input | ||
) |
Define the initial condition for the unknown related to this equation. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
void cs_equation_add_ic_by_qov | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
double | quantity | ||
) |
Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | quantity | quantity to distribute over the mesh location |
void cs_equation_add_ic_by_value | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
int cs_equation_add_reaction | ( | cs_equation_param_t * | eqp, |
cs_property_t * | property | ||
) |
Define and initialize a new structure to store parameters related to a reaction term.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
cs_xdef_t* cs_equation_add_source_term_by_analytic | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
cs_analytic_func_t * | ana, | ||
void * | input | ||
) |
Define a new source term structure and initialize it by an analytical function.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | ana | pointer to an analytical function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
cs_xdef_t* cs_equation_add_source_term_by_array | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
cs_flag_t | loc, | ||
cs_real_t * | array, | ||
cs_lnum_t * | index | ||
) |
Define a new source term defined by an array.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | index | optional pointer to the array index |
cs_xdef_t* cs_equation_add_source_term_by_val | ( | cs_equation_param_t * | eqp, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define a new source term structure and initialize it by value.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
void cs_equation_add_time | ( | cs_equation_param_t * | eqp, |
cs_property_t * | property | ||
) |
Define and initialize a new structure to store parameters related to an unsteady term.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
cs_equation_param_t* cs_equation_create_param | ( | cs_equation_type_t | type, |
int | dim, | ||
cs_param_bc_type_t | default_bc | ||
) |
Create a cs_equation_param_t.
[in] | type | type of equation |
[in] | dim | dimension of the variable associated to this eq. |
[in] | default_bc | type of boundary condition set by default |
[in] | type | type of equation |
[in] | dim | dim of the variable associated to this equation |
[in] | default_bc | type of boundary condition set by default |
cs_equation_param_t* cs_equation_free_param | ( | cs_equation_param_t * | eqp | ) |
Free a cs_equation_param_t.
[in] | eqp | pointer to a cs_equation_param_t |
[in,out] | eqp | pointer to a cs_equation_param_t |
|
inlinestatic |
Ask if the parameters of the equation needs a convection term.
[in] | eqp | pointer to a cs_equation_param_t |
|
inlinestatic |
Ask if the parameters of the equation needs a diffusion term.
[in] | eqp | pointer to a cs_equation_param_t |
|
inlinestatic |
Ask if the parameters of the equation needs a reaction term.
[in] | eqp | pointer to a cs_equation_param_t |
|
inlinestatic |
Ask if the parameters of the equation needs a source term.
[in] | eqp | pointer to a cs_equation_param_t |
|
inlinestatic |
Ask if the parameters of the equation needs an unsteady term.
[in] | eqp | pointer to a cs_equation_param_t |
void cs_equation_param_set_sles | ( | const char * | eqname, |
cs_equation_param_t * | eqp, | ||
int | field_id | ||
) |
Set parameters for initializing SLES structures used for the resolution of the linear system. Settings are related to this equation.
[in] | eqname | pointer to an cs_equation_t structure |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | field_id | id of the cs_field_t struct. for this equation |
void cs_equation_set_param | ( | cs_equation_param_t * | eqp, |
cs_equation_key_t | key, | ||
const char * | keyval | ||
) |
Set a parameter attached to a keyname in a cs_equation_param_t structure.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | key | key related to the member of eq to set |
[in] | keyval | accessor to the value to set |
void cs_equation_summary_param | ( | const char * | eqname, |
const cs_equation_param_t * | eqp | ||
) |
Summary of a cs_equation_param_t structure.
[in] | eqname | name of the related equation |
[in] | eqp | pointer to a cs_equation_param_t structure |