Converts ice specific enthalpy to-and-from temperature and water content. More...
#include <enthalpyConverter.hh>

Public Member Functions | |
| EnthalpyConverter (const NCConfigVariable &config) | |
| virtual | ~EnthalpyConverter () |
| virtual PetscErrorCode | viewConstants (PetscViewer viewer) const |
| Simple view of state of EnthalpyConverter. viewer==NULL sends to stdout. | |
| virtual double | getPressureFromDepth (double depth) const |
| Get pressure in ice from depth below surface using the hydrostatic assumption. | |
| virtual double | getMeltingTemp (double p) const |
| Get melting temperature from pressure p. | |
| virtual double | getEnthalpyCTS (double p) const |
| Get enthalpy E_s(p) at cold-temperate transition point, which normalizes enthalpy, from pressure p. | |
| virtual PetscErrorCode | getEnthalpyInterval (double p, double &E_s, double &E_l) const |
| Get enthalpies E_s(p) and E_l(p) (endpoints of temperate ice enthalpy range) from pressure p. | |
| virtual double | getCTS (double E, double p) const |
| Computes the ratio CTS = E / E_s(p). The cold-temperate transition surface (CTS) is the level surface CTS = 1. | |
| virtual bool | isTemperate (double E, double p) const |
| Determines if E >= E_s(p), that is, if the ice is at the pressure-melting point. | |
| virtual bool | isLiquified (double E, double p) const |
| Is ice at given enthalpy and pressure actually liquid water? | |
| virtual PetscErrorCode | getAbsTemp (double E, double p, double &T) const |
| Get absolute ice temperature (K) from enthalpy and pressure. | |
| virtual PetscErrorCode | getPATemp (double E, double p, double &T_pa) const |
| Get pressure-adjusted ice temperature (K) from enthalpy and pressure. | |
| virtual PetscErrorCode | getWaterFraction (double E, double p, double &omega) const |
| Get liquid water fraction from enthalpy and pressure. | |
| virtual double | getWaterFractionLimited (double E, double p) const |
| Get liquid water fraction from enthalpy and pressure, but return omega=1 if high enthalpy. | |
| virtual PetscErrorCode | getEnth (double T, double omega, double p, double &E) const |
| Compute enthalpy from absolute temperature, liquid water fraction, and pressure. | |
| virtual PetscErrorCode | getEnthPermissive (double T, double omega, double p, double &E) const |
| Compute enthalpy more permissively from temperature and water fraction. Compare getEnth(). | |
| virtual PetscErrorCode | getEnthAtWaterFraction (double omega, double p, double &E) const |
| Returns enthalpy for temperate ice with a given liquid fraction. | |
Protected Attributes | |
| double | T_0 |
| double | L |
| double | c_i |
| double | rho_i |
| double | g |
| double | p_air |
| double | beta |
Converts ice specific enthalpy to-and-from temperature and water content.
ONCE THIS CLASS IS CONFIRMED TO BE CORRECT, IT *CAN* GO IN src/base/pism_const.{hh|cc}
Use this way, for example within IceModel with NCConfigVariable config member:
#include "enthalpyConverter.hh" EnthalpyConverter EC(&config); // this runs constructor, so make sure this // is done after the creation/initialization of // NCConfigVariable config ... for (...) { ... E_s = EC.getEnthalpyCTS(p); ... etc ... }
Some methods are functions which return the computed values or a boolean. These do no error checking. Others return PetscErrorCode (and set arguments). These check either that the enthalpy is below that of liquid water, or that the temperature (in K) is positive.
Specifically, getAbsTemp() gives return value 1 if the input enthalpy exceeded that of liquid water, but puts the temperature of maximum-liquid-content temperate ice into its computed value for T. And getWaterFraction() gives return value of 1 under the same condition, but puts the maximum-liquid-content into its computed value for omega.
The three methods that get the enthalpy from temperatures and liquid fractions, namely getEnth, getEnthPermissive, getEnthAtWaterFraction, are more strict about error checking. They call SETERRQ() if there arguments are invalid.
Definition at line 57 of file enthalpyConverter.hh.
| EnthalpyConverter | ( | const NCConfigVariable & | config | ) |
Definition at line 24 of file enthalpyConverter.cc.
References beta, c_i, g, NCConfigVariable.get(), L, p_air, rho_i, and T_0.
| virtual ~EnthalpyConverter | ( | ) | [virtual] |
Definition at line 60 of file enthalpyConverter.hh.
Get absolute ice temperature (K) from enthalpy and pressure.
From AschwandenBlatter, equation (12)
But the first case simplifies if we expand
:
We do not allow liquid water (i.e. water fraction
) so we return a 1 as output PetscErrorCode if
.
Reimplemented in ICMEnthalpyConverter.
Definition at line 164 of file enthalpyConverter.cc.
References c_i, getEnthalpyInterval(), and getMeltingTemp().
Referenced by IceModel.basalSlidingHeatingSIA(), IceModel.compute_temp(), IceModel.computeEffectiveViscosity(), IceModel.correctSigma(), IceModel.energyStats(), IceModel.enthalpyAndDrainageStep(), getPATemp(), and IceModel.velocitySIAStaggered().
Computes the ratio CTS = E / E_s(p). The cold-temperate transition surface (CTS) is the level surface CTS = 1.
If
and
are the enthalpy and the CTS enthalpy, respectively, then
where CTS = 1 is the CTS contour line. Thus CTS is greater than one for temperate ice and less than one for cold ice. Presumably only used for postprocessing.
Definition at line 129 of file enthalpyConverter.cc.
References getEnthalpyCTS().
Referenced by IceModel.setCTSFromEnthalpy().
Compute enthalpy from absolute temperature, liquid water fraction, and pressure.
This is an inverse function to the functions
and
. It returns this enthalpy value:
Certain cases are not allowed and return errors:
is not allowed,
and
is not allowed,
or
is not allowed.Because of these not-allowed cases, the following expression is also valid:
Reimplemented in ICMEnthalpyConverter.
Definition at line 292 of file enthalpyConverter.cc.
References c_i, e, getEnthalpyCTS(), getMeltingTemp(), and L.
Referenced by getEnthPermissive().
Get enthalpy E_s(p) at cold-temperate transition point, which normalizes enthalpy, from pressure p.
Returns
In particular,
is the enthalpy for surface ice.
Note that
Pa at temperature
K, with standard choices
J kg-1 K-1 and
K Pa-1.
Definition at line 104 of file enthalpyConverter.cc.
References c_i, and getMeltingTemp().
Referenced by getCTS(), getEnth(), IceModel.getEnthalpyCTSColumn(), getEnthalpyInterval(), getEnthAtWaterFraction(), and isTemperate().
Get enthalpies E_s(p) and E_l(p) (endpoints of temperate ice enthalpy range) from pressure p.
Ice at enthalpy
is temperate if
:
Definition at line 114 of file enthalpyConverter.cc.
References getEnthalpyCTS(), and L.
Referenced by getAbsTemp(), getWaterFraction(), getWaterFractionLimited(), isLiquified(), and PolyThermalGPBLDIce.softnessParameterFromEnth().
Returns enthalpy for temperate ice with a given liquid fraction.
Computes
Definition at line 356 of file enthalpyConverter.cc.
References e, getEnthalpyCTS(), and L.
Referenced by IceModel.enthalpyAndDrainageStep().
Compute enthalpy more permissively from temperature and water fraction. Compare getEnth().
Computes enthalpy from absolute temperature, liquid water fraction, and pressure as before. Use this form of getEnth() when outside sources (e.g. information from a coupler) might generate a temperature above the pressure melting point or cold ice with a positive water fraction.
Treats temperatures above pressure-melting point as at the pressure-melting point. Interprets contradictory case of
and
as cold ice, ignoring water fraction
.
Computes:
but ensures
in second case. Calls getEnth() for
.
Checks that
and returns error if not.
Reimplemented in ICMEnthalpyConverter.
Definition at line 334 of file enthalpyConverter.cc.
References getEnth(), and getMeltingTemp().
Referenced by IceModel.check_maximum_thickness(), IceModel.enthalpyAndDrainageStep(), IceModel.putTempAtDepth(), IceModel.setEnth3FromT3_ColdIce(), and IceModel.setEnth3FromT3AndLiqfrac3().
Get melting temperature from pressure p.
Definition at line 88 of file enthalpyConverter.cc.
Referenced by IceModel.enthalpyAndDrainageStep(), getAbsTemp(), getEnth(), getEnthalpyCTS(), getEnthPermissive(), and getPATemp().
Get pressure-adjusted ice temperature (K) from enthalpy and pressure.
Calls getAbsTemp(), which computes
, and getMeltingTemp(), which computes
.
We define the pressure-adjusted temperature to be:
Definition at line 193 of file enthalpyConverter.cc.
References getAbsTemp(), getMeltingTemp(), and T_0.
Referenced by IceModel.compute_temp_pa(), and PolyThermalGPBLDIce.softnessParameterFromEnth().
Get pressure in ice from depth below surface using the hydrostatic assumption.
If
is the depth then
Frequently
is computed from the thickess minus a level in the ice, something like "H[i][j] - z[k]". The input depth to this routine is allowed to be negative, representing a position above the surface of the ice.
Definition at line 75 of file enthalpyConverter.cc.
References g, p_air, and rho_i.
Referenced by IceModel.basalSlidingHeatingSIA(), IceModel.check_maximum_thickness(), IceModel.compute_temp(), IceModel.compute_temp_pa(), IceModel.computeEffectiveViscosity(), IceModel.correctSigma(), PolyThermalGPBLDIce.effectiveViscosityColumnFromEnth(), IceModel.energyStats(), IceModel.enthalpyAndDrainageStep(), IceModel.getEnthalpyCTSColumn(), IceModel.putTempAtDepth(), IceModel.setCTSFromEnthalpy(), IceModel.setEnth3FromT3_ColdIce(), IceModel.setEnth3FromT3AndLiqfrac3(), and IceModel.setLiquidFracFromEnthalpy().
Get liquid water fraction from enthalpy and pressure.
From AschwandenBlatter, equation (12),
We do not allow liquid water (i.e. water fraction
) so we fail if
.
Definition at line 214 of file enthalpyConverter.cc.
References getEnthalpyInterval(), and L.
Referenced by IceModel.setLiquidFracFromEnthalpy(), and PolyThermalGPBLDIce.softnessParameterFromEnth().
Get liquid water fraction from enthalpy and pressure, but return omega=1 if high enthalpy.
Same as getWaterFraction(), except if E > E_l(p) still succeeds and returns omega=1.
Useful in allowing the computation of (appropriately) high basal melt rates.
Definition at line 240 of file enthalpyConverter.cc.
References getEnthalpyInterval(), and L.
Referenced by IceModel.enthalpyAndDrainageStep().
Is ice at given enthalpy and pressure actually liquid water?
Definition at line 259 of file enthalpyConverter.cc.
References getEnthalpyInterval().
Referenced by IceModel.enthalpyAndDrainageStep().
Determines if E >= E_s(p), that is, if the ice is at the pressure-melting point.
Definition at line 141 of file enthalpyConverter.cc.
References getEnthalpyCTS().
Referenced by IceModel.energyStats().
| PetscErrorCode viewConstants | ( | PetscViewer | viewer | ) | const [virtual] |
Simple view of state of EnthalpyConverter. viewer==NULL sends to stdout.
Definition at line 36 of file enthalpyConverter.cc.
References beta, c_i, g, L, p_air, rho_i, and T_0.
Referenced by IceModel.enthalpyAndDrainageStep().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getMeltingTemp(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), ICMEnthalpyConverter.getAbsTemp(), getAbsTemp(), ICMEnthalpyConverter.getEnth(), getEnth(), getEnthalpyCTS(), ICMEnthalpyConverter.getEnthPermissive(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getPressureFromDepth(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getEnth(), getEnthalpyInterval(), getEnthAtWaterFraction(), getWaterFraction(), getWaterFractionLimited(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getPressureFromDepth(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getPressureFromDepth(), and viewConstants().
Definition at line 84 of file enthalpyConverter.hh.
Referenced by EnthalpyConverter(), getMeltingTemp(), getPATemp(), and viewConstants().
1.6.2-20100124