The groundwater flow module (GWF) relies on CDO vertex-based or CDO vertex+cell-based schemes.
To set-up a GWF computation, one has to update the cs_user_parameters.c file and edit the function cs_user_model at least in simple cases. In more complex cases, editing cs_user_finalize_setup should be necessary.
The first step is to activate the CDO module in the function cs_user_model (please refer to Activation of CDO/HHO schemes).
Then, one has to activate the groundwater flow module (GWF) in the function cs_user_model. The function to call is cs_gwf_activate.
There are three parameters:
Here are listed the available option flags:
There are currently two models :
First example: Activate the GWF model with an isotropic permeability and a fully saturated single-phase flow model.
Second example: Activate the GWF model with an anisotropic permeability and an unsaturated single-phase flow model. Moreover, one takes into account the gravity effect.
The second step is to add at least one new soil. The add of soil(s) should be done before adding tracers. The function which adds a soil is cs_gwf_add_soil to be located inside the function cs_user_model. The last parameter of this function is the bulk density. This parameter is only useful if there is at least one tracer defined.
There are two predefined soil models
and one user-defined soil model
Remark: If a CS_GWF_MODEL_SATURATED_SINGLE_PHASE is set at the activation step, then one expects that all soil models are defined by the type CS_GWF_SOIL_SATURATED
If the soil is saturated then this is a simple definition which can be located inside the function cs_user_model.
Example for two saturated soils defined by an anisotropic (saturated) permeability
Use cs_gwf_set_iso_saturated_soil to set a saturated soil defined by an isotropic permeability instead of an anisotropic permeability. In this case, the second parameter is simply a ``double''.
Soils which behave according to a Van Genuchten-Mualen model can be specified using cs_gwf_soil_set_aniso_genuchten or cs_gwf_soil_set_iso_genuchten according to the type of permeability which has been defined.
Example of a soil relying on a Van Genuchten-Mualen and considering a isotropic permeability
If the predefined models are not sufficient, it is possible to add a user-defined soil. In this case, the add of the new soil is made as follows
Here is a complete example of a soil model devised by Tracy (called a soil context)
Example of the structure used to handle the soil model
Example of the first step
with the two requested functions (defined for instance as a static function in the file cs_user_parameters.c). These functions have to fullfill the prototype defined in cs_gwf_soil_update_t (for the update of the soil properties) and in cs_gwf_soil_free_context_t (for the free of the soil context).
First, an example of how to update soil properties (tracy_update)
and an example of how to free the soil context (tracy_free_context)
Example of the second step
The third step (which is not mandatory) is to add tracer(s) thanks to the function cs_gwf_add_tracer This tracer will be advected by the Darcy flux arising from the Richards equation.
There are currently two models :
The first parameter in cs_gwf_add_tracer is a flag which can be built with
Here is a simple example for a standard tracer which can be added in the function cs_user_model
Remark: Get a tracer structure.
TODO
It is possible to activate an automatic post-processing of several postprocessings of fields or properties. Here are available flags to activate through the usage of cs_gwf_set_post_options
Get a soil structure from its name.
There is a similar which retrieve the soil structure from its id (see cs_gwf_soil_by_id).
Get a tracer structure from its name.