PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pism::EnthalpyConverter Class Reference

Converts between specific enthalpy and temperature or liquid content. More...

#include <EnthalpyConverter.hh>

+ Inheritance diagram for pism::EnthalpyConverter:

Public Types

typedef std::shared_ptr< EnthalpyConverterPtr
 

Public Member Functions

 EnthalpyConverter (const Config &config)
 
virtual ~EnthalpyConverter ()=default
 
bool is_temperate (double E, double P) const
 
bool is_temperate_relaxed (double E, double P) const
 A relaxed version of is_temperate(). More...
 
double temperature (double E, double P) const
 Get absolute (not pressure-adjusted) ice temperature (K) from enthalpy and pressure. More...
 
double melting_temperature (double P) const
 Get melting temperature from pressure p. More...
 
double pressure_adjusted_temperature (double E, double P) const
 Get pressure-adjusted ice temperature, in Kelvin, from enthalpy and pressure. More...
 
double water_fraction (double E, double P) const
 Get liquid water fraction from enthalpy and pressure. More...
 
double enthalpy (double T, double omega, double P) const
 Compute enthalpy from absolute temperature, liquid water fraction, and pressure. More...
 
double enthalpy_cts (double P) const
 Get enthalpy E_s(p) at cold-temperate transition point from pressure p. More...
 
double enthalpy_liquid (double P) const
 Compute the maximum allowed value of ice enthalpy (corresponds to \( \omega = 1 \)). More...
 
double enthalpy_permissive (double T, double omega, double P) const
 Compute enthalpy more permissively than enthalpy(). More...
 
double c () const
 Specific heat capacity of ice. More...
 
double L (double T_pm) const
 
double pressure (double depth) const
 Get pressure in ice from depth below surface using the hydrostatic assumption. More...
 
void pressure (const std::vector< double > &depth, unsigned int ks, std::vector< double > &result) const
 Compute pressure in a column of ice. Does not check validity of depth. More...
 

Protected Member Functions

void validate_E_P (double E, double P) const
 
void validate_T_omega_P (double T, double omega, double P) const
 
double temperature_cold (double E) const
 Convert enthalpy into temperature (cold case). More...
 
double enthalpy_cold (double T) const
 Convert temperature into enthalpy (cold case). More...
 

Protected Attributes

double m_T_melting
 melting temperature of pure water at atmospheric pressure More...
 
double m_L
 latent heat of fusion of water at atmospheric pressure More...
 
double m_c_i
 specific heat capacity of ice More...
 
double m_c_w
 specific heat capacity of pure water More...
 
double m_rho_i
 density of ice More...
 
double m_g
 acceleration due to gravity More...
 
double m_p_air
 atmospheric pressure More...
 
double m_beta
 beta in the Clausius-Clapeyron relation ( \( \diff{T_m}{p} = - \beta \)). More...
 
double m_T_tolerance
 temperature tolerance used in is_temperate() in cold ice mode More...
 
double m_T_0
 reference temperature in the definition of ice enthalpy More...
 
bool m_do_cold_ice_methods
 if cold ice methods are selected, use is_temperate() check based on temperature, not enthalpy More...
 

Detailed Description

Converts between specific enthalpy and temperature or liquid content.

Use this way, for example within IceModel with Config config member:

#include "enthalpyConverter.hh"
EnthalpyConverter EC(&config); // runs constructor; do after initialization of Config config
...
for (...) {
...
E_s = EC.enthalpy_cts(p);
... etc ...
}
EnthalpyConverter(const Config &config)

The three methods that get the enthalpy from temperatures and liquid fractions, namely enthalpy(), enthalpy_permissive() are more strict about error checking. They throw RuntimeError if their arguments are invalid.

This class is documented by [AschwandenBuelerKhroulevBlatter].

Maps from \( (H,p) \) to \( (T,\omega,p) \) and back.

Requirements:

  1. A converter has to implement an invertible map \( (H,p) \to (T, \omega, p) \) and its inverse. Both the forward map and the inverse need to be defined for all permissible values of \( (H,p) \) and \( (T, \omega, p) \), respectively.
  2. A converter has to be consistent with laws and parameterizations used elsewhere in the model. This includes models coupled to PISM.
  3. For a fixed volume of liquid (or solid) water and given two energy states \( (H_1, p_1) \) and \( (H_2, p_2) \) , let \( \Delta U_H \) be the difference in internal energy of this volume between the two states computed using enthalpy. We require that \( \Delta U_T = \Delta U_H \) , where \( \Delta U_T \) is the difference in internal energy computed using corresponding \( (T_1, \omega_1, p_1) \) and \( (T_2, \omega_2, p_2) \).
  4. We assume that ice and water are incompressible, so a change in pressure does no work, and \( \Diff{H}{p} = 0 \). In addition to this, for cold ice and liquid water \( \Diff{T}{p} = 0 \).

Definition at line 51 of file EnthalpyConverter.hh.


The documentation for this class was generated from the following files: