7.2
general documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_gwf_tracer.h File Reference
#include "cs_advection_field.h"
#include "cs_base.h"
#include "cs_equation.h"
#include "cs_gwf_param.h"
+ Include dependency graph for cs_gwf_tracer.h:

Go to the source code of this file.

Data Structures

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, cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Generic function to update the phisical properties related to a tracer modelling. 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...
 

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, 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 by default. Add a new equation related to the groundwater flow module. This equation is a specific transport equation. Tracer is advected thanks to the darcian velocity which is given by the resolution of the Richards equation. Diffusion/reaction parameters result from a physical modelling. More...
 
void cs_gwf_tracer_free_all (void)
 Free all tracers. 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_main_param (cs_gwf_tracer_t *tracer, const char *soil_name, double wmd, double alpha_l, double alpha_t, double distrib_coef, double reaction_rate)
 For a specified soil set the main parameters corresponding to a default modelling of a tracer transport. More...
 
void cs_gwf_tracer_set_precip_param (cs_gwf_tracer_t *tracer, const char *soil_name, double conc_w_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_tensor (cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Update the diffusion tensor related to each tracer equation. 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...
 
cs_real_t 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 over a given set of cells of the field related to a tracer equation. This integral turns out to be exact for linear functions. More...
 

Typedef Documentation

◆ cs_gwf_tracer_finalize_setup_t

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.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]advpointer to an advection field structure
[in,out]tracerpointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_free_context_t

typedef void() cs_gwf_tracer_free_context_t(cs_gwf_tracer_t *tracer)

Generic function to free the input of a tracer model.

Parameters
[in,out]tracerpointer to a structure cs_gwf_tracer_t

◆ cs_gwf_tracer_init_setup_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.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_update_t

typedef void() cs_gwf_tracer_update_t(cs_gwf_tracer_t *tracer, cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)

Generic function to update the phisical properties related to a tracer modelling.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_structure
[in]t_evaltime at which one performs the evaluation
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

Function Documentation

◆ cs_gwf_tracer_add()

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,
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 by default. Add a new equation related to the groundwater flow module. This equation is a specific transport equation. Tracer is advected thanks to the darcian velocity which is given by the resolution of the Richards equation. Diffusion/reaction parameters result from a physical modelling.

Parameters
[in]tr_modelmodel related to this tracer
[in]gwf_modelmain model for the GWF module
[in]eq_namename of the tracer equation
[in]var_namename of the related variable
[in]adv_fieldpointer to a cs_adv_field_t structure
[in]init_setupfunction pointer (predefined prototype)
[in]finalize_setupfunction pointer (predefined prototype)
Returns
a pointer to the new allocated structure

◆ cs_gwf_tracer_by_name()

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.

Parameters
[in]eq_namename of the tracer equation
Returns
the pointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_compute_all()

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.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_tracer_compute_steady_all()

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.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_tracer_default_init_setup()

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.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_finalize_setup()

void cs_gwf_tracer_finalize_setup ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)

Finalize the tracer setup.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_tracer_free_all()

void cs_gwf_tracer_free_all ( void  )

Free all tracers.

Returns
a NULL pointer

◆ cs_gwf_tracer_get_time_theta_max()

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.

Returns
the computed value

◆ cs_gwf_tracer_init_setup()

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.

◆ cs_gwf_tracer_integrate()

cs_real_t 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 over a given set of cells of the field related to a tracer equation. This integral turns out to be exact for linear functions.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure
[in]tracerpointer to a cs_gwf_tracer_t structure
[in]z_namename of the volumic zone where the integral is done (if NULL or "" all cells are considered)
Returns
the value of the integral

◆ cs_gwf_tracer_log_all()

void cs_gwf_tracer_log_all ( void  )

Display the main features related to each tracer.

◆ cs_gwf_tracer_sat_finalize_setup()

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.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]advpointer to an advection field structure
[in,out]tracerpointer to a cs_gwf_tracer_t structure

Set the parameters related to a standard tracer equation case of a fully saturated flow model.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]advpointer to an advection field structure
[in,out]tracerpointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_set_main_param()

void cs_gwf_tracer_set_main_param ( cs_gwf_tracer_t *  tracer,
const char *  soil_name,
double  wmd,
double  alpha_l,
double  alpha_t,
double  distrib_coef,
double  reaction_rate 
)

For a specified soil set the main parameters corresponding to a default modelling of a tracer transport.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_t structure
[in]soil_namename of the related soil (or NULL if all soils are selected)
[in]wmdvalue of the water molecular diffusivity
[in]alpha_lvalue of the longitudinal dispersivity
[in]alpha_tvalue of the transversal dispersivity
[in]distrib_coefvalue of the distribution coefficient
[in]reaction_ratevalue of the first order rate of reaction

For a specified soil set the main parameters corresponding to a default modelling of a tracer transport.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_t structure
[in]soil_namename of the related soil (or NULL if all soils are selected)
[in]wmdvalue of the water molecular diffusivity
[in]alpha_lvalue of the longitudinal dispersivity
[in]alpha_tvalue of the transversal dispersivity
[in]distrib_coefvalue of the distribution coefficient
[in]reaction_ratevalue of the first order rate of reaction

◆ cs_gwf_tracer_set_precip_param()

void cs_gwf_tracer_set_precip_param ( cs_gwf_tracer_t *  tracer,
const char *  soil_name,
double  conc_w_star 
)

For a specified soil set the parameters corresponding to a precipitation modelling of a tracer transport.

Parameters
[in,out]tracerpointer to a cs_gwf_tracer_t structure
[in]soil_namename of the related soil (or NULL if all soils are selected)
[in]conc_w_starvalue of the saturated concentration in the liquid phase

◆ cs_gwf_tracer_unsat_finalize_setup()

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.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]advpointer to an advection field structure
[in,out]tracerpointer to a cs_gwf_tracer_t structure

◆ cs_gwf_tracer_update_diff_tensor()

void cs_gwf_tracer_update_diff_tensor ( cs_real_t  t_eval,
const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)

Update the diffusion tensor related to each tracer equation.

Parameters
[in]t_evaltime at which one performs the evaluation
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure