SNOWPACK 20241221.26c8720
Laws_sn.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 LAWS_SN_H
26#define LAWS_SN_H
27
28#include <string>
29#include <meteoio/MeteoIO.h>
30
32#include <snowpack/snowpackCore/Snowpack.h> //some constants are necessary
33
34
35class SnLaws {
36
37 public:
39
40 enum EventType {
43 };
49 t_term_stk=999
50 };
58 visc_stk=999
59 };
61
62 static double conductivity_ice(const double& Temperature);
63 static double conductivity_water(const double& Temperature);
64 static double conductivity_air(void);
65
66
67 static double compWindPumpingDisplacement(const SnowStation& Xdata);
68 static double compWindPumpingVelocity(const CurrentMeteo& Mdata, const double& d_pump);
69 static double compWindGradientSnow(const ElementData& Edata, double& v_pump);
70
71 static double compSensibleHeatCoefficient(const CurrentMeteo& Mdata, const SnowStation& Xdata,
72 const double& height_of_meteo_values);
73 static double compLatentHeat_Rh(const std::string soil_evaporation, const CurrentMeteo& Mdata, SnowStation& Xdata,
74 const double& height_of_meteo_values);
75 static double compLatentHeat(const std::string soil_evaporation, const CurrentMeteo& Mdata, SnowStation& Xdata,
76 const double& height_of_meteo_values);
77
78 static double compSoilThermalConductivity(const ElementData& Edata, const double& dvdz,
79 const std::string& soil_thermal_conductivity);
80
81 static double soilVaporDiffusivity(const ElementData& Edata);
82 static double compEnhanceWaterVaporTransportSoil(const ElementData& Edata,const double& clay_fraction);
83 static double compSoilThermalVaporConductivity(const ElementData& Edata_bot, const ElementData& Edata_top, const double& Te_bot, const double& Te_top,const double& clay_fraction);
84 static double compSoilIsothermalVaporConductivity(const ElementData& Edata_bot, const ElementData& Edata_top, const double& Te_bot, const double& Te_top, const double& T_node);
85
86 static double compSnowThermalConductivity(const ElementData& Edata, const double& dvdz, const bool& show_warnings=true);
87
88 static double compEnhanceWaterVaporTransportSnow(const SnowStation& Xdata, const size_t& i_e);
89
90 static double compLWRadCoefficient(const double& t_snow, const double& t_atm, const double& e_atm);
91
92 static double parameterizedSnowAlbedo(const std::string& i_albedo, const std::string& i_albedo_parameterization, const std::string& i_albAverageSchmucki, const double& i_albNIED_av,
93 const double& i_hn_albedo_fixedValue, const ElementData& Edata, const double& Tss, const CurrentMeteo& Mdata, const bool& ageAlbedo=true);
94 static void compShortWaveAbsorption(const std::string& i_sw_absorption_scheme, SnowStation& Xdata, const double& I0);
95 static void compAdvectiveHeat(SnowStation& Xdata, const double& advective_heat,
96 const double& depth_begin, const double& depth_end);
97
98 static double compNewSnowDensity(const std::string& i_hn_density, const std::string& i_hn_density_parameterization, const double& i_hn_density_fixedValue,
99 const CurrentMeteo& Mdata, const SnowStation& Xdata, const double& tss,
100 const std::string& variant);
101
102 static double NewSnowViscosityLehning(const ElementData& Edata);
103 static double SnowViscosityMSU(const ElementData& Edata);
104
105 static double snowViscosityTemperatureTerm(const double& Te);
106 static double compLoadingRateStress(const std::string& variant, ElementData& Edata,
107 const mio::Date& date);
108 static double loadingRateStressDEFAULT(ElementData& Edata, const mio::Date& date);
109 static double loadingRateStressCALIBRATION(ElementData& Edata, const mio::Date& date);
110 static double snowViscosityFudgeDEFAULT(const ElementData& Edata);
111 static double snowViscosityFudgeCALIBRATION(const ElementData& Edata, const mio::Date& date);
112 static double compSnowViscosity(const std::string& variant, const std::string& i_viscosity_model, const std::string& i_watertransport_model,
113 ElementData& Edata, const mio::Date& date);
114 static double snowViscosityDEFAULT(ElementData& Edata);
115 static double snowViscosityKOJIMA(const ElementData& Edata);
116 static double snowViscosityCALIBRATION(ElementData& Edata, const mio::Date& date);
117 // minimum observed air emissivity: default=0.55 (from 1993 data at Weissfluhjoch) - Antarctica=0.31 (from 2006/2007 data of Dome C)
118 static double AirEmissivity(mio::MeteoData& md, const std::string& variant);
119 static double AirEmissivity(const double& ilwr, const double& ta, const std::string& variant, const bool& max_limit=true);
120 static double ArrheniusLaw(const double ActEnergy, const double T, const double T_ref);
121
125
126 static bool setStaticData(const std::string& variant, const std::string& watertransportmodel);
127
128 static double newSnowDensityPara(const std::string& i_hn_model,
129 double TA, double TSS, double RH, double VW, double HH);
130 static double newSnowDensityEvent(const std::string& variant, const SnLaws::EventType& i_event,
131 const CurrentMeteo& Mdata);
132 static double newSnowDensityHendrikx(const double ta, const double tss, const double rh, const double vw);
133 static double event_wind_highlim;
135
136 static double sn_dt; //Calculation time step in seconds as derived from CALCULATION_STEP_LENGTH
137 static const bool __init;
138 static std::string current_variant;
142 static bool setfix;
143 static size_t swa_nBands;
144 static std::vector<double> swa_k, swa_pc, swa_fb;
145 //static const soil_evap_model soil_evaporation;
149};
150
151#endif
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:83
ELEMENT DATA used as a pointer in the SnowStation structure NOTE on M below: this is the mass of an e...
Definition: DataClasses.h:285
Definition: Laws_sn.h:35
static const double alpha_por_tor
Ratio of porosity to tortuosity.
Definition: Laws_sn.h:148
static const bool wind_pump
Switch on or off wind pumping in snow.
Definition: Laws_sn.h:124
static double parameterizedSnowAlbedo(const std::string &i_albedo, const std::string &i_albedo_parameterization, const std::string &i_albAverageSchmucki, const double &i_albNIED_av, const double &i_hn_albedo_fixedValue, const ElementData &Edata, const double &Tss, const CurrentMeteo &Mdata, const bool &ageAlbedo=true)
Definition: Laws_sn.cc:294
static double max_hn_density
Definition: Laws_sn.h:122
static double visc_sp_fudge
Definition: Laws_sn.h:141
static double compWindPumpingDisplacement(const SnowStation &Xdata)
Computes the displacement depth in case of ventilation.
Definition: Laws_sn.cc:512
static double snowViscosityKOJIMA(const ElementData &Edata)
SNOW VISCOSITY according to formulation by Kojima.
Definition: Laws_sn.cc:1506
static double compSoilIsothermalVaporConductivity(const ElementData &Edata_bot, const ElementData &Edata_top, const double &Te_bot, const double &Te_top, const double &T_node)
Computes the soil ISOTHERMAL vapor hydraulic conductivity. The ISOTHERMAL vapor hydraulic conductivy ...
Definition: Laws_sn.cc:699
static std::string current_variant
Definition: Laws_sn.h:138
static const double displacement_coef
Integral of snow density corresponding to the maximal displacement depth d_pump (m)
Definition: Laws_sn.h:148
static double min_hn_density
Definition: Laws_sn.h:122
TempDependence
Defines temperature dependence of snow viscosity.
Definition: Laws_sn.h:45
@ t_term_stk
calibration 2009 by Walter Steinkogler (MSc thesis)
Definition: Laws_sn.h:49
@ t_term_arrhenius
pure Arrhenius type w/ excitation energy of ice
Definition: Laws_sn.h:47
@ t_term_arrhenius_critical
Arrhenius type multiplied by critical function near melting point.
Definition: Laws_sn.h:46
@ t_term_837
as of revision 837 (from r243)
Definition: Laws_sn.h:48
static double snowViscosityTemperatureTerm(const double &Te)
Computes the temperature term of viscosity The modifications for POLAR variant are described in: Steg...
Definition: Laws_sn.cc:1222
static const bool jordy_new_snow
To use J. Hendrikx's parameterization for wind speeds > 2.9 m s-1.
Definition: Laws_sn.h:124
static double conductivity_air(void)
static double compWindGradientSnow(const ElementData &Edata, double &v_pump)
Computes the wind gradient near the snow-cover surface.
Definition: Laws_sn.cc:548
static const double relsatmin
Minimum relative saturation of top soil layer.
Definition: Laws_sn.h:146
static const double montana_vapor_fudge
Factor controlling increase in water vapor transport and thus energy transport in wet snow.
Definition: Laws_sn.h:147
static double compNewSnowDensity(const std::string &i_hn_density, const std::string &i_hn_density_parameterization, const double &i_hn_density_fixedValue, const CurrentMeteo &Mdata, const SnowStation &Xdata, const double &tss, const std::string &variant)
Definition: Laws_sn.cc:1152
static double SnowViscosityMSU(const ElementData &Edata)
MONTANA snow viscosity (non-dendritic snow, i.e. if dd=0.); From bb_lw_VS_Montana() (Laws....
Definition: Laws_sn.cc:1646
static double snowViscosityDEFAULT(ElementData &Edata)
SNOW VISCOSITY (all types of snow)
Definition: Laws_sn.cc:1471
static double event_wind_lowlim
Definition: Laws_sn.h:122
static const double montana_c_fudge
Factor controlling ice to ice conduction.
Definition: Laws_sn.h:147
static const double alpha_por_tor_soil
Ratio of porosity to tortuosity for Soil.
Definition: Laws_sn.h:146
static double visc_water_fudge
Definition: Laws_sn.h:141
static double conductivity_water(const double &Temperature)
Definition: Laws_sn.cc:264
static double compLoadingRateStress(const std::string &variant, ElementData &Edata, const mio::Date &date)
Computes the additional stress due to loading rate.
Definition: Laws_sn.cc:1254
static bool setStaticData(const std::string &variant, const std::string &watertransportmodel)
This function is used to give default values to a bunch of static members of SnLaws it is called when...
Definition: Laws_sn.cc:179
static double compSnowViscosity(const std::string &variant, const std::string &i_viscosity_model, const std::string &i_watertransport_model, ElementData &Edata, const mio::Date &date)
Definition: Laws_sn.cc:1447
static bool setfix
Definition: Laws_sn.h:142
static std::vector< double > swa_fb
fudge_bohren
Definition: Laws_sn.h:144
static double compSoilThermalVaporConductivity(const ElementData &Edata_bot, const ElementData &Edata_top, const double &Te_bot, const double &Te_top, const double &clay_fraction)
Computes the soil THERMAL vapor hydraulic conductivity. Requires the use of RE to determine pressure ...
Definition: Laws_sn.cc:670
EventType
Types of events for computing new snow density.
Definition: Laws_sn.h:40
@ event_wind
Wind driven deposition of snow (Antarctica)
Definition: Laws_sn.h:42
@ event_none
Definition: Laws_sn.h:41
static double newSnowDensityHendrikx(const double ta, const double tss, const double rh, const double vw)
Jordy Hendrikx' new snow density parameterization for strong winds (> 2.9 m s-1)
Definition: Laws_sn.cc:1122
static ViscosityVersion visc
Definition: Laws_sn.h:140
static double loadingRateStressDEFAULT(ElementData &Edata, const mio::Date &date)
Definition: Laws_sn.cc:1262
static const bool wind_pump_soil
Switch on or off wind pumping in soil.
Definition: Laws_sn.h:124
static void compShortWaveAbsorption(const std::string &i_sw_absorption_scheme, SnowStation &Xdata, const double &I0)
Helen LeVesconte's Solution to short wave absorption by the snowpack NOTE on fudge_bohren (fb): Large...
Definition: Laws_sn.cc:435
static std::vector< double > swa_pc
fraction of sun power spectrum per band
Definition: Laws_sn.h:144
static double visc_ice_fudge
Definition: Laws_sn.h:141
static const bool __init
Definition: Laws_sn.h:137
static double conductivity_ice(const double &Temperature)
Definition: Laws_sn.cc:251
static double NewSnowViscosityLehning(const ElementData &Edata)
NEW SNOW VISCOSITY (dendritic snow, i.e., dd > 0.) Actual version : ml_lw_VS_Lehning from r7....
Definition: Laws_sn.cc:1196
static double snowViscosityFudgeCALIBRATION(const ElementData &Edata, const mio::Date &date)
To calibrate the fudge factor for viscosity.
Definition: Laws_sn.cc:1350
static const double pore_length_soil
Pore length for surface soil for ventilation (m)
Definition: Laws_sn.h:146
static double soilVaporDiffusivity(const ElementData &Edata)
Water vapor diffusion coefficient in soil. The formulation is based on Saito et al....
Definition: Laws_sn.cc:628
static double compSoilThermalConductivity(const ElementData &Edata, const double &dvdz, const std::string &soil_thermal_conductivity)
Heat conduction in soil. The formulation is based on curve fitting, the frozen soil data from Kersten...
Definition: Laws_sn.cc:569
static double compWindPumpingVelocity(const CurrentMeteo &Mdata, const double &d_pump)
Computes the wind pumping velocity at the surface.
Definition: Laws_sn.cc:536
static double snowViscosityFudgeDEFAULT(const ElementData &Edata)
Determines the fudge factor for viscosity This fudge factor takes into account bond-ice imperfection...
Definition: Laws_sn.cc:1322
static double snowViscosityCALIBRATION(ElementData &Edata, const mio::Date &date)
Calibrate snow viscosity NOTE This is the test or playground version for calibrating settling.
Definition: Laws_sn.cc:1519
static double newSnowDensityEvent(const std::string &variant, const SnLaws::EventType &i_event, const CurrentMeteo &Mdata)
Event driven new-snow density.
Definition: Laws_sn.cc:1003
static double compLWRadCoefficient(const double &t_snow, const double &t_atm, const double &e_atm)
LONGWAVE RADIATION COEFFICIENT This routine might look a bit unusual: Radiation is treated as a CONVE...
Definition: Laws_sn.cc:989
static double compEnhanceWaterVaporTransportSoil(const ElementData &Edata, const double &clay_fraction)
Computes the enhancement factor for water vapor transport in soil. Derived from Cass et al....
Definition: Laws_sn.cc:646
static double compLatentHeat(const std::string soil_evaporation, const CurrentMeteo &Mdata, SnowStation &Xdata, const double &height_of_meteo_values)
LATENT HEAT EXCHANGE (Surface Energy Exchange) David Gustafsson (davidg@kth.se) has introduced a resi...
Definition: Laws_sn.cc:954
static const double wind_ext_coef
Used to decribe advective flux attenuation.
Definition: Laws_sn.h:148
static std::vector< double > swa_k
mean extinction coefficient for pure ice per band
Definition: Laws_sn.h:144
static double ArrheniusLaw(const double ActEnergy, const double T, const double T_ref)
Computes an Arrhenius-type temperature dependency.
Definition: Laws_sn.cc:1570
static double compSnowThermalConductivity(const ElementData &Edata, const double &dvdz, const bool &show_warnings=true)
Heat conduction in snow Actual version: k = C1*[C2 + C3 + C4 + C5] Adams/Sato model....
Definition: Laws_sn.cc:762
static double sn_dt
Definition: Laws_sn.h:136
static const double smallest_viscosity
Defines the smallest allowable viscosity (Pa s) that a viscosity law will return Value is DAMM SMALL...
Definition: Laws_sn.h:123
static double compEnhanceWaterVaporTransportSnow(const SnowStation &Xdata, const size_t &i_e)
Computes the enhancement factor for water vapor transport in wet snow.
Definition: Laws_sn.cc:717
static const double rsoilmin
Minimum soil surface resistance, 50 sm-1 (van den Hurk et al, 2000)
Definition: Laws_sn.h:146
ViscosityVersion
Defines which snow viscosity version to use.
Definition: Laws_sn.h:52
@ visc_cal
version under test
Definition: Laws_sn.h:54
@ visc_stk
calibration 2009 by Walter Steinkogler (MSc thesis)
Definition: Laws_sn.h:58
@ visc_ant
if Antarctica needs adaptation of _new
Definition: Laws_sn.h:55
@ visc_dflt
actual version: revision 961, June 2011 by Fierz
Definition: Laws_sn.h:53
@ visc_897
calibration fall 2010 by Fierz
Definition: Laws_sn.h:56
@ visc_837
as of revision 837 (deprecated)
Definition: Laws_sn.h:57
static EventType event
Definition: Laws_sn.h:134
static double event_wind_highlim
Definition: Laws_sn.h:133
static double compLatentHeat_Rh(const std::string soil_evaporation, const CurrentMeteo &Mdata, SnowStation &Xdata, const double &height_of_meteo_values)
Latent heat flux including consideration of soil (one active element) This method uses the Relative H...
Definition: Laws_sn.cc:881
static double AirEmissivity(mio::MeteoData &md, const std::string &variant)
Compute the air emissivity It relies on mio::ILWR_parametrized to get a parametrized ILWR if no measu...
Definition: Laws_sn.cc:1589
static double loadingRateStressCALIBRATION(ElementData &Edata, const mio::Date &date)
Definition: Laws_sn.cc:1272
static TempDependence t_term
Definition: Laws_sn.h:139
static double compSensibleHeatCoefficient(const CurrentMeteo &Mdata, const SnowStation &Xdata, const double &height_of_meteo_values)
SENSIBLE HEAT EXCHANGE COEFFICIENT (Surface Energy Exchange)
Definition: Laws_sn.cc:853
static const double field_capacity_soil
Field capacity of the soil (1). Above this levels, water begins to drain.
Definition: Laws_sn.h:123
static const double montana_v_water_fudge
Defines the formerly used MONTANA fudge factor for old wet snow settling (up to snowpack_r8....
Definition: Laws_sn.h:147
static void compAdvectiveHeat(SnowStation &Xdata, const double &advective_heat, const double &depth_begin, const double &depth_end)
Advective Heat Flux injection (mimicking heat advection by infiltrating water?)
Definition: Laws_sn.cc:487
static size_t swa_nBands
Snow extinction coefficients for absorbtion of SW radiation (swa)
Definition: Laws_sn.h:143
static double newSnowDensityPara(const std::string &i_hn_model, double TA, double TSS, double RH, double VW, double HH)
Parameterized new-snow density.
Definition: Laws_sn.cc:1035
Definition: DataClasses.h:604