#include "cs_advection_field.h"
#include "cs_base.h"
#include "cs_equation.h"
#include "cs_gwf_param.h"
Go to the source code of this file.
Data Structures | |
struct | cs_gwf_tracer_decay_chain_t |
struct | cs_gwf_tracer_default_context_t |
struct | cs_gwf_tracer_t |
Typedefs | |
typedef void() | cs_gwf_tracer_init_setup_t(cs_gwf_tracer_t *tracer) |
Generic function to update the first setup stage (the one done before building mesh and its related quantities) for a tracer equation. More... | |
typedef void() | cs_gwf_tracer_finalize_setup_t(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_adv_field_t *adv, cs_gwf_tracer_t *tracer) |
Generic function to finalize the setup of parameters related to a tracer equation. At this stage, mesh and its related quantities have been built. More... | |
typedef void() | cs_gwf_tracer_update_t(cs_gwf_tracer_t *tracer, void *context, const cs_time_step_t *ts, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Generic function to update the properties related to a tracer. This function depends on a numerical scheme and a physical model. More... | |
typedef void() | cs_gwf_tracer_free_context_t(cs_gwf_tracer_t *tracer) |
Generic function to free the input of a tracer model. More... | |
typedef void() | cs_gwf_tracer_integrate_t(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_equation_t *eq, const cs_zone_t *zone, void *context, double results[]) |
Compute the quantity of tracer using an integral of the tracer concentration over a given set of cells (the cells of the volume zone). Several terms can be computed. The quantity is given in moles. A parallel operation (a sum reduction) is performed inside this function. More... | |
Functions | |
cs_gwf_tracer_t * | cs_gwf_tracer_by_name (const char *eq_name) |
Retrieve the pointer to the cs_gwf_tracer_t structure associated to the name given as parameter. More... | |
cs_gwf_tracer_t * | cs_gwf_tracer_add (cs_gwf_tracer_model_t tr_model, cs_gwf_model_type_t gwf_model, const char *eq_name, const char *var_name, cs_adv_field_t *adv_field, double lambda, int chain_position, int chain_id, cs_gwf_tracer_init_setup_t *init_setup, cs_gwf_tracer_finalize_setup_t *finalize_setup) |
Create a new cs_gwf_tracer_t structure and initialize its members. This creation of a new tracer is fully done in the case of a default tracer. Additional settings has to be done in the case of a user-defined tracer. More... | |
void | cs_gwf_tracer_free_all (void) |
Free all tracer structures and all decay chains. More... | |
cs_real_t | cs_gwf_tracer_get_time_theta_max (void) |
Retrieve the max. value of the theta parameter associated to a time scheme. Loop on all tracer equations. More... | |
void | cs_gwf_tracer_set_soil_param (cs_gwf_tracer_t *tracer, const char *soil_name, double wmd, double alpha_l, double alpha_t, double distrib_coef) |
Set the main parameters corresponding to a default modelling of a tracer transport equation for a specified soil. More... | |
void | cs_gwf_tracer_set_precip_param (cs_gwf_tracer_t *tracer, const char *soil_name, double conc_l_star) |
For a specified soil set the parameters corresponding to a precipitation modelling of a tracer transport. More... | |
void | cs_gwf_tracer_init_setup (void) |
Initial setup step for tracer equations. Soils and equation parameters are defined at this stage. Create new cs_field_t structures according to the setting. More... | |
void | cs_gwf_tracer_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Finalize the tracer setup. More... | |
void | cs_gwf_tracer_update_diff_pty (const cs_time_step_t *ts, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Update the diffusion property related to each tracer equation The update strategy depends on the soil/tracer features and also on the hydraulic model. More... | |
void | cs_gwf_tracer_log_all (void) |
Display the main features related to each tracer. More... | |
void | cs_gwf_tracer_compute_steady_all (const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq) |
Compute the steady-state for all tracer equations. Nothing is done if all equations are unsteady. More... | |
void | cs_gwf_tracer_compute_all (const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq) |
Compute the new (unsteady) state for all tracer equations. Nothing is done if all equations are steady. More... | |
void | cs_gwf_tracer_default_init_setup (cs_gwf_tracer_t *tracer) |
Add terms to the algebraic system related to a tracer equation according to the settings. Case of the default tracer modelling Rely on the generic function: cs_gwf_tracer_add_terms_t. More... | |
void | cs_gwf_tracer_sat_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_adv_field_t *adv, cs_gwf_tracer_t *tracer) |
Set the parameters related to a standard tracer equation case of a fully saturated flow model. More... | |
void | cs_gwf_tracer_unsat_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_adv_field_t *adv, cs_gwf_tracer_t *tracer) |
Set the parameters related to a standard tracer equation in case of an unsaturated flow model. More... | |
double | cs_gwf_tracer_integrate (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_gwf_tracer_t *tracer, const char *z_name) |
Compute the integral of the tracer concentration over a given set of cells. This integral gives the number of moles of tracer inside the related volume. Moreover, it turns out to be exact for linear functions. A parallel operation (a sum reduction) is performed. More... | |
void | cs_gwf_tracer_integrate_by_terms (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_gwf_tracer_t *tracer, const char *z_name, double results[]) |
Compute the quantity of tracer using the integral of the tracer concentration over a given set of cells. Two terms are computed: one for the quantity of moles inside the liquid phase and another one for the quantity of tracer inside the precipitation state (in moles). A parallel operation (a sum reduction) is performed inside this function. More... | |
cs_gwf_tracer_decay_chain_t * | cs_gwf_tracer_create_decay_chain (int n_tracers, const char *chain_name, cs_gwf_tracer_unit_t unit) |
Create a decay chain structure to manage several linked tracers. More... | |
cs_gwf_tracer_decay_chain_t * | cs_gwf_tracer_decay_chain_by_id (int id) |
Retrieve the decay chain structure associated to the given id If not found, it returns the NULL pointer. More... | |
cs_gwf_tracer_decay_chain_t * | cs_gwf_tracer_decay_chain_by_name (const char *chain_name) |
Retrieve the decay chain structure associated to the name given as parameter. If not found, it returns the NULL pointer. More... | |
cs_gwf_tracer_t * | cs_gwf_tracer_decay_chain_get_tracer (cs_gwf_tracer_decay_chain_t *tdc, int id) |
Retrieve the tracer structure for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned. More... | |
cs_equation_t * | cs_gwf_tracer_decay_chain_get_equation (cs_gwf_tracer_decay_chain_t *tdc, int id) |
Retrieve the equation structure for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned. More... | |
cs_equation_param_t * | cs_gwf_tracer_decay_chain_get_equation_param (cs_gwf_tracer_decay_chain_t *tdc, int id) |
Retrieve the equation parameters for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned. More... | |
typedef void() cs_gwf_tracer_finalize_setup_t(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_adv_field_t *adv, cs_gwf_tracer_t *tracer) |
Generic function to finalize the setup of parameters related to a tracer equation. At this stage, mesh and its related quantities have been built.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | adv | pointer to an advection field structure |
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
typedef void() cs_gwf_tracer_free_context_t(cs_gwf_tracer_t *tracer) |
Generic function to free the input of a tracer model.
[in,out] | tracer | pointer to a structure cs_gwf_tracer_t |
typedef void() cs_gwf_tracer_init_setup_t(cs_gwf_tracer_t *tracer) |
Generic function to update the first setup stage (the one done before building mesh and its related quantities) for a tracer equation.
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
typedef void() cs_gwf_tracer_integrate_t(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_equation_t *eq, const cs_zone_t *zone, void *context, double results[]) |
Compute the quantity of tracer using an integral of the tracer concentration over a given set of cells (the cells of the volume zone). Several terms can be computed. The quantity is given in moles. A parallel operation (a sum reduction) is performed inside this function.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | eq | equation related to a tracer |
[in] | zone | pointer to a volume zone structure |
[in] | context | pointer to a context structure for a tracer |
[in,out] | results | resulting array of values |
typedef void() cs_gwf_tracer_update_t(cs_gwf_tracer_t *tracer, void *context, const cs_time_step_t *ts, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Generic function to update the properties related to a tracer. This function depends on a numerical scheme and a physical model.
[in,out] | tracer | pointer to a cs_gwf_tracer_structure |
[in,out] | context | NULL or pointer to a structure cast on-the-fly |
[in] | ts | pointer to a cs_time_step_t structure |
[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 |
cs_gwf_tracer_t* cs_gwf_tracer_add | ( | cs_gwf_tracer_model_t | tr_model, |
cs_gwf_model_type_t | gwf_model, | ||
const char * | eq_name, | ||
const char * | var_name, | ||
cs_adv_field_t * | adv_field, | ||
double | lambda, | ||
int | chain_position, | ||
int | chain_id, | ||
cs_gwf_tracer_init_setup_t * | init_setup, | ||
cs_gwf_tracer_finalize_setup_t * | finalize_setup | ||
) |
Create a new cs_gwf_tracer_t structure and initialize its members. This creation of a new tracer is fully done in the case of a default tracer. Additional settings has to be done in the case of a user-defined tracer.
Add a new equation related to the groundwater flow module. This equation is a specific transport equation. The tracer is advected thanks to the darcian velocity (in the liquid phase) which is given by the resolution of the Richards equation. Diffusion and reaction coefficients result from a physical modelling.
[in] | tr_model | model related to this tracer |
[in] | gwf_model | main model for the GWF module |
[in] | eq_name | name of the tracer equation |
[in] | var_name | name of the related variable |
[in] | adv_field | pointer to a cs_adv_field_t structure |
[in] | lambda | value of the first order decay coefficient |
[in] | chain_position | -1 if not used or the id in the chain position |
[in] | chain_id | -1 or id of the associated decay chain |
[in] | init_setup | function pointer (predefined prototype) |
[in] | finalize_setup | function pointer (predefined prototype) |
cs_gwf_tracer_t* cs_gwf_tracer_by_name | ( | const char * | eq_name | ) |
Retrieve the pointer to the cs_gwf_tracer_t structure associated to the name given as parameter.
[in] | eq_name | name of the tracer equation |
void cs_gwf_tracer_compute_all | ( | const cs_mesh_t * | mesh, |
const cs_time_step_t * | time_step, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | cdoq | ||
) |
Compute the new (unsteady) state for all tracer equations. Nothing is done if all equations are steady.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
void cs_gwf_tracer_compute_steady_all | ( | const cs_mesh_t * | mesh, |
const cs_time_step_t * | time_step, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | cdoq | ||
) |
Compute the steady-state for all tracer equations. Nothing is done if all equations are unsteady.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
cs_gwf_tracer_decay_chain_t* cs_gwf_tracer_create_decay_chain | ( | int | n_tracers, |
const char * | chain_name, | ||
cs_gwf_tracer_unit_t | unit | ||
) |
Create a decay chain structure to manage several linked tracers.
[in] | n_tracers | number of tracers equations |
[in] | chain_name | name of the decay chain |
[in] | unit | type of unit used in the tracer equations |
cs_gwf_tracer_decay_chain_t* cs_gwf_tracer_decay_chain_by_id | ( | int | id | ) |
Retrieve the decay chain structure associated to the given id If not found, it returns the NULL pointer.
[in] | id | id of the decay chain to retrieve |
cs_gwf_tracer_decay_chain_t* cs_gwf_tracer_decay_chain_by_name | ( | const char * | chain_name | ) |
Retrieve the decay chain structure associated to the name given as parameter. If not found, it returns the NULL pointer.
[in] | chain_name | name of the decay chain |
cs_equation_t* cs_gwf_tracer_decay_chain_get_equation | ( | cs_gwf_tracer_decay_chain_t * | tdc, |
int | id | ||
) |
Retrieve the equation structure for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned.
[in] | tdc | pointer to a decay chain structure |
[in] | id | position of the tracer in the decay chain |
cs_equation_param_t* cs_gwf_tracer_decay_chain_get_equation_param | ( | cs_gwf_tracer_decay_chain_t * | tdc, |
int | id | ||
) |
Retrieve the equation parameters for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned.
[in] | tdc | pointer to a decay chain structure |
[in] | id | position of the tracer in the decay chain |
cs_gwf_tracer_t* cs_gwf_tracer_decay_chain_get_tracer | ( | cs_gwf_tracer_decay_chain_t * | tdc, |
int | id | ||
) |
Retrieve the tracer structure for the tracer at the position "id" in the decay chain structure. If "id" is not valid, then a NULL pointer is returned.
[in] | tdc | pointer to a decay chain structure |
[in] | id | position of the tracer in the decay chain |
void cs_gwf_tracer_default_init_setup | ( | cs_gwf_tracer_t * | tracer | ) |
Add terms to the algebraic system related to a tracer equation according to the settings. Case of the default tracer modelling Rely on the generic function: cs_gwf_tracer_add_terms_t.
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
void cs_gwf_tracer_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant | ||
) |
Finalize the tracer setup.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
void cs_gwf_tracer_free_all | ( | void | ) |
Free all tracer structures and all decay chains.
cs_real_t cs_gwf_tracer_get_time_theta_max | ( | void | ) |
Retrieve the max. value of the theta parameter associated to a time scheme. Loop on all tracer equations.
void cs_gwf_tracer_init_setup | ( | void | ) |
Initial setup step for tracer equations. Soils and equation parameters are defined at this stage. Create new cs_field_t structures according to the setting.
double cs_gwf_tracer_integrate | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | cdoq, | ||
const cs_gwf_tracer_t * | tracer, | ||
const char * | z_name | ||
) |
Compute the integral of the tracer concentration over a given set of cells. This integral gives the number of moles of tracer inside the related volume. Moreover, it turns out to be exact for linear functions. A parallel operation (a sum reduction) is performed.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | tracer | pointer to a cs_gwf_tracer_t structure |
[in] | z_name | name of the volumic zone where the integral is done (if NULL or "" all cells are considered) |
Compute the integral of the tracer concentration over a given set of cells. This integral gives the number of moles of tracer inside the related volume. Moreover, it turns out to be exact for linear functions. A parallel operation (a sum reduction) is performed.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | tracer | pointer to a cs_gwf_tracer_t structure |
[in] | z_name | name of the volumic zone where the integral is done (if NULL or "" all cells are considered) |
void cs_gwf_tracer_integrate_by_terms | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | cdoq, | ||
const cs_gwf_tracer_t * | tracer, | ||
const char * | z_name, | ||
double | results[] | ||
) |
Compute the quantity of tracer using the integral of the tracer concentration over a given set of cells. Two terms are computed: one for the quantity of moles inside the liquid phase and another one for the quantity of tracer inside the precipitation state (in moles). A parallel operation (a sum reduction) is performed inside this function.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | tracer | pointer to a cs_gwf_tracer_t structure |
[in] | z_name | name of the volume zone where the integral is done (if NULL or "" all cells are considered) |
[in,out] | results | array of values. [0]= the quantity of moles in the liquid phase, [1]= the quantity of moles inside the precipitation state |
void cs_gwf_tracer_log_all | ( | void | ) |
Display the main features related to each tracer.
void cs_gwf_tracer_sat_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_adv_field_t * | adv, | ||
cs_gwf_tracer_t * | tracer | ||
) |
Set the parameters related to a standard tracer equation case of a fully saturated flow model.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | adv | pointer to an advection field structure |
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
Set the parameters related to a standard tracer equation case of a fully saturated flow model.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | adv | pointer to an advection field structure |
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
void cs_gwf_tracer_set_precip_param | ( | cs_gwf_tracer_t * | tracer, |
const char * | soil_name, | ||
double | conc_l_star | ||
) |
For a specified soil set the parameters corresponding to a precipitation modelling of a tracer transport.
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
[in] | soil_name | name of the related soil (or NULL if all soils are selected) |
[in] | conc_l_star | value of the saturated concentration in the liquid phase |
void cs_gwf_tracer_set_soil_param | ( | cs_gwf_tracer_t * | tracer, |
const char * | soil_name, | ||
double | wmd, | ||
double | alpha_l, | ||
double | alpha_t, | ||
double | distrib_coef | ||
) |
Set the main parameters corresponding to a default modelling of a tracer transport equation for a specified soil.
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
[in] | soil_name | name of the related soil (or NULL if all soils are selected) |
[in] | wmd | value of the water molecular diffusivity |
[in] | alpha_l | value of the longitudinal dispersivity |
[in] | alpha_t | value of the transversal dispersivity |
[in] | distrib_coef | value of the distribution coefficient |
void cs_gwf_tracer_unsat_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_adv_field_t * | adv, | ||
cs_gwf_tracer_t * | tracer | ||
) |
Set the parameters related to a standard tracer equation in case of an unsaturated flow model.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | adv | pointer to an advection field structure |
[in,out] | tracer | pointer to a cs_gwf_tracer_t structure |
void cs_gwf_tracer_update_diff_pty | ( | const cs_time_step_t * | ts, |
const cs_mesh_t * | mesh, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant | ||
) |
Update the diffusion property related to each tracer equation The update strategy depends on the soil/tracer features and also on the hydraulic model.
[in] | ts | pointer to a cs_time_step_t structure |
[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 |