SNOWPACK 20240717.43bd1bf
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 static double calculateMeltingTemperature(const double& Sal);
56
57 const static double SeaWaterFreezingTemp;
58 const static double SeaIceDensity;
59 const static double ice_threshold;
60 const static double mu;
61 const static double betaS;
62 const static double ThicknessFirstIceLayer;
63 const static double InitRg;
64 const static double InitRb;
65 const static double OceanSalinity;
66 const static double InitSeaIceSalinity;
67 const static double InitSnowSalinity;
68
69 double SeaLevel;
71 double FreeBoard;
72 double IceSurface;
75
76 double BottomSalFlux, TopSalFlux; //Bottom and top salt flux
77
81
82 friend std::iostream& operator<<(std::iostream& os, const SeaIce& data);
83 friend std::iostream& operator>>(std::iostream& is, SeaIce& data);
84
87 void updateFreeboard(SnowStation& Xdata);
88 double findIceSurface(SnowStation& Xdata);
89 void compFlooding(SnowStation& Xdata, SurfaceFluxes& Sdata);
90 void bottomIceFormation(SnowStation& Xdata, const CurrentMeteo& Mdata, const double& sn_dt, SurfaceFluxes& Sdata);
91 void ApplyBottomIceMassBalance(SnowStation& Xdata, const CurrentMeteo& Mdata, double dM, SurfaceFluxes& Sdata);
92
93 double getAvgBulkSalinity(const SnowStation& Xdata);
94 double getAvgBrineSalinity(const SnowStation& Xdata);
95 double getTotSalinity(const SnowStation& Xdata);
96
97 void InitSeaIce(SnowStation& Xdata);
98
99 void runSeaIceModule(SnowStation& Xdata, const CurrentMeteo& Mdata, BoundCond& Bdata, const double& sn_dt, SurfaceFluxes& Sdata);
100
101}; //end class Snowpack
102
103#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:74
constexpr SeaIce(const SeaIce &org)=default
double ForcedSeaLevel
Force sea level externally (Alpine3D)
Definition: SeaIce.h:70
void ConfigSeaIce(const SnowpackConfig &i_cfg)
Definition: SeaIce.cc:84
double IceSurface
Interface sea ice/snow (m)
Definition: SeaIce.h:72
double findIceSurface(SnowStation &Xdata)
Find snow/ice transition for sea ice simulations .
Definition: SeaIce.cc:264
static const double InitSeaIceSalinity
Definition: SeaIce.h:66
static double compSeaIceThermalConductivity(const ElementData &Edata)
Heat conduction in sea ice, for the combined system ICE + WATER (brine)
Definition: SeaIce.cc:369
static const double InitRb
Definition: SeaIce.h:64
static double compSeaIceHeatCapacity(const double &T, const double &Sal)
Heat capacity of sea ice, for the combined system ICE + WATER (brine).
Definition: SeaIce.cc:353
bool check_initial_conditions
Definition: SeaIce.h:78
static const double ice_threshold
Definition: SeaIce.h:59
SeaIce()
Definition: SeaIce.cc:67
static const double SeaWaterFreezingTemp
Definition: SeaIce.h:57
~SeaIce()
Definition: SeaIce.cc:82
void InitSeaIce(SnowStation &Xdata)
Initializes a SnowStation object for appropriate sea ice conditions First, water and ice content is ...
Definition: SeaIce.cc:688
void ApplyBottomIceMassBalance(SnowStation &Xdata, const CurrentMeteo &Mdata, double dM, SurfaceFluxes &Sdata)
Apply mass gain/loss at the bottom (dM)
Definition: SeaIce.cc:462
static const double InitRg
Definition: SeaIce.h:63
double getAvgBrineSalinity(const SnowStation &Xdata)
Returns the average brine salinity (g / kg)
Definition: SeaIce.cc:653
double BottomSalFlux
Definition: SeaIce.h:76
static double calculateMeltingTemperature(const double &Sal)
Calculate melting temperature as function of brine salinity.
Definition: SeaIce.cc:338
static const double betaS
Definition: SeaIce.h:61
friend std::iostream & operator<<(std::iostream &os, const SeaIce &data)
Definition: SeaIce.cc:110
void bottomIceFormation(SnowStation &Xdata, const CurrentMeteo &Mdata, const double &sn_dt, SurfaceFluxes &Sdata)
Calculate ice formation and decay at the bottom.
Definition: SeaIce.cc:420
static const double ThicknessFirstIceLayer
Definition: SeaIce.h:62
friend std::iostream & operator>>(std::iostream &is, SeaIce &data)
Definition: SeaIce.cc:119
double SeaLevel
Sea level in domain (m)
Definition: SeaIce.h:69
static const double mu
Definition: SeaIce.h:60
void compFlooding(SnowStation &Xdata, SurfaceFluxes &Sdata)
Apply flooding .
Definition: SeaIce.cc:299
salinityprofiles
Definition: SeaIce.h:79
@ LINEARSAL
Definition: SeaIce.h:79
@ LINEARSAL2
Definition: SeaIce.h:79
@ CONSTANT
Definition: SeaIce.h:79
@ NONE
Definition: SeaIce.h:79
@ SINUSSAL
Definition: SeaIce.h:79
@ COXANDWEEKS
Definition: SeaIce.h:79
void compSalinityProfile(SnowStation &Xdata)
Determines the salinity and associated melting temperature.
Definition: SeaIce.cc:132
SeaIce & operator=(const SeaIce &)
Assignement operator.
Definition: SeaIce.cc:70
double TopSalFlux
Definition: SeaIce.h:76
static const double InitSnowSalinity
Definition: SeaIce.h:67
static const double SeaIceDensity
Definition: SeaIce.h:58
double getAvgBulkSalinity(const SnowStation &Xdata)
Returns the average bulk salinity (g / kg)
Definition: SeaIce.cc:636
salinityprofiles salinityprofile
Definition: SeaIce.h:80
static const double OceanSalinity
Definition: SeaIce.h:65
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:740
double getTotSalinity(const SnowStation &Xdata)
Returns the total salinity (g / m^2)
Definition: SeaIce.cc:670
static double compSeaIceLatentHeatFusion(const ElementData &Edata)
Latent heat of melting for sea ice, for the combined system ICE + WATER (brine)
Definition: SeaIce.cc:402
double FreeBoard
Freeboard of sea ice (m)
Definition: SeaIce.h:71
size_t IceSurfaceNode
Interface node sea ice/snow (m)
Definition: SeaIce.h:73
void updateFreeboard(SnowStation &Xdata)
Updates the freeboard variable (i.e., sea level with respect to ice surface) positive: sea level bel...
Definition: SeaIce.cc:250
Definition: DataClasses.h:604
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733