8.0
general documentation
Loading...
Searching...
No Matches
cs_gwf_soil.h
Go to the documentation of this file.
1#ifndef __CS_GWF_SOIL_H__
2#define __CS_GWF_SOIL_H__
3
4/*============================================================================
5 * Set of main functions to handle soils in the groundwater flow module
6 * when using CDO schemes
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2023 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------*/
30
31/*----------------------------------------------------------------------------
32 * Local headers
33 *----------------------------------------------------------------------------*/
34
35#include "cs_base.h"
36#include "cs_cdo_connect.h"
37#include "cs_cdo_quantities.h"
38#include "cs_gwf_param.h"
39#include "cs_gwf_priv.h"
40#include "cs_mesh.h"
41#include "cs_property.h"
42#include "cs_volume_zone.h"
43
44/*----------------------------------------------------------------------------*/
45
47
48/*============================================================================
49 * Macro definitions
50 *============================================================================*/
51
52/*============================================================================
53 * Public function pointer prototypes
54 *============================================================================*/
55
56typedef struct _gwf_soil_t cs_gwf_soil_t;
57
58/*----------------------------------------------------------------------------*/
71/*----------------------------------------------------------------------------*/
72
73typedef void
74(cs_gwf_soil_update_t) (const cs_real_t t_eval,
75 const cs_mesh_t *mesh,
76 const cs_cdo_connect_t *connect,
77 const cs_cdo_quantities_t *quant,
78 const cs_zone_t *zone,
79 cs_gwf_soil_t *soil);
80
81/*----------------------------------------------------------------------------*/
88/*----------------------------------------------------------------------------*/
89
90typedef void
91(cs_gwf_soil_free_param_t)(void **p_param);
92
93/*============================================================================
94 * Type definitions
95 *============================================================================*/
96
105
106typedef struct {
107
125
127
128 double n;
129 double m;
130 double scale;
132
134
135
144
240
241/*============================================================================
242 * User-defined function prototypes
243 *============================================================================*/
244
245/*============================================================================
246 * Public function prototypes
247 *============================================================================*/
248
249/*----------------------------------------------------------------------------*/
255/*----------------------------------------------------------------------------*/
256
257int
259
260/*----------------------------------------------------------------------------*/
268/*----------------------------------------------------------------------------*/
269
270cs_gwf_soil_t *
271cs_gwf_soil_by_id(int id);
272
273/*----------------------------------------------------------------------------*/
281/*----------------------------------------------------------------------------*/
282
283cs_gwf_soil_t *
284cs_gwf_soil_by_name(const char *name);
285
286/*----------------------------------------------------------------------------*/
294/*----------------------------------------------------------------------------*/
295
298
299/*----------------------------------------------------------------------------*/
306/*----------------------------------------------------------------------------*/
307
308int
310
311/*----------------------------------------------------------------------------*/
317/*----------------------------------------------------------------------------*/
318
319bool
321
322/*----------------------------------------------------------------------------*/
328/*----------------------------------------------------------------------------*/
329
330void
332
333/*----------------------------------------------------------------------------*/
349/*----------------------------------------------------------------------------*/
350
351cs_gwf_soil_t *
352cs_gwf_soil_create(const cs_zone_t *zone,
353 cs_gwf_model_type_t hydraulic_model,
355 cs_property_type_t perm_type,
356 double k_abs[3][3],
357 double porosity,
358 double bulk_density,
359 void *hydraulic_context);
360
361/*----------------------------------------------------------------------------*/
368/*----------------------------------------------------------------------------*/
369
370void
372
373/*----------------------------------------------------------------------------*/
379/*----------------------------------------------------------------------------*/
380
381const short int *
383
384/*----------------------------------------------------------------------------*/
396/*----------------------------------------------------------------------------*/
397
398void
400 const cs_cdo_connect_t *connect);
401
402/*----------------------------------------------------------------------------*/
409/*----------------------------------------------------------------------------*/
410
411const double *
413
414/*----------------------------------------------------------------------------*/
418/*----------------------------------------------------------------------------*/
419
420void
422
423/*----------------------------------------------------------------------------*/
427/*----------------------------------------------------------------------------*/
428
429void
431
432/*----------------------------------------------------------------------------*/
451/*----------------------------------------------------------------------------*/
452
453void
454cs_gwf_soil_set_genuchten_param(cs_gwf_soil_t *soil,
455 double theta_r,
456 double alpha,
457 double n,
458 double L);
459
460/*----------------------------------------------------------------------------*/
469/*----------------------------------------------------------------------------*/
470
471void
472cs_gwf_soil_set_user(cs_gwf_soil_t *soil,
473 void *param,
474 cs_gwf_soil_update_t *update_func,
475 cs_gwf_soil_free_param_t *free_param_func);
476
477/*----------------------------------------------------------------------------*/
486/*----------------------------------------------------------------------------*/
487
488void
490 cs_property_t *soil_porosity);
491
492/*----------------------------------------------------------------------------*/
500/*----------------------------------------------------------------------------*/
501
502void
504
505/*----------------------------------------------------------------------------*/
513/*----------------------------------------------------------------------------*/
514
515void
517
518/*----------------------------------------------------------------------------*/
527/*----------------------------------------------------------------------------*/
528
529void
531 const cs_mesh_t *mesh,
532 const cs_cdo_connect_t *connect,
533 const cs_cdo_quantities_t *quant);
534
535/*----------------------------------------------------------------------------*/
543/*----------------------------------------------------------------------------*/
544
545void
547
548/*----------------------------------------------------------------------------*/
556/*----------------------------------------------------------------------------*/
557
558void
560
561/*----------------------------------------------------------------------------*/
570/*----------------------------------------------------------------------------*/
571
572void
575
576/*----------------------------------------------------------------------------*/
587/*----------------------------------------------------------------------------*/
588
589void
591 const cs_cdo_connect_t *connect,
593
594/*----------------------------------------------------------------------------*/
595
597
598#endif /* __CS_GWF_SOIL_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define END_C_DECLS
Definition cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:313
cs_gwf_model_type_t
Type of system of equation(s) to consider for the physical modelling.
Definition cs_gwf_param.h:118
cs_gwf_soil_model_t
Predefined hydraulic model of soils used in the groundwater flow module.
Definition cs_gwf_param.h:256
cs_real_t cs_gwf_soil_get_saturated_moisture(int soil_id)
Get the saturated moisture for the given soil id.
Definition cs_gwf_soil.c:306
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)....
Definition cs_gwf_soil.c:932
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....
Definition cs_gwf_soil.c:1188
cs_gwf_soil_t * cs_gwf_soil_by_id(int id)
Retrieve a soil structure from its id.
Definition cs_gwf_soil.c:257
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....
Definition cs_gwf_soil.c:1105
int cs_gwf_get_n_soils(void)
Get the number of allocated soils.
Definition cs_gwf_soil.c:241
void cs_gwf_soil_free_param_t(void **p_param)
Generic function to set free the parameter structure associated to a soil.
Definition cs_gwf_soil.h:91
cs_gwf_soil_t * cs_gwf_soil_by_name(const char *name)
Retrieve a soil structure from its name.
Definition cs_gwf_soil.c:276
void cs_gwf_soil_build_cell2soil(cs_lnum_t n_cells)
Build an array storing the associated soil for each cell The lifecycle of this array is managed by th...
Definition cs_gwf_soil.c:565
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 o...
Definition cs_gwf_soil.c:437
void cs_gwf_soil_free_all(void)
Free all cs_gwf_soil_t structures.
Definition cs_gwf_soil.c:713
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....
Definition cs_gwf_soil.c:1321
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 re...
Definition cs_gwf_soil.c:1021
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.
Definition cs_gwf_soil.c:859
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 probl...
Definition cs_gwf_soil.c:380
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.
Definition cs_gwf_soil.c:1059
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....
Definition cs_gwf_soil.h:74
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)....
Definition cs_gwf_soil.c:984
void cs_gwf_soil_build_dual_porous_volume(const cs_cdo_quantities_t *cdoq, const cs_cdo_connect_t *connect)
Build an array storing the dual volume associated to each vertex taking into account the porosity of ...
Definition cs_gwf_soil.c:632
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.
Definition cs_gwf_soil.c:326
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 model.
Definition cs_gwf_soil.c:902
bool cs_gwf_soil_all_are_saturated(void)
Check if all soils have been set as CS_GWF_SOIL_SATURATED.
Definition cs_gwf_soil.c:358
const short int * cs_gwf_soil_get_cell2soil(void)
Get the array storing the associated soil for each cell.
Definition cs_gwf_soil.c:612
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....
Definition cs_gwf_soil.c:1450
const double * cs_gwf_soil_get_dual_porous_volume(void)
Get the array storing the dual volume weighted by the soil porosity Array of size n_vertices.
Definition cs_gwf_soil.c:701
void cs_gwf_soil_log_setup(void)
Summary of the settings related to all cs_gwf_soil_t structures.
Definition cs_gwf_soil.c:768
cs_flag_t cs_property_type_t
Definition cs_property.h:117
Definition mesh.f90:26
Main structure to handle a soil in the groundwater flow module.
Definition cs_gwf_soil.h:145
cs_gwf_model_type_t hydraulic_model
Definition cs_gwf_soil.h:222
double porosity
Definition cs_gwf_soil.h:227
void * model_param
Definition cs_gwf_soil.h:232
int id
Definition cs_gwf_soil.h:219
double abs_permeability[3][3]
Definition cs_gwf_soil.h:229
double bulk_density
Definition cs_gwf_soil.h:226
cs_gwf_soil_free_param_t * free_model_param
Definition cs_gwf_soil.h:237
cs_gwf_soil_update_t * update_properties
Definition cs_gwf_soil.h:236
int zone_id
Definition cs_gwf_soil.h:220
void * hydraulic_context
Definition cs_gwf_soil.h:223
int abs_permeability_dim
Definition cs_gwf_soil.h:228
cs_gwf_soil_model_t model
Definition cs_gwf_soil.h:231
Definition cs_cdo_connect.h:61
Definition cs_cdo_quantities.h:137
Structure to handle the Van Genuchten-Mualen model of soil.
Definition cs_gwf_soil.h:106
double m
Definition cs_gwf_soil.h:129
double scale
Definition cs_gwf_soil.h:130
double n
Definition cs_gwf_soil.h:128
double residual_moisture
Definition cs_gwf_soil.h:126
double tortuosity
Definition cs_gwf_soil.h:131
Structure to handle the modelling of miscible or immiscible two-phase flows in a porous media.
Definition cs_gwf_priv.h:332
Definition cs_mesh.h:85
Structure associated to the definition of a property relying on the cs_xdef_t structure.
time step descriptor
Definition cs_time_step.h:64
Definition cs_zone.h:55