TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
b_volumes.c File Reference
#include "turtle.h"
#include "t_alloc.h"
#include "t_utilities.h"
#include "rw_maps.h"
#include "geometry.h"
#include "g_raster2plvector.h"
#include "bigcells2.h"
#include "geometry2.h"
#include "b_utilities.h"
#include "b_solver.h"
#include "keywords_file_b.h"
#include "b_volumes.h"

Go to the source code of this file.

Functions

double volume (double eta, long i)
 
double volume_surf (double eta, long i)
 
double volume_subs (double eta, long i)
 
double vertical_area (double eta, long j)
 
double vertical_area_subs (double eta, long j)
 
double vertical_area_surf (double eta, long j)
 
double wet_area (double eta, long i, double deta)
 
double min_elevation (long i)
 
double q_discharge_from_outlet_subs_line (double eta, long j)
 
double q_discharge_from_outlet_cell (double eta, long i)
 

Variables

STRINGBINfilenames
 
DOUBLERASTER_MAPdraster
 
DOUBLE_GRIDdgrid
 
PARAMparam
 
FLAGflag
 
DOUBLEVECTORelevation_bottom_fine
 
DOUBLEVECTORelevation_bottom_coarse
 
DOUBLEVECTORelevation_bottom_flines
 
DOUBLEVECTORelevation_bottom_bottom
 
DOUBLEVECTORelevation_terrain_fine
 
DOUBLEVECTORelevation_terrain_flines
 
DOUBLEVECTORoutlet_coefficient
 
DOUBLEVECTORoutlet_coefficient_surf
 
DOUBLEVECTORporosity_fine
 
DOUBLEVECTORwater_surface_elevation
 extern DOUBLEVECTOR runoff_coefficient; /!<map of the coefficient of the rating curve in the outlet q_discharge=C*h_sup^m */ More...
 
DOUBLEVECTORwater_mass_error
 

Detailed Description

Author
Emanuele Cordano
Attention

This file is part of Boussinesq.

Boussinesq is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Boussinesq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Boussinesq. If not, see http://www.gnu.org/licenses/.

Definition in file b_volumes.c.

Function Documentation

double min_elevation ( long  i)
Author
Emanuele Cordano
Date
13 May 2009
Parameters
i(long) - index of the coarse cell
Returns
the elevation of the lowest point of the cell

initialization of elevation with a very high double float number

Definition at line 357 of file b_volumes.c.

References LONGBIN::index, min_elevation(), LONGVECTOR::nh, DOUBLEVECTOR::nh, NL, LONGVECTOR::nl, DOUBLE_GRID::novalue, DOUBLE_GRID::small_polygon_content, and stop_execution().

Referenced by main(), and min_elevation().

double q_discharge_from_outlet_cell ( double  eta,
long  i 
)
Date
14 October 2009
Author
Emanuele Cordano
Parameters
eta- (double)
i- (index of the cell)

It calculates the discharge through all boundary edges of the i-th cell in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages. It calls q_discharge_from_outlet for each boundary edge!

Returns
outflow discarge area from the i-th cell

Definition at line 441 of file b_volumes.c.

References GRID::boundary_indicator, DOUBLE_GRID::coarse, polygon_connection_attributes::connections, POLYGON::edge_indices, POLYGONVECTOR::element, polygon_connection_attribute_array::element, GRID::links, LONGVECTOR::nh, LONGVECTOR::nl, GRID::polygons, and q_discharge_from_outlet_subs_line().

Referenced by time_loop().

double q_discharge_from_outlet_subs_line ( double  eta,
long  j 
)
Parameters
EmanueleCordano
Date
14 October 2009
Parameters
eta- (double) water surface elevation;
j- (long) line indicator;

It calculates the discharge of the j-th line in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages.

Returns
outflow discarge through a boundary line

Definition at line 400 of file b_volumes.c.

References LINEVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LINE::length2d, GRID::lines, LINEVECTOR::nh, LONGVECTOR::nh, NL, LINEVECTOR::nl, LONGVECTOR::nl, DOUBLE_GRID::novalue, PARAM::p_outlet, PARAM::p_outlet_surf, DOUBLE_GRID::small_line_content, and stop_execution().

Referenced by q_discharge_from_outlet_cell().

double vertical_area ( double  eta,
long  j 
)
Author
Emanuele Cordano
October 2009
Returns
total vertical area over the j-th line in function of water table eta.

Definition at line 193 of file b_volumes.c.

References vertical_area_subs().

double vertical_area_subs ( double  eta,
long  j 
)
Parameters
EmanueleCordano
Date
19 April 2009 (modified October 2009)
Parameters
eta- (double) water surface elevation;
j- (long) line indicator;

It calculates the (subsurface wet) vertical area of the j-th line in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages.

Returns
vertical wet area over a line between two polygons

Definition at line 211 of file b_volumes.c.

References LINEVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LINE::length2d, GRID::lines, LINEVECTOR::nh, LONGVECTOR::nh, NL, LINEVECTOR::nl, LONGVECTOR::nl, DOUBLE_GRID::novalue, DOUBLE_GRID::small_line_content, and stop_execution().

Referenced by t_st_operator_element_subs(), and vertical_area().

double vertical_area_surf ( double  eta,
long  j 
)
Parameters
EmanueleCordano
Date
22 October 2009
Parameters
eta- (double) water surface elevation;
j- (long) line indicator;

It calculates the (surface wet) vertical area of the j-th line in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages.

Returns
(surface) vertical wet area over a line between two polygons

Definition at line 251 of file b_volumes.c.

References LINEVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LINE::length2d, GRID::lines, LINEVECTOR::nh, LONGVECTOR::nh, NL, LINEVECTOR::nl, DOUBLE_GRID::novalue, DOUBLE_GRID::small_line_content, and stop_execution().

Referenced by b_advection(), t_st_advection_operator_element(), and update_F1_wet_vert_area().

double volume ( double  eta,
long  i 
)

map of instantaneous water mass error

Author
Emanuele Cordano
Date
October 2009
Returns
the volume of the i-th cell of the i-th cells

Definition at line 63 of file b_volumes.c.

References volume_subs(), and volume_surf().

Referenced by Newton_convergence(), and time_loop().

double volume_subs ( double  eta,
long  i 
)
Author
Emanuele Cordano (modified October 2009)
Date
17 April 2009
Parameters
eta- (double) value of water-table level
i- (long) index of the (coarse) cell

It calculates the (subsurface water) volume of the i-th cell in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages.

Returns
water volume contained in a cell

Definition at line 136 of file b_volumes.c.

References POLYGON::area2D, POLYGONVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LONGVECTOR::nh, DOUBLEVECTOR::nh, NL, LONGVECTOR::nl, GRID::polygons, DOUBLE_GRID::small_polygon_content, and stop_execution().

Referenced by volume().

double volume_surf ( double  eta,
long  i 
)
Author
Emanuele Cordano (modified October 2009)
Date
22 October 2009
Parameters
eta- (double) value of water-table level
i- (long) index of the (coarse) cell

It calculates the (surface water) volume of the i-th cell in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages.

Returns
(surface water) water volume contained in a cell

Definition at line 80 of file b_volumes.c.

References POLYGON::area2D, POLYGONVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LONGVECTOR::nh, DOUBLEVECTOR::nh, NL, LONGVECTOR::nl, GRID::polygons, DOUBLE_GRID::small_polygon_content, and stop_execution().

Referenced by volume().

double wet_area ( double  eta,
long  i,
double  deta 
)
Author
Emanuele Cordano
Date
8 May 2009
Parameters
eta- (double) value of water-table level
i- (long) index of the (coarse) cell
deta- (double) water surface delta utilized for derivate (area_horiz)

It calculates the volume of the i-th cell in function of a value of a free surface elevation and fine-grid topography, according to what is specified in the documentation with detailed algebraic passages. The wet area is the derivative respect to the variable eta of the stored volume calculated by function volume()

Returns
wet area of the i-th cell

modified by Emanuele Cordano on 2

Definition at line 294 of file b_volumes.c.

References POLYGON::area2D, POLYGONVECTOR::element, DOUBLE_GRID::fine, LONGBIN::index, LONGVECTOR::nh, DOUBLEVECTOR::nh, NL, LONGVECTOR::nl, DOUBLE_GRID::novalue, GRID::polygons, DOUBLE_GRID::small_polygon_content, and stop_execution().

Referenced by b_smatrix_element().

Variable Documentation

DOUBLE_GRID* dgrid

Definition at line 126 of file main.c.

DOUBLERASTER_MAP* draster

Definition at line 128 of file main.c.

DOUBLEVECTOR* elevation_bottom_bottom

map of the bottom elevation defined in the lines of the fine grid

Definition at line 134 of file main.c.

DOUBLEVECTOR* elevation_bottom_coarse

map of the bottom elevation (fine grid)

Definition at line 132 of file main.c.

DOUBLEVECTOR* elevation_bottom_fine

Definition at line 131 of file main.c.

DOUBLEVECTOR* elevation_bottom_flines

map of the bottom elevation (coarse grid)

Definition at line 133 of file main.c.

DOUBLEVECTOR* elevation_terrain_fine

map of the elvetion of the bottom of he coarse cells

Definition at line 135 of file main.c.

DOUBLEVECTOR* elevation_terrain_flines

map of the surface terrain elevation (fine grid)

Definition at line 136 of file main.c.

STRINGBIN* filenames

Definition at line 124 of file main.c.

FLAG* flag

Definition at line 149 of file main.c.

DOUBLEVECTOR* outlet_coefficient

map of the surface terrain elevation (fine grid lines) map of the coefficient of the rating curve in the outlet q_discharge=C*h_sup^m

map of porosity defined on the pixels of the fine grid

Definition at line 138 of file main.c.

DOUBLEVECTOR* outlet_coefficient_surf

map of the coefficient of the rating curve in the outlet (surface flow) q_discharge=C*h_sup^m

Definition at line 139 of file main.c.

PARAM* param

coefficient F1 for surface flow as reported in Casulli,2008

Definition at line 148 of file main.c.

DOUBLEVECTOR* porosity_fine

map of the surface terrain elevation (fine grid lines)

Definition at line 137 of file main.c.

DOUBLEVECTOR* water_mass_error

map of instantaneous water surface on the pixels of the coarse grid

Definition at line 143 of file main.c.

DOUBLEVECTOR* water_surface_elevation

extern DOUBLEVECTOR runoff_coefficient; /!<map of the coefficient of the rating curve in the outlet q_discharge=C*h_sup^m */

map of porosity defined on the pixels of the fine grid

Definition at line 142 of file main.c.