PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
PatersonBudd.cc
Go to the documentation of this file.
1 /* Copyright (C) 2015, 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/PatersonBudd.hh"
21 #include <cmath> // for pow
22 #include <memory> // for __shared_ptr_access
23 
24 namespace pism {
25 namespace rheology {
26 
27 // PatersonBudd
28 
29 PatersonBudd::PatersonBudd(const std::string &prefix,
30  const Config &config,
32  : FlowLaw(prefix, config, ec) {
33  m_name = "Paterson-Budd";
34 }
35 
36 /*! Converts enthalpy to temperature and uses the Paterson-Budd formula. */
37 double PatersonBudd::softness_impl(double E, double pressure) const {
38  double T_pa = m_EC->pressure_adjusted_temperature(E, pressure);
39  return softness_from_temp(T_pa);
40 }
41 
42 /*! Converts enthalpy to temperature and calls flow_from_temp. */
43 double PatersonBudd::flow_impl(double stress, double E,
44  double pressure, double gs) const {
45  double temp = m_EC->temperature(E, pressure);
46  return flow_from_temp(stress, temp, pressure, gs);
47 }
48 
49 //! The flow law (temperature-dependent version).
50 double PatersonBudd::flow_from_temp(double stress, double temp,
51  double pressure, double /*gs*/) const {
52  // pressure-adjusted temperature:
53  const double T_pa = temp + (m_beta_CC_grad / (m_rho * m_standard_gravity)) * pressure;
54  return softness_from_temp(T_pa) * pow(stress, m_n-1);
55 }
56 
57 double PatersonBudd::softness_from_temp(double T_pa) const {
58  return softness_paterson_budd(T_pa);
59 }
60 
61 double PatersonBudd::hardness_from_temp(double T_pa) const {
62  return pow(softness_from_temp(T_pa), m_hardness_power);
63 }
64 
65 } // end of namespace rheology
66 } // end of namespace pism
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
double m_standard_gravity
acceleration due to gravity
Definition: FlowLaw.hh:150
std::string m_name
Definition: FlowLaw.hh:117
double m_rho
ice density
Definition: FlowLaw.hh:120
double m_hardness_power
; used to compute hardness
Definition: FlowLaw.hh:136
double m_beta_CC_grad
Clausius-Clapeyron gradient.
Definition: FlowLaw.hh:122
double m_n
power law exponent
Definition: FlowLaw.hh:154
EnthalpyConverter::Ptr m_EC
Definition: FlowLaw.hh:126
virtual double flow_from_temp(double stress, double temp, double pressure, double gs) const
The flow law (temperature-dependent version).
Definition: PatersonBudd.cc:50
virtual double hardness_from_temp(double T_pa) const
Definition: PatersonBudd.cc:61
virtual double softness_from_temp(double T_pa) const
Definition: PatersonBudd.cc:57
virtual double flow_impl(double stress, double E, double pressure, double gs) const
Definition: PatersonBudd.cc:43
virtual double softness_impl(double enthalpy, double pressure) const
Definition: PatersonBudd.cc:37
PatersonBudd(const std::string &prefix, const Config &config, EnthalpyConverter::Ptr EC)
Definition: PatersonBudd.cc:29