PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
GPBLD.cc
Go to the documentation of this file.
1 /* Copyright (C) 2015, 2016, 2017, 2018, 2023 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 
20 #include "pism/rheology/GPBLD.hh"
21 #include "pism/util/ConfigInterface.hh"
22 
23 namespace pism {
24 namespace rheology {
25 
26 /*!
27  This constructor just sets flow law factor for nonzero water content, from
28  \ref AschwandenBlatter and \ref LliboutryDuval1985.
29 */
30 GPBLD::GPBLD(const std::string &prefix,
31  const Config &config, EnthalpyConverter::Ptr ec)
32  : FlowLaw(prefix, config, ec) {
33  m_name = "Glen-Paterson-Budd-Lliboutry-Duval";
34 
35  m_T_0 = config.get_number("constants.fresh_water.melting_point_temperature"); // K
36  m_water_frac_coeff = config.get_number("flow_law.gpbld.water_frac_coeff");
37 
38  m_water_frac_observed_limit = config.get_number("flow_law.gpbld.water_frac_observed_limit");
39 }
40 
41 //! The softness factor in the Glen-Paterson-Budd-Lliboutry-Duval flow law. For constitutive law form.
42 /*!
43  This is a modification of Glen-Paterson-Budd ice, which is PatersonBudd. In particular, if
44  \f$A()\f$ is the softness factor for PatersonBudd, if \f$E\f$ is the enthalpy, and \f$p\f$ is
45  the pressure then the softness we compute is
46  \f[A = A(T_{pa}(E, p))(1+184\omega).\f]
47  The pressure-melting temperature \f$T_{pa}(E, p)\f$ is computed by pressure_adjusted_temperature().
48 */
49 double GPBLD::softness_impl(double enthalpy, double pressure) const {
50  const double E_s = m_EC->enthalpy_cts(pressure);
51  if (enthalpy < E_s) { // cold ice
52  double T_pa = m_EC->pressure_adjusted_temperature(enthalpy, pressure);
53  return softness_paterson_budd(T_pa);
54  } else { // temperate ice
55  double omega = m_EC->water_fraction(enthalpy, pressure);
56  // as stated in \ref AschwandenBuelerBlatter, cap omega at max of observations:
57  omega = std::min(omega, m_water_frac_observed_limit);
58  // next line implements eqn (23) in \ref AschwandenBlatter2009
59  return softness_paterson_budd(m_T_0) * (1.0 + m_water_frac_coeff * omega);
60  }
61 }
62 
63 void GPBLD::flow_n_impl(const double *stress, const double *enthalpy,
64  const double *pressure, const double *grainsize,
65  unsigned int n, double *result) const {
66  // optimize the common case of Glen n=3
67  if (m_n == 3.0) {
68  for (unsigned int k = 0; k < n; ++k) {
69  result[k] = this->softness(enthalpy[k], pressure[k]) * (stress[k] * stress[k]);
70  }
71 
72  return;
73  }
74 
75  for (unsigned int k = 0; k < n; ++k) {
76  result[k] = this->flow(stress[k], enthalpy[k], pressure[k], grainsize[k]);
77  }
78 }
79 
80 } // end of namespace rheology
81 } // end of namespace pism
double get_number(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
A class for storing and accessing PISM configuration flags and parameters.
std::shared_ptr< EnthalpyConverter > Ptr
double softness_paterson_budd(double T_pa) const
Return the softness parameter A(T) for a given temperature T.
Definition: FlowLaw.cc:80
std::string m_name
Definition: FlowLaw.hh:117
double softness(double E, double p) const
Definition: FlowLaw.cc:113
double flow(double stress, double enthalpy, double pressure, double grain_size) const
The flow law itself.
Definition: FlowLaw.cc:88
double m_n
power law exponent
Definition: FlowLaw.hh:154
EnthalpyConverter::Ptr m_EC
Definition: FlowLaw.hh:126
double m_water_frac_observed_limit
Definition: GPBLD.hh:41
double softness_impl(double enthalpy, double pressure) const
The softness factor in the Glen-Paterson-Budd-Lliboutry-Duval flow law. For constitutive law form.
Definition: GPBLD.cc:49
void flow_n_impl(const double *stress, const double *enthalpy, const double *pressure, const double *grainsize, unsigned int n, double *result) const
Definition: GPBLD.cc:63
double m_water_frac_coeff
Definition: GPBLD.hh:41
GPBLD(const std::string &prefix, const Config &config, EnthalpyConverter::Ptr EC)
Definition: GPBLD.cc:30
#define n
Definition: exactTestM.c:37
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
Definition: Scalar.cc:193
static const double k
Definition: exactTestP.cc:42