Globalization Delegates#
Globalization is the art of convincing a solver to find the solution. Remember – physics typically cares very little about how you get to a solution, only that you get there. If you can guess or otherwise find the solution physically, without doing fancy math, go for it! These delegates are handy utility classes which are used by MPCs to effeciently leverage physics understanding in the mathematical solvers to nudge the solver in the direction of a reasonable solution, or to keep a solver from going off into a part of space which is totally unphysical. These can often make the difference between converging and not converging.
Much of the efficiency of ATS comes from these delegates, and more of them are always welcome contributions.
Coupled Water Globalization Delegate#
src/physics/ats/src/pks/mpc/mpc_delegate_water_decl.hh
The water delegate works to deal with discontinuities and strong nonlinearities when surface cells shift from dry to wet (i.e. the surface pressure goes from < atmospheric pressure to > atmospheric pressure.
These methods work to alter the predictor around this nonlinearity.
mpc-delegate-water-spec
“modify predictor with heuristic”
[bool]
false This simply limits the prediction to backtrack to just above atmospheric on both the first and second timesteps that take us over atmospheric.“modify predictor damp and cap the water spurt”
[bool]
false The second both limits (caps) and damps all surface cells to ensure that all nearby cells are also not overshooting. This is the preferred method.
These methods work to alter the preconditioned correction for the same reasons described above.
“global water face limiter”
[double]
1.e99 This is simply a limit to the maximum allowed size of the correction (in [Pa]) on all faces. Any correction larger than this is set to this.“cap the water spurt”
[bool]
false If a correction takes the pressure on a surface cell from below atmospheric (dry) to above (wet), the correction is set to a value which results in the new iterate to being CAP_SIZE over atmospheric.“damp the water spurt”
[bool]
false A damping factor (less than one) is calculated to multiply the correction such that the largest correction takes a cell to just above atmospheric. All faces (globally) are affected.“damp and cap the water spurt”
[bool]
false None of the above should really be used. Capping, when the cap is particularly severe, results in faces whose values are very out of equilibrium with their neighboring cells which are not capped. Damping results in a tiny timestep in which, globally, at MOST one face can go from wet to dry. This looks to do a combination, in which all things are damped, but faces that are initially expected to go from dry to wet are pre-scaled to ensure that, when damped, they are also (like the biggest change) allowed to go from dry to wet (so that multiple cells can wet in the same step). This is the preferred method.
In these methods, the following parameters are useful:
“cap over atmospheric”
[double]
100 This sets the max size over atmospheric to which things are capped or damped. [Pa]
EWC Globalization Delegate#
src/physics/ats/src/pks/mpc/mpc_delegate_ewc.hh
The EWC delegate works to deal with strong nonlinearities associated with latent heat and phase change. Provided a change in primary variables pressure and temperature, it works by first multiplying those changes by the local Jacobian matrix, \(\frac{\partial \left\{ \Theta, E \right\} }{ \partial \left\{ p, T \right\} }\) to calculate changes in water content and energy, then calculating the new water content and energy and inverting the functions \(\Theta(p,T), E(p,T)\) to determine what pressure and temperature would have resulted in those values. This provides a corrected change in the primary variables.
Conceptually, this is a “more robust” choice in nonlinearities associated with phase change, where the derivatives go from small to large to small again, and small changes in pressure and temperature result in large changes in water content and energy.
This delegate manages these globalization strategies, which can be used both in modifying the correction supplied by a nonlinear iterate, and in modifying a predictor, the extrapolated projection (from previous timesteps) that provides the initial guess to the nonlinear solve.
mpc-delegate-ewc-spec
“verbose object”
[verbose-object-spec]
See Verbose Object.“PK name”
[string]
optional Name of the owning PK – simply for logging and debugging. Typically set by the owning PK, not by the user.“domain name”
[string]
“domain” The mesh.“preconditioner type”
[string]
When to use EWC on the nonlinear iterate’s correction. One of:“none” Never do EWC
“ewc” Always do EWC
“smart ewc” Attempt EWC when it seems likely it will be useful and take the EWC correction if it is smaller than the standard correction.
“predictor type”
[string]
When to use EWC on the predictor. One of:“none” Never do EWC
“ewc” Always do EWC
“smart ewc” Attempt EWC when it seems likely it will be useful and take the EWC correction if it is smaller than the standard correction.
“freeze-thaw cusp width [K]”
[double]
optional Controls a width over which to assume we are close to the latent heat cliff, and begins applying the EWC algorithm in “ewc smarter”. Note that this overrides the following two parameters with this value.“freeze-thaw cusp width (freezing) [K]”
[double]
0. Controls a width over which to assume we are close to the latent heat cliff as we get colder, and begins applying the EWC algorithm in “ewc smarter”.“freeze-thaw cusp width (thawing) [K]”
[double]
0. Controls a width over which to assume we are close to the latent heat cliff as we get warmer, and begins applying the EWC algorithm in “ewc smarter”.
KEYS
“pressure”
“temperature”
“water content”
“energy”
“cell volume”
INCLUDES
[debugger-spec]
Uses a Debugger