zoomy_core.symsolver.strategies.chorin#
The Chorin projection solver, written once for every backend: a hyperbolic predictor,
a pressure solve and a correction, from the three systems of the model’s pressure
split (pred, press, corr). time_order 2 / 3 wraps stages in SSP-RK2 /
RK3 and imex=Imex.ssp2 uses IMEX-SSP2(2,2,2) with projected stages.
Module Contents#
Classes#
What a projection stage solves for: the pressure, or its increment over a lagged one. |
|
The projection solver of a pressure split |
Functions#
Solve |
|
Overwrite the rows of |
|
The predictor NSM of a pressure split on the full state ( |
API#
- class zoomy_core.symsolver.strategies.chorin.Projection#
Bases:
zoomy_core.misc.options.OptionWhat a projection stage solves for: the pressure, or its increment over a lagged one.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- standard#
‘standard’
- increment#
‘increment’
- class zoomy_core.symsolver.strategies.chorin.ChorinTemplate(pred, press, corr, *, cfl, time_order=1, pressure_newton=None, projection=Projection.standard, **config)#
Bases:
zoomy_core.symsolver.strategies.hyperbolic.HyperbolicTemplateThe projection solver of a pressure split
pred/press/corr, withnsmthe predictorpred;stepis the projection step andmarch,dtandinitial_auxare inherited fromHyperbolicTemplate.References
Chorin 1968, https://doi.org/10.1090/S0025-5718-1968-0242392-2
Almgren, Bell, Crutchfield 2000, https://doi.org/10.1137/S1064827599357024
Initialization
Set the split and the configuration of
HyperbolicTemplate;cflis divided by2 order - 1.Args
pressure_newton:(tol, maxit)for a nonlinear pressure constraint solved by Newton, elseNone.projection: aProjection.
- step(Q, Qaux, p, time, dt, mesh, *, dt_rule=None)#
One time step: the outer SSP-RK over projection stages; with
imex=Imex.ssp2every stage solves the implicit source and is then projected.Args
dt_rule: the first stage picksdt.
Returns
(Q, Qaux, dt).
- abstract precice_march(*args, **kwargs)#
Not supported: raises
NotImplementedError.
- stage(Q, Qaux, p, time, dt, mesh, dt_rule=None)#
One projection stage: predictor, pressure solve, correction; returns
(Q, dt).Args
dt_rule:dtis chosen only by the predictor’s flux, so the stage keeps the aux it is given.
- project(Q, p, time, dt, mesh, lag=None)#
The pressure solve and the correction of
Q.Args
lag:None: solve for the pressure. Else the lagged pressureP^n: correct with it, solvepresson that state fordP(the corrector is linear in the pressure) and correctQwithP^n + dP.
- predictor(Q, Qaux, p, time, dt, mesh, dt_rule=None)#
Euler flux step, then the implicit slots as Lie sub-steps (implicit with
imex, else explicit Euler); returns(Q, dt).
- zoomy_core.symsolver.strategies.chorin.pressure(press, Q, p, time, dt, mesh, newton=None)#
Solve
pressfor its own rows with the rest ofQfrozen: one linear solve (GMRES) of the affine residualA(P) = R(P) - R(0), or Newton from the current pressure withnewton=(tol, maxit).References
Saad, Schultz 1986, https://doi.org/10.1137/0907058
Knoll, Keyes 2004, https://doi.org/10.1016/j.jcp.2003.08.010
- zoomy_core.symsolver.strategies.chorin.correct(corr, Q, p, time, dt, mesh)#
Overwrite the rows of
corrby its update formula (the correction by the solved pressure).
- zoomy_core.symsolver.strategies.chorin.predictor_nsm(pred, press, corr, reconstruction=None)#
The predictor NSM of a pressure split on the full state (
pad_to_square): positive Rusanov, the hydrostatic rescaling on every row buth,band the pressure rows,pressandcorrsizing the LSQ stencil;reconstructionaReconstructionSpec(default order 1). Pass it withpress,corrto a symbolic Chorin solver’ssetup.