#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_quantities.h"
#include "cs_gwf_param.h"
#include "cs_gwf_priv.h"
#include "cs_mesh.h"
#include "cs_property.h"
#include "cs_volume_zone.h"
Go to the source code of this file.
Data Structures | |
struct | cs_gwf_soil_param_genuchten_t |
Structure to handle the Van Genuchten-Mualen model of soil. More... | |
struct | cs_gwf_soil_t |
Main structure to handle a soil in the groundwater flow module. 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, cs_gwf_soil_t *soil) |
Generic function to update the properties related to a hydraulic model given the soil model. The soil parameters depend on the type of soil model. More... | |
typedef void() | cs_gwf_soil_free_param_t(void **p_param) |
Generic function to set free the parameter structure associated to a soil. More... | |
Functions | |
int | cs_gwf_get_n_soils (void) |
Get the number of allocated soils. More... | |
cs_gwf_soil_t * | cs_gwf_soil_by_id (int id) |
Retrieve a soil structure from its id. More... | |
cs_gwf_soil_t * | cs_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... | |
int | cs_gwf_soil_get_permeability_max_dim (void) |
Retrieve the max dim (aniso=9; iso=1) for the absolute permeability associated to each soil. More... | |
bool | cs_gwf_soil_all_are_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_t * | cs_gwf_soil_create (const cs_zone_t *zone, cs_gwf_model_type_t hydraulic_model, cs_gwf_soil_model_t model, cs_property_type_t perm_type, double k_abs[3][3], double porosity, double bulk_density, void *hydraulic_context) |
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_genuchten_param (cs_gwf_soil_t *soil, double theta_r, double alpha, double n, double L) |
Set a soil defined by a Van Genuchten-Mualen model. 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_param_t *free_param_func) |
Set a soil defined by a user-defined hydraulic model. More... | |
void | cs_gwf_soil_set_shared_properties (cs_property_t *abs_permeability, cs_property_t *soil_porosity) |
Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil. More... | |
void | cs_gwf_soil_saturated_set_property (cs_property_t *moisture_content) |
Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil. More... | |
void | cs_gwf_soil_tpf_set_property (cs_gwf_two_phase_t *mc) |
Set the definition of some property(ies) in specific situations for the two-phase flow models This relies on the definition of each soil. 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... | |
void | cs_gwf_soil_iso_update_mtpf_terms (cs_gwf_two_phase_t *mc) |
Update arrays associated to the definition of terms involved in the miscible two-phase flow model. Case of an isotropic absolute permeability. More... | |
void | cs_gwf_soil_iso_update_itpf_terms (cs_gwf_two_phase_t *mc) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability. More... | |
void | cs_gwf_soil_iso_update_itpf_terms_incr (const cs_time_step_t *ts, cs_gwf_two_phase_t *mc) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability and an incremental solve. More... | |
void | cs_gwf_soil_iso_update_itpf_terms_incr_submesh (const cs_time_step_t *ts, const cs_cdo_connect_t *connect, cs_gwf_two_phase_t *mc) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability with an incremental solve and a liquid saturation defined on a submesh. More... | |
typedef void() cs_gwf_soil_free_param_t(void **p_param) |
Generic function to set free the parameter structure associated to a soil.
[in,out] | p_param | double pointer to a structure cast on-the-fly |
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, cs_gwf_soil_t *soil) |
Generic function to update the properties related to a hydraulic model given the soil model. The soil parameters depend on the type of soil model.
[in] | t_eval | time at which one performs the evaluation |
[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 |
[in] | zone | pointer to a cs_zone_t |
[in,out] | soil | pointer to the soil structure to update |
void cs_gwf_build_cell2soil | ( | cs_lnum_t | n_cells | ) |
Build an array storing the associated soil for each cell.
[in] | n_cells | number of cells |
const short int* cs_gwf_get_cell2soil | ( | void | ) |
Get the array storing the associated soil for each cell.
int cs_gwf_get_n_soils | ( | void | ) |
Get the number of allocated soils.
bool cs_gwf_soil_all_are_saturated | ( | void | ) |
Check if all soils have been set as CS_GWF_SOIL_SATURATED.
cs_gwf_soil_t* cs_gwf_soil_by_id | ( | int | id | ) |
Retrieve a soil structure from its id.
[in] | id | id to look for |
cs_gwf_soil_t* cs_gwf_soil_by_name | ( | const char * | name | ) |
Retrieve a soil structure from its name.
[in] | name | name to look for |
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_t* cs_gwf_soil_create | ( | const cs_zone_t * | zone, |
cs_gwf_model_type_t | hydraulic_model, | ||
cs_gwf_soil_model_t | model, | ||
cs_property_type_t | perm_type, | ||
double | k_abs[3][3], | ||
double | porosity, | ||
double | bulk_density, | ||
void * | hydraulic_context | ||
) |
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.
[in] | zone | pointer to a volume zone structure |
[in] | hydraulic_model | main hydraulic model for the module |
[in] | model | type of model for the soil behavior |
[in] | perm_type | type of permeability (iso/anisotropic) |
[in] | k_abs | absolute (intrisic) permeability |
[in] | porosity | porosity or max. moisture content |
[in] | bulk_density | value of the mass density |
[in] | hydraulic_context | pointer to the context structure |
void cs_gwf_soil_free_all | ( | void | ) |
Free all cs_gwf_soil_t structures.
int cs_gwf_soil_get_permeability_max_dim | ( | void | ) |
Retrieve the max dim (aniso=9; iso=1) for the absolute permeability associated to each soil.
cs_real_t cs_gwf_soil_get_saturated_moisture | ( | int | soil_id | ) |
Get the saturated moisture for the given soil id.
[in] | soil_id | id of the requested soil |
void cs_gwf_soil_iso_update_itpf_terms | ( | cs_gwf_two_phase_t * | mc | ) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability.
[in,out] | mc | pointer to the model context to update |
void cs_gwf_soil_iso_update_itpf_terms_incr | ( | const cs_time_step_t * | ts, |
cs_gwf_two_phase_t * | mc | ||
) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability and an incremental solve.
[in] | ts | pointer to a cs_time_step_t structure |
[in,out] | mc | pointer to the model context to update |
void cs_gwf_soil_iso_update_itpf_terms_incr_submesh | ( | const cs_time_step_t * | ts, |
const cs_cdo_connect_t * | connect, | ||
cs_gwf_two_phase_t * | mc | ||
) |
Update arrays associated to the definition of terms involved in the immiscible two-phase flow model. Case of an isotropic absolute permeability with an incremental solve and a liquid saturation defined on a submesh.
[in] | ts | pointer to a cs_time_step_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in,out] | mc | pointer to the model context to update |
void cs_gwf_soil_iso_update_mtpf_terms | ( | cs_gwf_two_phase_t * | mc | ) |
Update arrays associated to the definition of terms involved in the miscible two-phase flow model. Case of an isotropic absolute permeability.
[in,out] | mc | pointer to the model context to update |
void cs_gwf_soil_log_setup | ( | void | ) |
Summary of the settings related to all cs_gwf_soil_t structures.
void cs_gwf_soil_saturated_set_property | ( | cs_property_t * | moisture_content | ) |
Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil.
[in,out] | moisture_content | pointer to a cs_property_t structure |
void cs_gwf_soil_set_genuchten_param | ( | cs_gwf_soil_t * | soil, |
double | theta_r, | ||
double | alpha, | ||
double | n, | ||
double | L | ||
) |
Set a soil defined by a Van Genuchten-Mualen model.
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
[in,out] | soil | pointer to a cs_gwf_soil_t structure |
[in] | theta_r | residual moisture |
[in] | alpha | scale parameter (in m^-1) |
[in] | n | shape parameter |
[in] | L | turtuosity parameter |
void cs_gwf_soil_set_shared_properties | ( | cs_property_t * | abs_permeability, |
cs_property_t * | soil_porosity | ||
) |
Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil.
[in,out] | abs_permeability | pointer to a cs_property_t structure |
[in,out] | soil_porosity | pointer to a cs_property_t structure |
void cs_gwf_soil_set_user | ( | cs_gwf_soil_t * | soil, |
void * | param, | ||
cs_gwf_soil_update_t * | update_func, | ||
cs_gwf_soil_free_param_t * | free_param_func | ||
) |
Set a soil defined by a user-defined hydraulic model.
[in,out] | soil | pointer to a cs_gwf_soil_t structure |
[in] | context | pointer to a structure cast on-the-fly |
[in] | update_func | function pointer to update propoerties |
[in] | free_param_func | function pointer to free the context |
Set a soil defined by a user-defined hydraulic model.
[in,out] | soil | pointer to a cs_gwf_soil_t structure |
[in] | param | pointer to a structure cast on-the-fly |
[in] | update_func | function pointer to update propoerties |
[in] | free_param_func | function pointer to free the param struct. |
void cs_gwf_soil_tpf_set_property | ( | cs_gwf_two_phase_t * | mc | ) |
Set the definition of some property(ies) in specific situations for the two-phase flow models This relies on the definition of each soil.
[in,out] | mc | pointer to the model context structure |
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.
[in] | time_eval | time at which one evaluates properties |
[in] | mesh | pointer to the mesh structure |
[in] | connect | pointer to the cdo connectivity |
[in] | quant | pointer to the cdo quantities |