![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_post.h"
#include "cs_mesh_location.h"
#include "cs_field.h"
#include "cs_cdo.h"
#include "cs_param.h"
#include "cs_cdo_toolbox.h"
#include "cs_hodge.h"
#include "cs_groundwater.h"
Enumerations | |
enum | gwkey_t { GWKEY_SATURATED_PERMEABILITY, GWKEY_MAX_MOISTURE, GWKEY_RESIDUAL_MOISTURE, GWKEY_TRACY_HS, GWKEY_TRACY_HR, GWKEY_POST_FREQ, GWKEY_OUTPUT_MOISTURE, GWKEY_ERROR } |
Functions | |
static const char * | _print_gwkey (gwkey_t key) |
Print the name of the corresponding advection key. More... | |
static gwkey_t | _get_gwkey (const char *keyname) |
Get the corresponding enum from the name of an advection key. If not found, return a key error. More... | |
static void | _set_tracer_param (int tracer_eq_id, cs_real_3_t dispersivity, double bulk_density, double distrib_coef, double reaction_rate, cs_gw_tracer_t *tp) |
Set a cs_gw_tracer_t structure. More... | |
static cs_gw_genuchten_t | _set_default_genuchten_param (void) |
Set the default parametrization of Van Genuchten-Mualen laws. More... | |
static void | _permeability_by_genuchten_law (double h, const void *gw_struct, cs_get_t *result) |
Define the permeability (or hydraulic conductivity) using the van Genuchten-Mualen law. More... | |
static cs_gw_tracy_t | _set_default_tracy_param (void) |
Set the default parametrization of Tracy model. More... | |
static void | _permeability_by_tracy_law (double h, const void *gw_struct, cs_get_t *result) |
Define the permeability (or hydraulic conductivity) using the van Tracy law. More... | |
static void | _moisture_by_tracy_law (double h, const void *gw_struct, cs_get_t *result) |
Define the moisture content using the Tracy law. More... | |
static void | _update_darcian_flux (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_equation_t *richards, cs_groundwater_t *gw) |
Update the darcian flux playing the role of advection field in groundwater flows. More... | |
static void | _update_moisture_content (const cs_cdo_quantities_t *cdoq, const cs_equation_t *richards, cs_groundwater_t *gw) |
Update the moisture content from the value of the hydraulic head. More... | |
cs_groundwater_t * | cs_groundwater_create (void) |
Create a structure dedicated to manage groundwater flows. More... | |
cs_groundwater_t * | cs_groundwater_finalize (cs_groundwater_t *gw) |
Free the main structure related to groundwater flows. More... | |
void | cs_groundwater_set_param (cs_groundwater_t *gw, const char *keyname, const char *keyval) |
Set parameters related to a cs_groundwater_t structure. More... | |
void | cs_groundwater_summary (const cs_groundwater_t *gw) |
Summary of a cs_groundwater_t structure. More... | |
cs_equation_t * | cs_groundwater_init (const cs_cdo_connect_t *connect, int richards_eq_id, const char *model, cs_property_t *permeability, cs_property_t *soil_capacity, cs_adv_field_t *adv_field, cs_groundwater_t *gw) |
Initialize the module dedicated to groundwater flows. More... | |
cs_equation_t * | cs_groundwater_add_tracer (cs_groundwater_t *gw, int tracer_eq_id, const char *eqname, const char *varname, cs_property_t *diff_property, cs_real_3_t dispersivity, double bulk_density, double distrib_coef, double reaction_rate) |
Add a new equation related to the groundwater flow module This equation is a specific unsteady advection/diffusion/reaction eq. 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_groundwater_automatic_settings (cs_equation_t **equations, cs_groundwater_t *gw) |
Predefined settings for the module dedicated to groundwater flows. More... | |
void | cs_groundwater_compute (const cs_mesh_t *mesh, const cs_time_step_t *time_step, double dt_cur, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, cs_equation_t *eqs[], cs_groundwater_t *gw) |
Compute the system related to groundwater flows. More... | |
void | cs_groundwater_post (const cs_time_step_t *time_step, const cs_groundwater_t *gw) |
Predefined postprocessing for the groundwater module. More... | |
Variables | |
static const char | _err_empty_gw [] |
enum gwkey_t |
|
static |
Get the corresponding enum from the name of an advection key. If not found, return a key error.
[in] | keyname | name of the key |
|
static |
Define the moisture content using the Tracy law.
[in] | h | value of the hydralic head |
[in] | gw_struct | pointer to the groundwater structure |
[in,out] | result | pointer to a cs_get_t structure |
|
static |
Define the permeability (or hydraulic conductivity) using the van Genuchten-Mualen law.
[in] | h | value of the hydralic head |
[in] | gw_struct | pointer to the groundwater structure |
[in,out] | result | pointer to a cs_get_t structure |
|
static |
Define the permeability (or hydraulic conductivity) using the van Tracy law.
[in] | h | value of the hydralic head |
[in] | gw_struct | pointer to the groundwater structure |
[in,out] | result | pointer to a cs_get_t structure |
|
static |
Print the name of the corresponding advection key.
[in] | key | name of the key |
|
static |
Set the default parametrization of Van Genuchten-Mualen laws.
|
static |
Set the default parametrization of Tracy model.
|
static |
Set a cs_gw_tracer_t structure.
[in] | tracer_eq_id | id related to the tracer equation |
[in] | dispersivity | dispersivity for each axis (x, y, z] |
[in] | bulk_density | value of the bulk density |
[in] | distrib_coef | value of the distribution coefficient |
[in] | reaction_rate | value of the first order rate of reaction |
[in,out] | tp | pointer to a cs_gw_tracer_t structure |
|
static |
Update the darcian flux playing the role of advection field in groundwater flows.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | richards | pointer to the Richards equation structure |
[in,out] | gw | pointer to a cs_groundwater_t structure |
|
static |
Update the moisture content from the value of the hydraulic head.
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in] | richards | pointer to the Richards equation structure |
[in,out] | gw | pointer to a cs_groundwater_t structure |
cs_equation_t* cs_groundwater_add_tracer | ( | cs_groundwater_t * | gw, |
int | tracer_eq_id, | ||
const char * | eqname, | ||
const char * | varname, | ||
cs_property_t * | diff_property, | ||
cs_real_3_t | dispersivity, | ||
double | bulk_density, | ||
double | distrib_coef, | ||
double | reaction_rate | ||
) |
Add a new equation related to the groundwater flow module This equation is a specific unsteady advection/diffusion/reaction eq. 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.
[in,out] | gw | pointer to a cs_groundwater_t structure |
[in] | tracer_eq_id | id related to the tracer equation |
[in] | eqname | name of the equation |
[in] | varname | name of the related variable |
[in] | diff_property | pointer to a cs_property_t struct. |
[in] | dispersivity | dispersivity for each axis (x, y, z] |
[in] | bulk_density | value of the bulk density |
[in] | distrib_coef | value of the distribution coefficient |
[in] | reaction_rate | value of the first order rate of reaction |
void cs_groundwater_automatic_settings | ( | cs_equation_t ** | equations, |
cs_groundwater_t * | gw | ||
) |
Predefined settings for the module dedicated to groundwater flows.
[in,out] | equations | pointer to the array of cs_equation_t struct. |
[in,out] | gw | pointer to a cs_groundwater_t structure |
void cs_groundwater_compute | ( | const cs_mesh_t * | mesh, |
const cs_time_step_t * | time_step, | ||
double | dt_cur, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | cdoq, | ||
cs_equation_t * | eqs[], | ||
cs_groundwater_t * | gw | ||
) |
Compute the system related to groundwater flows.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
[in] | dt_cur | current value of the time step |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | cdoq | pointer to a cs_cdo_quantities_t structure |
[in,out] | eqs | array of pointers to cs_equation_t structures |
[in,out] | gw | pointer to a cs_groundwater_t structure |
cs_groundwater_t* cs_groundwater_create | ( | void | ) |
Create a structure dedicated to manage groundwater flows.
cs_groundwater_t* cs_groundwater_finalize | ( | cs_groundwater_t * | gw | ) |
Free the main structure related to groundwater flows.
[in,out] | gw | pointer to a cs_groundwater_t struct. to free |
cs_equation_t* cs_groundwater_init | ( | const cs_cdo_connect_t * | connect, |
int | richards_eq_id, | ||
const char * | model, | ||
cs_property_t * | permeability, | ||
cs_property_t * | soil_capacity, | ||
cs_adv_field_t * | adv_field, | ||
cs_groundwater_t * | gw | ||
) |
Initialize the module dedicated to groundwater flows.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | richards_eq_id | id related to the Richards equation |
[in] | model | keyword related to the model used |
[in,out] | permeability | pointer to a property structure |
[in,out] | soil_capacity | pointer to a property structure |
[in,out] | adv_field | pointer to a cs_adv_field_t structure |
[in,out] | gw | pointer to a cs_groundwater_t structure |
void cs_groundwater_post | ( | const cs_time_step_t * | time_step, |
const cs_groundwater_t * | gw | ||
) |
Predefined postprocessing for the groundwater module.
[in] | time_step | pointer to a cs_time_step_t struct. |
[in] | gw | pointer to a cs_groundwater_t structure |
void cs_groundwater_set_param | ( | cs_groundwater_t * | gw, |
const char * | keyname, | ||
const char * | keyval | ||
) |
Set parameters related to a cs_groundwater_t structure.
[in,out] | gw | pointer to a cs_groundwater_t structure |
[in] | keyname | name of key related to the member of adv to set |
[in] | keyval | accessor to the value to set |
void cs_groundwater_summary | ( | const cs_groundwater_t * | gw | ) |
Summary of a cs_groundwater_t structure.
[in] | gw | pointer to a cs_groundwater_t struct. to summarize |
|
static |