7.1
general documentation
cs_gwf_soil.h File Reference
#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_quantities.h"
#include "cs_mesh.h"
#include "cs_property.h"
#include "cs_volume_zone.h"
+ Include dependency graph for cs_gwf_soil.h:

Go to the source code of this file.

Data Structures

struct  cs_gwf_soil_context_genuchten_t
 Structure to handle the Van Genuchten-Mualen model of soil. More...
 
struct  cs_gwf_soil_context_saturated_t
 Parameters defining a saturated soil in a given zone. More...
 
struct  cs_gwf_soil_t
 Main structure to handle a soil in the groundawater flow module. Store a set of parameters and pointers describing a soil. More...
 

Typedefs

typedef void() cs_gwf_soil_update_t(const cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_zone_t *zone, void *soil_context)
 Generic function to update the physical properties related to a hydraulic model. The soil context depends on the type of soil. More...
 
typedef void() cs_gwf_soil_free_context_t(void **p_context)
 Generic function to set free the soil context of a soil structure. More...
 

Enumerations

enum  cs_gwf_soil_hydraulic_model_t { CS_GWF_SOIL_GENUCHTEN, CS_GWF_SOIL_SATURATED, CS_GWF_SOIL_USER, CS_GWF_SOIL_N_HYDRAULIC_MODELS }
 Predefined hydraulic model of soils used in the groundwater flow module. More...
 

Functions

int cs_gwf_get_n_soils (void)
 Get the number of allocated soils. More...
 
cs_gwf_soil_tcs_gwf_soil_by_id (int id)
 Retrieve a soil structure from its id. More...
 
cs_gwf_soil_tcs_gwf_soil_by_name (const char *name)
 Retrieve a soil structure from its name. More...
 
cs_real_t cs_gwf_soil_get_saturated_moisture (int soil_id)
 Get the saturated moisture for the given soil id. More...
 
bool cs_gwf_soil_all_saturated (void)
 Check if all soils have been set as CS_GWF_SOIL_SATURATED. More...
 
void cs_gwf_soil_check (void)
 Check that at least one soil has been defined and the model of soil exists. Raise an error if a problem is encoutered. More...
 
cs_gwf_soil_tcs_gwf_soil_create (const cs_zone_t *zone, cs_gwf_soil_hydraulic_model_t model, cs_property_type_t perm_type, double saturated_moisture, double bulk_density)
 Create a new cs_gwf_soil_t structure and add it to the array of soils. An initialization by default of all members is performed. More...
 
void cs_gwf_build_cell2soil (cs_lnum_t n_cells)
 Build an array storing the associated soil for each cell. More...
 
const short int * cs_gwf_get_cell2soil (void)
 Get the array storing the associated soil for each cell. More...
 
void cs_gwf_soil_free_all (void)
 Free all cs_gwf_soil_t structures. More...
 
void cs_gwf_soil_log_setup (void)
 Summary of the settings related to all cs_gwf_soil_t structures. More...
 
void cs_gwf_soil_set_iso_saturated (cs_gwf_soil_t *soil, double k_s)
 Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability. More...
 
void cs_gwf_soil_set_aniso_saturated (cs_gwf_soil_t *soil, double k_s[3][3])
 Set a soil defined by a saturated hydraulic model and attached to an anisotropic permeability. More...
 
void cs_gwf_soil_set_iso_genuchten (cs_gwf_soil_t *soil, double k_s, double theta_r, double alpha, double n, double L)
 Set a soil defined by a Van Genuchten-Mualen hydraulic model and attached to an isotropic saturated permeability. More...
 
void cs_gwf_soil_set_aniso_genuchten (cs_gwf_soil_t *soil, double k_s[3][3], double theta_r, double alpha, double n, double L)
 Set a soil defined by a Van Genuchten-Mualen hydraulic model and attached to an anisotropic saturated permeability. More...
 
void cs_gwf_soil_set_user (cs_gwf_soil_t *soil, void *context, cs_gwf_soil_update_t *update_func, cs_gwf_soil_free_context_t *free_context_func)
 Set a soil defined by a user-defined hydraulic model. More...
 
void cs_gwf_soil_saturated_set_properties (cs_property_t *permeability, cs_property_t *moisture_content)
 Set the properties of the groundwater flow module in the case where all soils are considered as saturated. More...
 
void cs_gwf_soil_uspf_set_arrays (cs_real_t head[], cs_real_t permeability[], cs_real_t moisture_content[], cs_real_t capacity[])
 Set the different arrays used in soil context for a GWF model set to unsaturated single-phase flows in a porous media. More...
 
void cs_gwf_soil_update (cs_real_t time_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Update the soil properties. More...
 

Typedef Documentation

◆ cs_gwf_soil_free_context_t

typedef void() cs_gwf_soil_free_context_t(void **p_context)

Generic function to set free the soil context of a soil structure.

Parameters
[in,out]contextdouble pointer to a structure cast on-the-fly

◆ cs_gwf_soil_update_t

typedef void() cs_gwf_soil_update_t(const cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_zone_t *zone, void *soil_context)

Generic function to update the physical properties related to a hydraulic model. The soil context depends on the type of soil.

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
[in]zonepointer to a cs_zone_t
[in,out]soil_contextpointer to a structure cast on-the-fly

Enumeration Type Documentation

◆ cs_gwf_soil_hydraulic_model_t

Predefined hydraulic model of soils used in the groundwater flow module.

Enumerator
CS_GWF_SOIL_GENUCHTEN 

Van Genuchten-Mualem laws defining the evolution of the effective liquid saturne (also called dimensionless moisture content) and the relative permeability

The (effective) liquid saturation (also called moisture content) follows the identity: S_l,eff = (S_l - theta_r)/(theta_s - theta_r) = (1 + |alpha . h|^n)^(-m)

The isotropic relative permeability is defined as: k_r = S_l,eff^L * (1 - (1 - S_l,eff^(1/m))^m))^2 where m = 1 - 1/n

CS_GWF_SOIL_SATURATED 

Hydraulic model of soild where the soil is considered as saturated. In this model, there no evolution taken into account. The liquid saturation and the permeability are considered as constant.

CS_GWF_SOIL_USER 

User-defined model of soil

CS_GWF_SOIL_N_HYDRAULIC_MODELS 

Function Documentation

◆ cs_gwf_build_cell2soil()

void cs_gwf_build_cell2soil ( cs_lnum_t  n_cells)

Build an array storing the associated soil for each cell.

Parameters
[in]n_cellsnumber of cells

◆ cs_gwf_get_cell2soil()

const short int* cs_gwf_get_cell2soil ( void  )

Get the array storing the associated soil for each cell.

◆ cs_gwf_get_n_soils()

int cs_gwf_get_n_soils ( void  )

Get the number of allocated soils.

Returns
the number of allocated soils

◆ cs_gwf_soil_all_saturated()

bool cs_gwf_soil_all_saturated ( void  )

Check if all soils have been set as CS_GWF_SOIL_SATURATED.

Returns
true or false

◆ cs_gwf_soil_by_id()

cs_gwf_soil_t* cs_gwf_soil_by_id ( int  id)

Retrieve a soil structure from its id.

Parameters
[in]idid to look for
Returns
a pointer to a cs_gwf_soil_t structure

◆ cs_gwf_soil_by_name()

cs_gwf_soil_t* cs_gwf_soil_by_name ( const char *  name)

Retrieve a soil structure from its name.

Parameters
[in]namename to look for
Returns
a pointer to a cs_gwf_soil_t structure

◆ cs_gwf_soil_check()

void cs_gwf_soil_check ( void  )

Check that at least one soil has been defined and the model of soil exists. Raise an error if a problem is encoutered.

◆ cs_gwf_soil_create()

cs_gwf_soil_t* cs_gwf_soil_create ( const cs_zone_t zone,
cs_gwf_soil_hydraulic_model_t  model,
cs_property_type_t  perm_type,
double  sat_moisture,
double  bulk_density 
)

Create a new cs_gwf_soil_t structure and add it to the array of soils. An initialization by default of all members is performed.

Parameters
[in]zonepointer to a volume zone structure
[in]modeltype of modelling for the hydraulic behavior
[in]perm_typetype of permeability (iso/anisotropic)
[in]saturated_moisturemoisture content
[in]bulk_densityvalue of the mass density
Returns
a pointer to the new allocated structure
Parameters
[in]zonepointer to a volume zone structure
[in]modeltype of modelling for the hydraulic behavior
[in]perm_typetype of permeability (iso/anisotropic)
[in]sat_moisturevalue of the saturated moisture content
[in]bulk_densityvalue of the mass density
Returns
a pointer to the new allocated structure

◆ cs_gwf_soil_free_all()

void cs_gwf_soil_free_all ( void  )

Free all cs_gwf_soil_t structures.

◆ cs_gwf_soil_get_saturated_moisture()

cs_real_t cs_gwf_soil_get_saturated_moisture ( int  soil_id)

Get the saturated moisture for the given soil id.

Parameters
[in]soil_idid of the requested soil
Returns
the value of the saturated moisture

◆ cs_gwf_soil_log_setup()

void cs_gwf_soil_log_setup ( void  )

Summary of the settings related to all cs_gwf_soil_t structures.

◆ cs_gwf_soil_saturated_set_properties()

void cs_gwf_soil_saturated_set_properties ( cs_property_t permeability,
cs_property_t moisture_content 
)

Set the properties of the groundwater flow module in the case where all soils are considered as saturated.

Parameters
[in,out]permeabilitypointer to a cs_property_t structure
[in,out]moisture_contentpointer to a cs_property_t structure

◆ cs_gwf_soil_set_aniso_genuchten()

void cs_gwf_soil_set_aniso_genuchten ( cs_gwf_soil_t soil,
double  k_s[3][3],
double  theta_r,
double  alpha,
double  n,
double  L 
)

Set a soil defined by a Van Genuchten-Mualen hydraulic model and attached to an anisotropic saturated permeability.

The (effective) liquid saturation (also called moisture content) follows the identity S_l,eff = (S_l - theta_r)/(theta_s - theta_r) = (1 + |alpha . h|^n)^(-m)

The isotropic relative permeability is defined as: k_r = S_l,eff^L * (1 - (1 - S_l,eff^(1/m))^m))^2 where m = 1 - 1/n

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the isotropic saturated permeability
[in]theta_rresidual moisture/liquid saturation
[in]alphascale parameter (in m^-1)
[in]nshape parameter
[in]Lturtuosity parameter

◆ cs_gwf_soil_set_aniso_saturated()

void cs_gwf_soil_set_aniso_saturated ( cs_gwf_soil_t soil,
double  k_s[3][3] 
)

Set a soil defined by a saturated hydraulic model and attached to an anisotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the anisotropic saturated permeability

◆ cs_gwf_soil_set_iso_genuchten()

void cs_gwf_soil_set_iso_genuchten ( cs_gwf_soil_t soil,
double  k_s,
double  theta_r,
double  alpha,
double  n,
double  L 
)

Set a soil defined by a Van Genuchten-Mualen hydraulic model and attached to an isotropic saturated permeability.

The (effective) liquid saturation (also called moisture content) follows the identity S_l,eff = (S_l - theta_r)/(theta_s - theta_r) = (1 + |alpha . h|^n)^(-m)

The isotropic relative permeability is defined as: k_r = S_l,eff^L * (1 - (1 - S_l,eff^(1/m))^m))^2 where m = 1 - 1/n

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the isotropic saturated permeability
[in]theta_rresidual moisture
[in]alphascale parameter (in m^-1)
[in]nshape parameter
[in]Lturtuosity parameter

◆ cs_gwf_soil_set_iso_saturated()

void cs_gwf_soil_set_iso_saturated ( cs_gwf_soil_t soil,
double  k_s 
)

Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the saturated permeability

◆ cs_gwf_soil_set_user()

void cs_gwf_soil_set_user ( cs_gwf_soil_t soil,
void *  context,
cs_gwf_soil_update_t update_func,
cs_gwf_soil_free_context_t free_context_func 
)

Set a soil defined by a user-defined hydraulic model.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]contextpointer to a structure cast on-the-fly
[in]update_funcfunction pointer to update propoerties
[in]free_context_funcfunction pointer to free the context

◆ cs_gwf_soil_update()

void cs_gwf_soil_update ( cs_real_t  time_eval,
const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)

Update the soil properties.

Parameters
[in]time_evaltime at which one evaluates properties
[in]meshpointer to the mesh structure
[in]connectpointer to the cdo connectivity
[in]quantpointer to the cdo quantities

◆ cs_gwf_soil_uspf_set_arrays()

void cs_gwf_soil_uspf_set_arrays ( cs_real_t  head[],
cs_real_t  permeability[],
cs_real_t  moisture_content[],
cs_real_t  capacity[] 
)

Set the different arrays used in soil context for a GWF model set to unsaturated single-phase flows in a porous media.

Parameters
[in]headpointer to the current head values in cells
[in]permeabilitypointer to the current permeability values
[in]moisture_contentpointer to the current moisture content values
[in]capacitypointer to the current soil capacity values