GRASS 8 Programmer's Manual 8.6.0dev(2026)-0f6a7341fc
Loading...
Searching...
No Matches
N_gwflow.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * MODULE: Grass PDE Numerical Library
4 * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
5 * soerengebbert <at> gmx <dot> de
6 *
7 * PURPOSE: groundwater flow in porous media
8 * part of the gpde library
9 *
10 * SPDX-FileCopyrightText: 2000 GRASS Development Team
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 *****************************************************************************/
14
15#ifndef _N_GWFLOW_H_
16#define _N_GWFLOW_H_
17#include "N_pde.h"
18#include <math.h>
19
20#define N_GW_CONFINED 0 /*confined groundwater */
21#define N_GW_UNCONFINED 1 /*unconfined groundwater */
22
23#define N_GW_DRY_CELL 0 /*a dry cell */
24#define N_GW_SURFACE_CELL 1 /*a surface cell */
25#define N_GW_NORMAL_CELL 2 /*a normal wet cell */
26
27/*!
28 * \brief This data structure contains all data needed to compute the
29 * groundwater mass balance in three dimension
30 * */
31typedef struct {
32 N_array_3d *phead; /*!piezometric head [m] */
33 N_array_3d *phead_start; /*!start conditions [m] */
34 N_array_3d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
35 N_array_3d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
36 N_array_3d *hc_z; /*!z part of the hydraulic conductivity tensor [m/s] */
37 N_array_3d *q; /*!sources and sinks [m^3/s] */
38 N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
39 N_array_3d *s; /*!specific yield [1/m] */
40 N_array_3d *nf; /*!effective porosity [-] */
41
42 /*river */
43 N_array_3d *river_leak; /*!Leakage of the river bed [1/s] */
44 N_array_3d *river_head; /*!Waterlevel of the river [m] */
45 N_array_3d *river_bed; /*!Bed of the river [m] */
46
47 /*drainage */
48 N_array_3d *drain_leak; /*!Leakage of the drainage bed [1/s] */
49 N_array_3d *drain_bed; /*!Bed of the drainage [m] */
50
51 N_array_3d *status; /*!active/inactive/dirichlet cell status */
52 N_array_3d *drycells; /*!array of dry cells */
53
54 double dt; /*!calculation time [s] */
55
57
58/*!
59 * \brief This data structure contains all data needed to compute the
60 * groundwater mass balance in two dimension
61 * */
62typedef struct {
63 N_array_2d *phead; /*!piezometric head [m] */
64 N_array_2d *phead_start; /*!start conditions [m] */
65 N_array_2d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
66 N_array_2d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
67 N_array_2d *q; /*!sources and sinks [m^3/s] */
68 N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
69 N_array_2d *s; /*!specific yield [1/m] */
70 N_array_2d *nf; /*!effective porosity [-] */
71
72 /*river */
73 N_array_2d *river_leak; /*!Leakage of the river bed [1/s] */
74 N_array_2d *river_head; /*!Waterlevel of the river [m] */
75 N_array_2d *river_bed; /*!Bed of the river [m] */
76
77 /*drainage */
78 N_array_2d *drain_leak; /*!Leakage of the drainage bed [1/s] */
79 N_array_2d *drain_bed; /*!Bed of the drainage */
80
81 N_array_2d *top; /*!top surface of the quifer [m] */
82 N_array_2d *bottom; /*!bottom of the aquifer [m] */
83
84 N_array_2d *status; /*!active/inactive/dirichlet cell status */
85 N_array_2d *drycells; /*!array of dry cells */
86
87 double dt; /*!calculation time */
88 int gwtype; /*!Which type of groundwater, N_GW_CONFINED or N_GW_UNCONFIED */
89
91
93 int col, int row, int depth);
95 int col, int row);
101 N_array_2d *balance);
102extern N_gwflow_data3d *N_alloc_gwflow_data3d(int cols, int rows, int depths,
103 int river, int drain);
104extern N_gwflow_data2d *N_alloc_gwflow_data2d(int cols, int rows, int river,
105 int drain);
106extern void N_free_gwflow_data3d(N_gwflow_data3d *data);
107extern void N_free_gwflow_data2d(N_gwflow_data2d *data);
108#endif
N_data_star * N_callback_gwflow_2d(void *gwdata, N_geom_data *geom, int col, int row)
This callback function creates the mass balance of a 5 point star.
Definition n_gwflow.c:473
void N_gwflow_3d_calc_water_budget(N_gwflow_data3d *data, N_geom_data *geom, N_array_3d *budget)
This function computes the water budget of the entire groundwater.
Definition n_gwflow.c:370
N_gwflow_data2d * N_alloc_gwflow_data2d(int cols, int rows, int river, int drain)
Allocate memory for the groundwater calculation data structure in 2 dimensions.
Definition n_gwflow.c:148
void N_gwflow_2d_calc_water_budget(N_gwflow_data2d *data, N_geom_data *geom, N_array_2d *balance)
This function computes the water budget of the entire groundwater.
Definition n_gwflow.c:656
void N_free_gwflow_data3d(N_gwflow_data3d *data)
Release the memory of the groundwater flow data structure in three dimensions.
Definition n_gwflow.c:88
N_gwflow_data3d * N_alloc_gwflow_data3d(int cols, int rows, int depths, int river, int drain)
Allocate memory for the groundwater calculation data structure in 3 dimensions.
Definition n_gwflow.c:36
void N_free_gwflow_data2d(N_gwflow_data2d *data)
Release the memory of the groundwater flow data structure in two dimensions.
Definition n_gwflow.c:199
N_data_star * N_callback_gwflow_3d(void *gwdata, N_geom_data *geom, int col, int row, int depth)
This callback function creates the mass balance of a 7 point star.
Definition n_gwflow.c:264
Matrix entries for a mass balance 5/7/9 star system.
Definition N_pde.h:292
Geometric information about the structured grid.
Definition N_pde.h:98
This data structure contains all data needed to compute the groundwater mass balance in two dimension...
Definition N_gwflow.h:62
N_array_2d * hc_y
Definition N_gwflow.h:66
N_array_2d * nf
Definition N_gwflow.h:70
N_array_2d * top
Definition N_gwflow.h:81
N_array_2d * drain_leak
Definition N_gwflow.h:78
N_array_2d * bottom
Definition N_gwflow.h:82
N_array_2d * phead_start
Definition N_gwflow.h:64
N_array_2d * river_leak
Definition N_gwflow.h:73
N_array_2d * s
Definition N_gwflow.h:69
N_array_2d * hc_x
Definition N_gwflow.h:65
N_array_2d * r
Definition N_gwflow.h:68
N_array_2d * drycells
Definition N_gwflow.h:85
N_array_2d * drain_bed
Definition N_gwflow.h:79
N_array_2d * q
Definition N_gwflow.h:67
N_array_2d * river_bed
Definition N_gwflow.h:75
N_array_2d * river_head
Definition N_gwflow.h:74
N_array_2d * phead
Definition N_gwflow.h:63
N_array_2d * status
Definition N_gwflow.h:84
This data structure contains all data needed to compute the groundwater mass balance in three dimensi...
Definition N_gwflow.h:31
N_array_3d * phead
Definition N_gwflow.h:32
N_array_3d * hc_z
Definition N_gwflow.h:36
N_array_3d * phead_start
Definition N_gwflow.h:33
N_array_3d * hc_x
Definition N_gwflow.h:34
N_array_3d * drain_leak
Definition N_gwflow.h:48
N_array_3d * status
Definition N_gwflow.h:51
N_array_3d * drycells
Definition N_gwflow.h:52
N_array_3d * drain_bed
Definition N_gwflow.h:49
N_array_3d * river_bed
Definition N_gwflow.h:45
N_array_3d * river_head
Definition N_gwflow.h:44
N_array_3d * s
Definition N_gwflow.h:39
N_array_2d * r
Definition N_gwflow.h:38
N_array_3d * q
Definition N_gwflow.h:37
N_array_3d * hc_y
Definition N_gwflow.h:35
N_array_3d * nf
Definition N_gwflow.h:40
N_array_3d * river_leak
Definition N_gwflow.h:43