Loading...
Searching...
No Matches
N_gwflow.h
Go to the documentation of this file.
/*****************************************************************************
*
* MODULE: Grass PDE Numerical Library
* AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
* soerengebbert <at> gmx <dot> de
*
* PURPOSE: groundwater flow in porous media
* part of the gpde library
*
* COPYRIGHT: (C) 2000 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
*****************************************************************************/
#ifndef _N_GWFLOW_H_
#define _N_GWFLOW_H_
#include "N_pde.h"
#include <math.h>
#define N_GW_CONFINED 0 /*confined groundwater */
#define N_GW_UNCONFINED 1 /*unconfined groundwater */
#define N_GW_DRY_CELL 0 /*a dry cell */
#define N_GW_SURFACE_CELL 1 /*a surface cell */
#define N_GW_NORMAL_CELL 2 /*a normal wet cell */
/*!
* \brief This data structure contains all data needed to compute the
* groundwater mass balance in three dimension
* */
typedef struct {
N_array_3d *phead; /*!piezometric head [m] */
N_array_3d *phead_start; /*!start conditions [m] */
N_array_3d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
N_array_3d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
N_array_3d *hc_z; /*!z part of the hydraulic conductivity tensor [m/s] */
N_array_3d *q; /*!sources and sinks [m^3/s] */
N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
N_array_3d *s; /*!specific yield [1/m] */
N_array_3d *nf; /*!effective porosity [-] */
/*river */
N_array_3d *river_leak; /*!Leakage of the river bed [1/s] */
N_array_3d *river_head; /*!Waterlevel of the river [m] */
N_array_3d *river_bed; /*!Bed of the river [m] */
/*drainage */
N_array_3d *drain_leak; /*!Leakage of the drainage bed [1/s] */
N_array_3d *drain_bed; /*!Bed of the drainage [m] */
N_array_3d *status; /*!active/inactive/dirichlet cell status */
N_array_3d *drycells; /*!array of dry cells */
double dt; /*!calculation time [s] */
} N_gwflow_data3d;
/*!
* \brief This data structure contains all data needed to compute the
* groundwater mass balance in two dimension
* */
typedef struct {
N_array_2d *phead; /*!piezometric head [m] */
N_array_2d *phead_start; /*!start conditions [m] */
N_array_2d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
N_array_2d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
N_array_2d *q; /*!sources and sinks [m^3/s] */
N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
N_array_2d *s; /*!specific yield [1/m] */
N_array_2d *nf; /*!effective porosity [-] */
/*river */
N_array_2d *river_leak; /*!Leakage of the river bed [1/s] */
N_array_2d *river_head; /*!Waterlevel of the river [m] */
N_array_2d *river_bed; /*!Bed of the river [m] */
/*drainage */
N_array_2d *drain_leak; /*!Leakage of the drainage bed [1/s] */
N_array_2d *drain_bed; /*!Bed of the drainage */
N_array_2d *top; /*!top surface of the quifer [m] */
N_array_2d *bottom; /*!bottom of the aquifer [m] */
N_array_2d *status; /*!active/inactive/dirichlet cell status */
N_array_2d *drycells; /*!array of dry cells */
double dt; /*!calculation time */
int gwtype; /*!Which type of groundwater, N_GW_CONFINED or N_GW_UNCONFIED */
} N_gwflow_data2d;
extern N_data_star *N_callback_gwflow_3d(void *gwdata, N_geom_data *geom,
int col, int row, int depth);
extern N_data_star *N_callback_gwflow_2d(void *gwdata, N_geom_data *geom,
int col, int row);
extern void N_gwflow_3d_calc_water_budget(N_gwflow_data3d *data,
N_geom_data *geom,
N_array_3d *budget);
extern void N_gwflow_2d_calc_water_budget(N_gwflow_data2d *data,
N_geom_data *geom,
N_array_2d *balance);
extern N_gwflow_data3d *N_alloc_gwflow_data3d(int cols, int rows, int depths,
int river, int drain);
extern N_gwflow_data2d *N_alloc_gwflow_data2d(int cols, int rows, int river,
int drain);
extern void N_free_gwflow_data3d(N_gwflow_data3d *data);
extern void N_free_gwflow_data2d(N_gwflow_data2d *data);
#endif
N_callback_gwflow_2d
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:476
N_gwflow_3d_calc_water_budget
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:373
N_alloc_gwflow_data2d
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:151
N_gwflow_2d_calc_water_budget
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:659
N_free_gwflow_data3d
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:91
N_alloc_gwflow_data3d
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:39
N_free_gwflow_data2d
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:202
N_callback_gwflow_3d
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:267
N_pde.h
N_array_2d
Definition N_pde.h:132
N_array_3d
Definition N_pde.h:175
N_data_star
Matrix entries for a mass balance 5/7/9 star system.
Definition N_pde.h:295
N_geom_data
Geometric information about the structured grid.
Definition N_pde.h:101
N_gwflow_data2d
This data structure contains all data needed to compute the groundwater mass balance in two dimension...
Definition N_gwflow.h:65
N_gwflow_data2d::hc_y
N_array_2d * hc_y
Definition N_gwflow.h:69
N_gwflow_data2d::nf
N_array_2d * nf
Definition N_gwflow.h:73
N_gwflow_data2d::top
N_array_2d * top
Definition N_gwflow.h:84
N_gwflow_data2d::drain_leak
N_array_2d * drain_leak
Definition N_gwflow.h:81
N_gwflow_data2d::bottom
N_array_2d * bottom
Definition N_gwflow.h:85
N_gwflow_data2d::phead_start
N_array_2d * phead_start
Definition N_gwflow.h:67
N_gwflow_data2d::river_leak
N_array_2d * river_leak
Definition N_gwflow.h:76
N_gwflow_data2d::s
N_array_2d * s
Definition N_gwflow.h:72
N_gwflow_data2d::hc_x
N_array_2d * hc_x
Definition N_gwflow.h:68
N_gwflow_data2d::r
N_array_2d * r
Definition N_gwflow.h:71
N_gwflow_data2d::drycells
N_array_2d * drycells
Definition N_gwflow.h:88
N_gwflow_data2d::dt
double dt
Definition N_gwflow.h:90
N_gwflow_data2d::drain_bed
N_array_2d * drain_bed
Definition N_gwflow.h:82
N_gwflow_data2d::q
N_array_2d * q
Definition N_gwflow.h:70
N_gwflow_data2d::gwtype
int gwtype
Definition N_gwflow.h:91
N_gwflow_data2d::river_bed
N_array_2d * river_bed
Definition N_gwflow.h:78
N_gwflow_data2d::river_head
N_array_2d * river_head
Definition N_gwflow.h:77
N_gwflow_data2d::phead
N_array_2d * phead
Definition N_gwflow.h:66
N_gwflow_data2d::status
N_array_2d * status
Definition N_gwflow.h:87
N_gwflow_data3d
This data structure contains all data needed to compute the groundwater mass balance in three dimensi...
Definition N_gwflow.h:34
N_gwflow_data3d::phead
N_array_3d * phead
Definition N_gwflow.h:35
N_gwflow_data3d::hc_z
N_array_3d * hc_z
Definition N_gwflow.h:39
N_gwflow_data3d::phead_start
N_array_3d * phead_start
Definition N_gwflow.h:36
N_gwflow_data3d::hc_x
N_array_3d * hc_x
Definition N_gwflow.h:37
N_gwflow_data3d::drain_leak
N_array_3d * drain_leak
Definition N_gwflow.h:51
N_gwflow_data3d::status
N_array_3d * status
Definition N_gwflow.h:54
N_gwflow_data3d::drycells
N_array_3d * drycells
Definition N_gwflow.h:55
N_gwflow_data3d::drain_bed
N_array_3d * drain_bed
Definition N_gwflow.h:52
N_gwflow_data3d::river_bed
N_array_3d * river_bed
Definition N_gwflow.h:48
N_gwflow_data3d::river_head
N_array_3d * river_head
Definition N_gwflow.h:47
N_gwflow_data3d::s
N_array_3d * s
Definition N_gwflow.h:42
N_gwflow_data3d::dt
double dt
Definition N_gwflow.h:57
N_gwflow_data3d::r
N_array_2d * r
Definition N_gwflow.h:41
N_gwflow_data3d::q
N_array_3d * q
Definition N_gwflow.h:40
N_gwflow_data3d::hc_y
N_array_3d * hc_y
Definition N_gwflow.h:38
N_gwflow_data3d::nf
N_array_3d * nf
Definition N_gwflow.h:43
N_gwflow_data3d::river_leak
N_array_3d * river_leak
Definition N_gwflow.h:46