SNOWPACK 20241221.26c8720
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
30
31#include <meteoio/MeteoIO.h>
32
40
41 public:
43 virtual ~WaterTransport() {}
44 void compTransportMass(const CurrentMeteo& Mdata, SnowStation& Xdata, SurfaceFluxes& Sdata, double& ql);
45
46 protected:
47 void mergingElements(SnowStation& Xdata, SurfaceFluxes& Sdata);
48 void adjustDensity(SnowStation& Xdata);
49
50 //To prevent string comparisons, we define an enumerated list:
52
53 private:
54 //The following 3 functions are used in WaterTransport model "NIED"
55 double BisFunc(const double X, const double P[]);
56 double Bisection(const double minval, const double maxval, double P[]);
57 void KHCalcNaga(const double RG, const double Dens, double ThR, const double WatCnt, const double SatuK, double &Rh, double &Rk);
58
59 void compTopFlux(double& ql, SnowStation& Xdata, SurfaceFluxes& Sdata);
60 void transportWater(const CurrentMeteo& Mdata, SnowStation& Xdata, SurfaceFluxes& Sdata, double& ql);
61
62 ReSolver1d RichardsEquationSolver1d_matrix;
63 ReSolver1d RichardsEquationSolver1d_pref;
64
65 std::string variant;
66
67 watertransportmodels iwatertransportmodel_snow, iwatertransportmodel_soil;
68
69 std::string watertransportmodel_snow;
70 std::string watertransportmodel_soil;
71 bool enable_pref_flow;
72 std::string pref_flow_rain_input_domain;
73
74 double sn_dt;
75 double hoar_thresh_rh, hoar_thresh_vw, hoar_thresh_ta;
76 double hoar_density_buried, hoar_density_surf, hoar_min_size_buried;
77 double minimum_l_element, comb_thresh_l;
78 bool useSoilLayers, water_layer, jam;
79
80 bool enable_vapour_transport;
81};
82#endif //End of WaterTransport.h
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:83
This module contains the solver for the 1d Richards Equation for the 1d snowpack model.
Definition: ReSolver1d.h:36
Definition: DataClasses.h:604
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733
This module contains water transport routines for the 1d snowpack model.
Definition: WaterTransport.h:39
WaterTransport(const SnowpackConfig &cfg)
Definition: WaterTransport.cc:86
void adjustDensity(SnowStation &Xdata)
Surface sublimation and melt artificially create surface elements that have a much too low density an...
Definition: WaterTransport.cc:709
virtual ~WaterTransport()
Definition: WaterTransport.h:43
watertransportmodels
Definition: WaterTransport.h:51
@ RICHARDSEQUATION
Definition: WaterTransport.h:51
@ NIED
Definition: WaterTransport.h:51
@ UNDEFINED
Definition: WaterTransport.h:51
@ BUCKET
Definition: WaterTransport.h:51
void compTransportMass(const CurrentMeteo &Mdata, SnowStation &Xdata, SurfaceFluxes &Sdata, double &ql)
The mass transport procedure is called from sn_Snowpack – AFTER calling the NEWSNOW (sn_SnowFall) or ...
Definition: WaterTransport.cc:1244
void mergingElements(SnowStation &Xdata, SurfaceFluxes &Sdata)
Merging snow elements .
Definition: WaterTransport.cc:503