SNOWPACK  SNOWPACK-3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WaterTransport.h
Go to the documentation of this file.
1 /*
2  * SNOWPACK stand-alone
3  *
4  * Copyright WSL Institute for Snow and Avalanche Research SLF, DAVOS, SWITZERLAND
5 */
6 /* This file is part of Snowpack.
7  Snowpack is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Snowpack is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Snowpack. If not, see <http://www.gnu.org/licenses/>.
19 */
25 #ifndef WATERTRANSPORT_H
26 #define WATERTRANSPORT_H
27 
28 #include <snowpack/DataClasses.h>
30 
31 #include <meteoio/MeteoIO.h>
32 
40 
41  public:
42  WaterTransport(const SnowpackConfig& cfg);
43  void compTransportMass(const CurrentMeteo& Mdata, const double& ql, SnowStation& Xdata, SurfaceFluxes& Sdata);
44 
45  private:
46  //The following 3 functions are used in WaterTransport model "NIED"
47  double BisFunc(const double X, const double P[]);
48  double Bisection(const double minval, const double maxval, double P[]);
49  void KHCalcNaga(const double RG, const double Dens, double ThR, const double WatCnt, const double SatuK, double &Rh, double &Rk);
50 
51  void compSurfaceSublimation(const CurrentMeteo& Mdata, double ql, SnowStation& Xdata, SurfaceFluxes& Sdata);
52 
53  void mergingElements(SnowStation& Xdata, SurfaceFluxes& Sdata);
54 
55  void adjustDensity(SnowStation& Xdata);
56 
57  void transportWater(const CurrentMeteo& Mdata, SnowStation& Xdata, SurfaceFluxes& Sdata);
58 
59  ReSolver1d RichardsEquationSolver1d;
60 
61  std::string variant;
62 
63  //To prevent string comparisons, we define an enumerated list:
64  enum watertransportmodels{UNDEFINED, BUCKET, NIED, RICHARDSEQUATION};
65  watertransportmodels iwatertransportmodel_snow, iwatertransportmodel_soil;
66 
67  std::string watertransportmodel_snow;
68  std::string watertransportmodel_soil;
69  double sn_dt;
70  double hoar_thresh_rh, hoar_thresh_vw, hoar_thresh_ta;
71  double hoar_density_buried, hoar_density_surf, hoar_min_size_buried;
72  double minimum_l_element;
73  bool useSoilLayers, water_layer, jam;
74 };
75 #endif //End of WaterTransport.h
76 
This module contains water transport routines for the 1d snowpack model.
Definition: WaterTransport.h:39
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:580
WaterTransport(const SnowpackConfig &cfg)
Definition: WaterTransport.cc:33
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:81
void compTransportMass(const CurrentMeteo &Mdata, const double &ql, SnowStation &Xdata, SurfaceFluxes &Sdata)
The mass transport procedure is called from sn_Snowpack – AFTER calling the NEWSNOW (sn_SnowFall) or ...
Definition: WaterTransport.cc:1212
This module contains the solver for the 1d Richards Equation for the 1d snowpack model.
Definition: ReSolver1d.h:40
Station data including all information on snowpack layers (elements and nodes) and on canopy This is...
Definition: DataClasses.h:463