Closed glwagner closed 1 year ago
This sounds great. What do you think of having advectied_field
instead of advected_quantity
?
This sounds great. What do you think of having
advectied_field
instead ofadvected_quantity
?
That makes sense!
@simone-silvestri if we want to unify the user interface across all models, we could introduce the type AdvectionScheme
(which will be rather trivial now, but we can update it in the future). Then we can have syntax like
advection = AdvectionScheme(momentum=WENO5(grid), tracers=UpwindBiasedThirdOrder())
model = NonhydrostaticModel(; grid, advection)
Or,
model = NonhydrostaticModel(; grid, advection=WENO5())
which the model constructor interprets as
advection = AdvectionScheme(momentum=WENO5(grid), tracers=WENO5(grid))
(this is nice too, because we can build WENO5
on the grid under the hood)
We could also always "regularize" the advection scheme with grid
, so that
advection = AdvectionScheme(momentum=WENO5(), tracers=UpwindBiasedThirdOrder())
model = NonhydrostaticModel(; grid, advection)
translates to
advection = AdvectionScheme(momentum=WENO5(grid), tracers=UpwindBiasedThirdOrder())
under the hood.
I'm also open to other names than AdvectionScheme
... that's just what's written above and seems reasonably interpretable.
The name seems very clear and I like how this is structured.
Done
We need to overhaul the way we specify advection schemes, whose current limitations were exposed when "WENO vector invariant" was implemented. I propose that we implement a hierarchical specification system using a new object called
AdvectionScheme
that specifiesVectorInvariant
orFluxForm
for momentum, alwaysFluxForm
for tracers)FluxForm
, the reconstruction scheme for the advected componentVectorInvariant
, the stencil for computing vorticity, as well as the method for reconstructing vorticity at the momentum locationsVectorInvariant
with WENO reconstruction, the type of the smoothness stencil (vorticity or velocity)We also may want to specify how we reconstruction advecting velocities for flux form momentum advection (right now we use centered advection with an accuracy one order lower than the accuracy of the advected component reconstruction --- ie with
UpwindBiasedFifthOrder()
we reconstruct advecting components with a centered fourth order scheme).Finally, we need to allow different schemes for every tracer.
This modular design will allow more detailed specification of an advection scheme and also us to remove the option for WENO reconstruction for vector invariant more easily, which @simone-silvestri pointed out is experimental.
We also would like to explore alternative discretization for the continuity equation. For this we need a "mass" reconstruction scheme, and the advecting scheme for tracers needs to reconstruct
advected_velocity
in a way that's consistent with the mass reconstruction.Here's a sketch of what these new types might look like: