Skip to content

Commit

Permalink
Merge branch 'main' into small_1D_vec_recovery_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tommbendall committed Jul 25, 2023
2 parents f8ec742 + cb0c056 commit 8dac6c9
Show file tree
Hide file tree
Showing 57 changed files with 1,343 additions and 612 deletions.
3 changes: 2 additions & 1 deletion examples/compressible/dcmip_3_1_meanflow_quads.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho", subcycles=2),
SSPRK3(domain, "theta", options=SUPGOptions(), subcycles=2)]
transport_methods = [DGUpwind(eqns, field) for field in ["u", "rho", "theta"]]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields, transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
3 changes: 3 additions & 0 deletions examples/compressible/dry_bryan_fritsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@
SSPRK3(domain, "theta", options=theta_opts),
SSPRK3(domain, "u", options=u_opts)]

transport_methods = [DGUpwind(eqns, field) for field in ["u", "rho", "theta"]]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
3 changes: 3 additions & 0 deletions examples/compressible/moist_bryan_fritsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
SSPRK3(domain, "cloud_water", options=EmbeddedDGOptions()),
ImplicitMidpoint(domain, "u")]

transport_methods = [DGUpwind(eqns, field) for field in ["u", "rho", "theta", "water_vapour", "cloud_water"]]

# Linear solver
linear_solver = CompressibleSolver(eqns)

Expand All @@ -72,6 +74,7 @@

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver,
physics_schemes=physics_schemes)

Expand Down
4 changes: 4 additions & 0 deletions examples/compressible/mountain_hydrostatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]
transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta", ibp=theta_opts.ibp)]

# Linear solver
params = {'mat_type': 'matfree',
Expand All @@ -100,6 +103,7 @@

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver,
alpha=alpha)

Expand Down
4 changes: 4 additions & 0 deletions examples/compressible/mountain_nonhydrostatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]
transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta", ibp=theta_opts.ibp)]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
12 changes: 8 additions & 4 deletions examples/compressible/robert_bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,20 @@

# Transport schemes
theta_opts = EmbeddedDGOptions()
transported_fields = []
transported_fields.append(ImplicitMidpoint(domain, "u"))
transported_fields.append(SSPRK3(domain, "rho"))
transported_fields.append(SSPRK3(domain, "theta", options=theta_opts))
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]

transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta")]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
13 changes: 9 additions & 4 deletions examples/compressible/skamarock_klemp_hydrostatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,21 @@
io = IO(domain, output, diagnostic_fields=diagnostic_fields)

# Transport schemes
transported_fields = []
transported_fields.append(ImplicitMidpoint(domain, "u"))
transported_fields.append(SSPRK3(domain, "rho"))
transported_fields.append(SSPRK3(domain, "theta", options=SUPGOptions()))
theta_opts = SUPGOptions()
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]

transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta", ibp=theta_opts.ibp)]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
4 changes: 4 additions & 0 deletions examples/compressible/skamarock_klemp_nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]
transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta", ibp=theta_opts.ibp)]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
12 changes: 9 additions & 3 deletions examples/compressible/straka_bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@

# Equation
parameters = CompressibleParameters()
diffusion_options = [
("u", DiffusionParameters(kappa=75., mu=10./delta)),
("theta", DiffusionParameters(kappa=75., mu=10./delta))]
u_diffusion_opts = DiffusionParameters(kappa=75., mu=10./delta)
theta_diffusion_opts = DiffusionParameters(kappa=75., mu=10./delta)
diffusion_options = [("u", u_diffusion_opts), ("theta", theta_diffusion_opts)]
eqns = CompressibleEulerEquations(domain, parameters,
diffusion_options=diffusion_options)

Expand All @@ -65,16 +65,22 @@
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "rho"),
SSPRK3(domain, "theta", options=theta_opts)]
transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "rho"),
DGUpwind(eqns, "theta", ibp=theta_opts.ibp)]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Diffusion schemes
diffusion_schemes = [BackwardEuler(domain, "u"),
BackwardEuler(domain, "theta")]
diffusion_methods = [InteriorPenaltyDiffusion(eqns, "u", u_diffusion_opts),
InteriorPenaltyDiffusion(eqns, "theta", theta_diffusion_opts)]

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
spatial_methods=transport_methods+diffusion_methods,
linear_solver=linear_solver,
diffusion_schemes=diffusion_schemes)

Expand Down
6 changes: 5 additions & 1 deletion examples/compressible/unsaturated_bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,22 @@
SSPRK3(domain, "cloud_water", options=theta_opts, limiter=limiter),
SSPRK3(domain, "rain", options=theta_opts, limiter=limiter)]

transport_methods = [DGUpwind(eqns, field) for field in ["u", "rho", "theta", "water_vapour", "cloud_water", "rain"]]

# Linear solver
linear_solver = CompressibleSolver(eqns)

# Physics schemes
# NB: to use wrapper options with Fallout, need to pass field name to time discretisation
physics_schemes = [(Fallout(eqns, 'rain', domain), SSPRK3(domain, field_name='rain', options=theta_opts, limiter=limiter)),
rainfall_method = DGUpwind(eqns, 'rain', outflow=True)
physics_schemes = [(Fallout(eqns, 'rain', domain, rainfall_method), SSPRK3(domain, field_name='rain', options=theta_opts, limiter=limiter)),
(Coalescence(eqns), ForwardEuler(domain)),
(EvaporationOfRain(eqns), ForwardEuler(domain)),
(SaturationAdjustment(eqns), ForwardEuler(domain))]

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver,
physics_schemes=physics_schemes)

Expand Down
2 changes: 2 additions & 0 deletions examples/incompressible/skamarock_klemp_incompressible.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@
b_opts = SUPGOptions()
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "b", options=b_opts)]
transport_methods = [DGUpwind(eqns, "u"), DGUpwind(eqns, "b", ibp=b_opts.ibp)]

# Linear solver
linear_solver = IncompressibleSolver(eqns)

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields,
transport_methods,
linear_solver=linear_solver)

# ---------------------------------------------------------------------------- #
Expand Down
3 changes: 2 additions & 1 deletion examples/shallow_water/linear_williamson_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@

# Transport schemes
transport_schemes = [ForwardEuler(domain, "D")]
transport_methods = [DGUpwind(eqns, "D")]

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transport_schemes)
stepper = SemiImplicitQuasiNewton(eqns, io, transport_schemes, transport_methods)

# ---------------------------------------------------------------------------- #
# Initial conditions
Expand Down
5 changes: 4 additions & 1 deletion examples/shallow_water/thermal_williamson2.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
ShallowWaterPotentialEnstrophy(),
SteadyStateError('u'), SteadyStateError('D')]
io = IO(domain, output, diagnostic_fields=diagnostic_fields)
transport_methods = [DGUpwind(eqns, "u"),
DGUpwind(eqns, "D"),
DGUpwind(eqns, "b")]

# Time stepper
stepper = Timestepper(eqns, RK4(domain), io)
stepper = Timestepper(eqns, RK4(domain), io, spatial_methods=transport_methods)

# ----------------------------------------------------------------- #
# Initial conditions
Expand Down
3 changes: 2 additions & 1 deletion examples/shallow_water/williamson_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
# Transport schemes
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "D", subcycles=2)]
transport_methods = [DGUpwind(eqns, "u"), DGUpwind(eqns, "D")]

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields)
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields, transport_methods)

# ------------------------------------------------------------------------ #
# Initial conditions
Expand Down
3 changes: 2 additions & 1 deletion examples/shallow_water/williamson_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@
# Transport schemes
transported_fields = [ImplicitMidpoint(domain, "u"),
SSPRK3(domain, "D")]
transport_methods = [DGUpwind(eqns, "u"), DGUpwind(eqns, "D")]

# Time stepper
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields)
stepper = SemiImplicitQuasiNewton(eqns, io, transported_fields, transport_methods)

# ------------------------------------------------------------------------ #
# Initial conditions
Expand Down
7 changes: 5 additions & 2 deletions gusto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from gusto.active_tracers import * # noqa
from gusto.common_forms import * # noqa
from gusto.configuration import * # noqa
from gusto.domain import * # noqa
from gusto.diagnostics import * # noqa
from gusto.diffusion import * # noqa
from gusto.diffusion_methods import * # noqa
from gusto.equations import * # noqa
from gusto.fml import * # noqa
from gusto.forcing import * # noqa
Expand All @@ -15,6 +16,8 @@
from gusto.physics import * # noqa
from gusto.preconditioners import * # noqa
from gusto.recovery import * # noqa
from gusto.spatial_methods import * # noqa
from gusto.time_discretisation import * # noqa
from gusto.timeloop import * # noqa
from gusto.transport_forms import * # noqa
from gusto.transport_methods import * # noqa
from gusto.wrappers import * # noqa
Loading

0 comments on commit 8dac6c9

Please sign in to comment.