SNOWPACK 20241007.306a770
SeaIce.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*/
26#ifndef SEAICE_H
27#define SEAICE_H
28
30
31#include <meteoio/MeteoIO.h>
32#include <vector>
33#include <string>
34
35// Forward-declare classes
36class ElementData;
37class SnowStation;
38class CurrentMeteo;
39class BoundCond;
40class SurfaceFluxes;
41
42class SeaIce {
43 public:
44 SeaIce();
45 ~SeaIce();
46 void ConfigSeaIce(const SnowpackConfig& i_cfg);
47 SeaIce& operator=(const SeaIce&);
48 constexpr SeaIce(const SeaIce& org) = default;
49
50 //SeaIce(const SnowpackConfig& i_cfg);
51 static double compSeaIceHeatCapacity(const double& T, const double& Sal);
52 static double compSeaIceThermalConductivity(const ElementData& Edata);
53 static double compSeaIceLatentHeatFusion(const ElementData& Edata);
54 static double compSeaIceLatentHeatFusion(const double& T, const double& Sal);
55 double calculateBrineSalinity(const double& T);
56 double calculateMeltingTemperature(const double& Sal);
57
58 const static double SeaWaterFreezingTemp;
59 const static double SeaIceDensity;
60 const static double ice_threshold;
61 const static double mu;
62 const static double betaS;
63 const static double ThicknessFirstIceLayer;
64 const static double InitRg;
65 const static double InitRb;
66 const static double OceanSalinity;
67 const static double InitSeaIceSalinity;
68 const static double InitSnowSalinity;
69
70 double SeaLevel;
72 double FreeBoard;
73 double IceSurface;
76
77 double BottomSalFlux, TopSalFlux; //Bottom and top salt flux
78
84
85
86 friend std::iostream& operator<<(std::iostream& os, const SeaIce& data);
87 friend std::iostream& operator>>(std::iostream& is, SeaIce& data);
88
90 std::pair<double, double>getMu(const double& Sal);
92 void updateFreeboard(SnowStation& Xdata);
93 double findIceSurface(SnowStation& Xdata);
94 void compFlooding(SnowStation& Xdata, SurfaceFluxes& Sdata);
95 void bottomIceFormation(SnowStation& Xdata, const CurrentMeteo& Mdata, const double& sn_dt, SurfaceFluxes& Sdata);
96 void ApplyBottomIceMassBalance(SnowStation& Xdata, const CurrentMeteo& Mdata, double dM, SurfaceFluxes& Sdata);
97
98 double getAvgBulkSalinity(const SnowStation& Xdata);
99 double getAvgBrineSalinity(const SnowStation& Xdata);
100 double getTotSalinity(const SnowStation& Xdata);
101
102 void InitSeaIce(SnowStation& Xdata);
103
104 void runSeaIceModule(SnowStation& Xdata, const CurrentMeteo& Mdata, BoundCond& Bdata, const double& sn_dt, SurfaceFluxes& Sdata);
105
106}; //end class Snowpack
107
108#endif
BoundCond is used to set Neumann boundary conditions.
Definition: DataClasses.h:713
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: SeaIce.h:42
double OceanHeatFlux
Ocean heat flux (W/m^2)
Definition: SeaIce.h:75
constexpr SeaIce(const SeaIce &org)=default
double ForcedSeaLevel
Force sea level externally (Alpine3D)
Definition: SeaIce.h:71
void ConfigSeaIce(const SnowpackConfig &i_cfg)
Definition: SeaIce.cc:85
double IceSurface
Interface sea ice/snow (m)
Definition: SeaIce.h:73
double findIceSurface(SnowStation &Xdata)
Find snow/ice transition for sea ice simulations .
Definition: SeaIce.cc:283
static const double InitSeaIceSalinity
Definition: SeaIce.h:67
thermalmodels thermalmodel
Definition: SeaIce.h:83
static double compSeaIceThermalConductivity(const ElementData &Edata)
Heat conduction in sea ice, for the combined system ICE + WATER (brine)
Definition: SeaIce.cc:492
static const double InitRb
Definition: SeaIce.h:65
static double compSeaIceHeatCapacity(const double &T, const double &Sal)
Heat capacity of sea ice, for the combined system ICE + WATER (brine).
Definition: SeaIce.cc:476
bool check_initial_conditions
Definition: SeaIce.h:79
static const double ice_threshold
Definition: SeaIce.h:60
SeaIce()
Definition: SeaIce.cc:68
std::pair< double, double > getMu(const double &Sal)
Returns the tangent line to the salinity-melting point curve General tangent line equation: T = mu0 +...
Definition: SeaIce.cc:442
static const double SeaWaterFreezingTemp
Definition: SeaIce.h:58
~SeaIce()
Definition: SeaIce.cc:83
void InitSeaIce(SnowStation &Xdata)
Initializes a SnowStation object for appropriate sea ice conditions First, water and ice content is ...
Definition: SeaIce.cc:812
void ApplyBottomIceMassBalance(SnowStation &Xdata, const CurrentMeteo &Mdata, double dM, SurfaceFluxes &Sdata)
Apply mass gain/loss at the bottom (dM)
Definition: SeaIce.cc:585
static const double InitRg
Definition: SeaIce.h:64
double getAvgBrineSalinity(const SnowStation &Xdata)
Returns the average brine salinity (g / kg)
Definition: SeaIce.cc:776
double BottomSalFlux
Definition: SeaIce.h:77
double calculateMeltingTemperature(const double &Sal)
Calculate melting temperature as function of brine salinity.
Definition: SeaIce.cc:390
static const double betaS
Definition: SeaIce.h:62
friend std::iostream & operator<<(std::iostream &os, const SeaIce &data)
Definition: SeaIce.cc:129
void bottomIceFormation(SnowStation &Xdata, const CurrentMeteo &Mdata, const double &sn_dt, SurfaceFluxes &Sdata)
Calculate ice formation and decay at the bottom.
Definition: SeaIce.cc:543
static const double ThicknessFirstIceLayer
Definition: SeaIce.h:63
friend std::iostream & operator>>(std::iostream &is, SeaIce &data)
Definition: SeaIce.cc:138
double SeaLevel
Sea level in domain (m)
Definition: SeaIce.h:70
static const double mu
Definition: SeaIce.h:61
void compFlooding(SnowStation &Xdata, SurfaceFluxes &Sdata)
Apply flooding .
Definition: SeaIce.cc:318
salinityprofiles
Definition: SeaIce.h:80
@ LINEARSAL
Definition: SeaIce.h:80
@ LINEARSAL2
Definition: SeaIce.h:80
@ CONSTANT
Definition: SeaIce.h:80
@ NONE
Definition: SeaIce.h:80
@ SINUSSAL
Definition: SeaIce.h:80
@ COXANDWEEKS
Definition: SeaIce.h:80
thermalmodels
Definition: SeaIce.h:82
@ VANCOPPENOLLE2019_M
Definition: SeaIce.h:82
@ VANCOPPENOLLE2019
Definition: SeaIce.h:82
@ ASSUR1958
Definition: SeaIce.h:82
@ IGNORE
Definition: SeaIce.h:82
void compSalinityProfile(SnowStation &Xdata)
Determines the salinity and associated melting temperature.
Definition: SeaIce.cc:151
SeaIce & operator=(const SeaIce &)
Assignement operator.
Definition: SeaIce.cc:71
double TopSalFlux
Definition: SeaIce.h:77
double calculateBrineSalinity(const double &T)
Calculate brine salinity as a function of temperature.
Definition: SeaIce.cc:357
static const double InitSnowSalinity
Definition: SeaIce.h:68
static const double SeaIceDensity
Definition: SeaIce.h:59
double getAvgBulkSalinity(const SnowStation &Xdata)
Returns the average bulk salinity (g / kg)
Definition: SeaIce.cc:759
salinityprofiles salinityprofile
Definition: SeaIce.h:81
static const double OceanSalinity
Definition: SeaIce.h:66
void runSeaIceModule(SnowStation &Xdata, const CurrentMeteo &Mdata, BoundCond &Bdata, const double &sn_dt, SurfaceFluxes &Sdata)
The sea ice module This function runs the sea ice module of SNOWPACK. .
Definition: SeaIce.cc:878
double getTotSalinity(const SnowStation &Xdata)
Returns the total salinity (g / m^2)
Definition: SeaIce.cc:793
static double compSeaIceLatentHeatFusion(const ElementData &Edata)
Latent heat of melting for sea ice, for the combined system ICE + WATER (brine)
Definition: SeaIce.cc:525
double FreeBoard
Freeboard of sea ice (m)
Definition: SeaIce.h:72
size_t IceSurfaceNode
Interface node sea ice/snow (m)
Definition: SeaIce.h:74
void updateFreeboard(SnowStation &Xdata)
Updates the freeboard variable (i.e., sea level with respect to ice surface) positive: sea level bel...
Definition: SeaIce.cc:269
Definition: DataClasses.h:604
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733