Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Routing.hh
Go to the documentation of this file.
1// Copyright (C) 2012-2019, 2021, 2022 PISM Authors
2//
3// This file is part of PISM.
4//
5// PISM is free software; you can redistribute it and/or modify it under the
6// terms of the GNU General Public License as published by the Free Software
7// Foundation; either version 3 of the License, or (at your option) any later
8// version.
9//
10// PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13// details.
14//
15// You should have received a copy of the GNU General Public License
16// along with PISM; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19#ifndef _ROUTING_H_
20#define _ROUTING_H_
21
22#include "pism/hydrology/Hydrology.hh"
23#include "pism/util/array/Staggered.hh"
24
25namespace pism {
26
27namespace hydrology {
28
29//! \brief A subglacial hydrology model which assumes water pressure
30//! equals overburden pressure.
31/*!
32 This PISM hydrology model has lateral motion of subglacial water and which
33 conserves the water mass. Further documentation is in [\ref BuelervanPeltDRAFT].
34
35 The water velocity is along the steepest descent route for the hydraulic
36 potential. This potential is (mostly) a function of ice sheet geometry,
37 because the water pressure is set to the overburden pressure, a simplified but
38 well-established model [\ref Shreve1972]. However, the water layer thickness
39 is also a part of the hydraulic potential because it is actually the potential
40 of the *top* of the water layer.
41
42 This (essential) model has been used for finding locations of subglacial lakes
43 [\ref Siegertetal2007, \ref Livingstoneetal2013]. Subglacial lakes occur
44 at local minima of the hydraulic potential. If water builds up significantly
45 (e.g. thickness of 10s of meters or more) then in the model here the resulting
46 lakes diffuse instead of becoming infinitely deep. Thus we avoid delta
47 functions of water thickness at the minima of the hydraulic potential in this
48 well-posed model.
49
50 This model should generally be tested using static ice geometry first.
51
52 The state space includes both the till water effective thickness \f$W_{till}\f$,
53 which is in Hydrology, and the transportable water layer thickness \f$W\f$.
54
55 For more complete modeling where the water pressure is determined by a
56 physical model for the opening and closing of cavities, and where the state
57 space includes a nontrivial pressure variable, see hydrology::Distributed.
58
59 There is an option `-hydrology_null_strip` `X` which produces a strip of
60 `X` km around the edge of the computational domain. In that strip the water flow
61 velocity is set to zero. The water amount is also reset to zero at the end
62 of each time step in this strip (in an accounted way).
63
64 As noted this is the minimal model which has a lateral water flux. This flux is
65 \f[ \mathbf{q} = - K \nabla \psi = \mathbf{V} W - D \nabla W \f]
66 where \f$\psi\f$ is the hydraulic potential
67 \f[ \psi = P + \rho_w g (b + W). \f]
68 The generalized conductivity \f$K\f$ is nontrivial and it generally also
69 depends on the water thickness:
70 \f[ K = k W^{\alpha-1} |\nabla (P+\rho_w g b)|^{\beta-2}. \f]
71
72 This model contains enough information (enough modeled fields) so that we can compute
73 the wall melt generated by dissipating the gravitational potential energy in the moving,
74 presumably turbulent, subglacial water. If we suppose that this heat is dissipated
75 immediately as melt on the cavity/conduit walls then we get a formula for a wall melt
76 contribution. (This is in addition to the `basal_melt_rate_grounded` field coming from
77 conserving energy in the flowing ice.) See wall_melt(). At this time the wall melt is
78 diagnostic only and does not add to the water amount W; such an addition is generally
79 unstable.
80*/
81class Routing : public Hydrology {
82public:
83
84 Routing(std::shared_ptr<const Grid> g);
85 virtual ~Routing() = default;
86
89
90protected:
91 virtual void restart_impl(const File &input_file, int record);
92
93 virtual void bootstrap_impl(const File &input_file,
94 const array::Scalar &ice_thickness);
95
96 virtual void init_impl(const array::Scalar &W_till,
97 const array::Scalar &W,
98 const array::Scalar &P);
99
100 virtual void update_impl(double t, double dt, const Inputs& inputs);
101
102 virtual std::map<std::string, Diagnostic::Ptr> diagnostics_impl() const;
103 virtual std::map<std::string, TSDiagnostic::Ptr> ts_diagnostics_impl() const;
104
105 virtual void define_model_state_impl(const File &output) const;
106 virtual void write_model_state_impl(const File &output) const;
107
108 double max_timestep_W_diff(double KW_max) const;
109 double max_timestep_W_cfl() const;
110protected:
111
112 // edge-centered (staggered) advection flux
114
116
117 // edge-centered (staggered) water velocity
119
120 // edge-centered (staggered) W values (averaged from regular)
122
123 // edge-centered (staggered) values of nonlinear conductivity
125
126 // work space
128
129 // ghosted temporary storage; modified in compute_conductivity and compute_velocity
131
132 double m_dx, m_dy;
133 double m_rg;
134
136
138 const array::CellType1 &mask,
139 array::Staggered &result);
140
142 const array::Scalar &P,
143 const array::Scalar &bed,
144 array::Staggered &result,
145 double &maxKW) const;
146
148 const array::Scalar &P,
149 const array::Scalar &bed,
150 const array::Staggered &K,
151 const array::Scalar1 *no_model_mask,
152 array::Staggered &result) const;
153
155 const array::Scalar &W,
156 array::Staggered &result) const;
157
158 void W_change_due_to_flow(double dt,
159 const array::Scalar1 &W,
160 const array::Staggered1 &Wstag,
161 const array::Staggered1 &K,
162 const array::Staggered1 &Q,
163 array::Scalar &result);
164 void update_W(double dt,
166 const array::Scalar &basal_melt_rate,
167 const array::Scalar1 &W,
168 const array::Staggered1 &Wstag,
169 const array::Scalar &Wtill,
170 const array::Scalar &Wtill_new,
171 const array::Staggered1 &K,
172 const array::Staggered1 &Q,
173 array::Scalar &W_new);
174
175 void update_Wtill(double dt,
176 const array::Scalar &Wtill,
178 const array::Scalar &basal_melt_rate,
179 array::Scalar &Wtill_new);
180
181private:
182 virtual void initialization_message() const;
183};
184
185void wall_melt(const Routing &model,
186 const array::Scalar &bed_elevation,
187 array::Scalar &result);
188
189} // end of namespace hydrology
190} // end of namespace pism
191
192#endif /* _ROUTING_H_ */
High-level PISM I/O class.
Definition File.hh:55
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition Staggered.hh:37
const array::Scalar & surface_input_rate() const
Definition Hydrology.cc:518
The PISM subglacial hydrology model interface.
Definition Hydrology.hh:109
virtual void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P)
Definition Routing.cc:345
array::Staggered1 m_Qstag_average
Definition Routing.hh:115
array::Scalar1 m_R
Definition Routing.hh:130
virtual void initialization_message() const
Definition Routing.cc:316
array::Staggered m_Vstag
Definition Routing.hh:118
virtual std::map< std::string, Diagnostic::Ptr > diagnostics_impl() const
Definition Routing.cc:972
const array::Scalar & subglacial_water_pressure() const
Definition Routing.cc:365
array::Staggered1 m_Wstag
Definition Routing.hh:121
double max_timestep_W_diff(double KW_max) const
Definition Routing.cc:690
virtual void bootstrap_impl(const File &input_file, const array::Scalar &ice_thickness)
Definition Routing.cc:335
double max_timestep_W_cfl() const
Definition Routing.cc:699
void compute_conductivity(const array::Staggered &W, const array::Scalar &P, const array::Scalar &bed, array::Staggered &result, double &maxKW) const
Compute the nonlinear conductivity at the center of cell edges.
Definition Routing.cc:436
virtual ~Routing()=default
array::Staggered1 m_Kstag
Definition Routing.hh:124
void advective_fluxes(const array::Staggered &V, const array::Scalar &W, array::Staggered &result) const
Compute Q = V W at edge-centers (staggered grid) by first-order upwinding.
Definition Routing.cc:670
void W_change_due_to_flow(double dt, const array::Scalar1 &W, const array::Staggered1 &Wstag, const array::Staggered1 &K, const array::Staggered1 &Q, array::Scalar &result)
Definition Routing.cc:759
void update_W(double dt, const array::Scalar &surface_input_rate, const array::Scalar &basal_melt_rate, const array::Scalar1 &W, const array::Staggered1 &Wstag, const array::Scalar &Wtill, const array::Scalar &Wtill_new, const array::Staggered1 &K, const array::Staggered1 &Q, array::Scalar &W_new)
The computation of Wnew, called by update().
Definition Routing.cc:796
virtual void update_impl(double t, double dt, const Inputs &inputs)
Update the model state variables W and Wtill by applying the subglacial hydrology model equations.
Definition Routing.cc:835
void water_thickness_staggered(const array::Scalar &W, const array::CellType1 &mask, array::Staggered &result)
Average the regular grid water thickness to values at the center of cell edges.
Definition Routing.cc:377
void compute_velocity(const array::Staggered &W, const array::Scalar &P, const array::Scalar &bed, const array::Staggered &K, const array::Scalar1 *no_model_mask, array::Staggered &result) const
Get the advection velocity V at the center of cell edges.
Definition Routing.cc:611
const array::Staggered & velocity_staggered() const
Definition Routing.cc:369
array::Staggered1 m_Qstag
Definition Routing.hh:113
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition Routing.cc:353
void update_Wtill(double dt, const array::Scalar &Wtill, const array::Scalar &surface_input_rate, const array::Scalar &basal_melt_rate, array::Scalar &Wtill_new)
The computation of Wtillnew, called by update().
Definition Routing.cc:730
array::Scalar m_Wtillnew
Definition Routing.hh:127
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition Routing.cc:358
virtual std::map< std::string, TSDiagnostic::Ptr > ts_diagnostics_impl() const
Definition Routing.cc:986
array::Scalar m_Wnew
Definition Routing.hh:127
virtual void restart_impl(const File &input_file, int record)
Definition Routing.cc:327
array::Scalar1 m_bottom_surface
Definition Routing.hh:135
A subglacial hydrology model which assumes water pressure equals overburden pressure.
Definition Routing.hh:81
static double K(double psi_x, double psi_y, double speed, double epsilon)
void wall_melt(const Routing &model, const array::Scalar &bed_elevation, array::Scalar &result)
Compute the wall melt rate which comes from (turbulent) dissipation of flow energy.
Definition Routing.cc:527
static const double g
Definition exactTestP.cc:36