Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ for human readability.
## Changes in the v0.1 lifecycle

#### Added
- The `CompressibleEulerMoistPotentialTemperatureEquations3D` are the compressible Euler
equations with gravity with the virtual potential temperature as prognostic variable and
the moisture variables of a microphysics scheme, whose right-hand sides are given by
`source_terms_microphysics`. The `KesslerMicrophysics` is the warm-rain Kessler
microphysics of DCMIP2016 with water vapor, cloud water, and falling rain water.
The equations store the geopotential and the upward unit vector,
which gives the direction of the falling water,
as auxiliary variables of Trixi.jl, e.g., given by `aux_field_gravity_earth`.
Their volume flux `flux_kennedy_gruber_souza_etal` supports `FluxTurbo` with the
`KesslerMicrophysics`.
The moist baroclinic wave of DCMIP2016 is available as
`initial_condition_moist_baroclinic_instability` ([#271]).
- `JacobianVerticalTwoSided` enables horizontally explicit, vertically implicit (HEVI) time
integration of the `CompressibleEulerPotentialTemperatureEquationsWithGravity3D` on a
`P4estMeshCubedSphereTopography` as linear operator of linearly implicit methods, i.e.,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Currently available features include:

* Compressible Euler and shallow water models on cubed sphere meshes, discretizing the
atmosphere or its two-dimensional surface
* Moist compressible Euler equations, including rain microphysics
* Moist compressible Euler equations, including cloud and rain microphysics
* Flux-differencing formulations, including entropy-stable schemes

## Installation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# The moist baroclinic wave of DCMIP2016 (test case 161) with the Kessler warm-rain
# microphysics.
#
# References:
# - Paul A. Ullrich, Thomas Melvin, Christiane Jablonowski, Andrew Staniforth (2013)
# A proposed baroclinic wave test case for deep- and shallow-atmosphere dynamical cores
# https://doi.org/10.1002/qj.2241
# - Paul A. Ullrich et al. (2016)
# Dynamical Core Model Intercomparison Project (DCMIP2016) test case document
# https://doi.org/10.5281/zenodo.1298671

using OrdinaryDiffEqSSPRK
using Trixi, TrixiAtmo

equations = CompressibleEulerMoistPotentialTemperatureEquations3D(c_p = 1004.5,
Comment thread
amrueda marked this conversation as resolved.
Resolved
c_v = 717.5,
gravity = EARTH_GRAVITATIONAL_ACCELERATION,
microphysics = KesslerMicrophysics())

initial_condition = initial_condition_moist_baroclinic_instability

# Microphysics and Coriolis force of the rotating Earth
@inline function source_terms_microphysics_coriolis(u, aux, x, t,
equations::CompressibleEulerMoistPotentialTemperatureEquations3D)
return (source_terms_microphysics(u, aux, x, t, equations) +
source_terms_coriolis(u, aux, x, t, equations))
end

boundary_conditions = (; inside = boundary_condition_slip_wall,
outside = boundary_condition_slip_wall)

polydeg = 4
surface_flux = flux_lmars_combined
# `FluxTurbo` selects a SIMD-vectorized implementation of the flux differencing volume
# integral, which is equivalent to `volume_flux = flux_kennedy_gruber_souza_etal`.
volume_flux = FluxTurbo(flux_kennedy_gruber_souza_etal)

solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
trees_per_cube_face = (8, 4)
mesh = P4estMeshCubedSphereTopography(trees_per_cube_face..., EARTH_RADIUS, 30000,
polydeg = polydeg, initial_refinement_level = 0)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
source_terms = source_terms_microphysics_coriolis,
boundary_conditions = boundary_conditions,
aux_field = aux_field_gravity_earth)

###############################################################################
# ODE solvers, callbacks etc.
T = 10 # 10 days
tspan = (0.0, T * SECONDS_PER_DAY) # time in seconds for 10 days

# Setting `real_type` allows to change the real number type, e.g., to `Float32`.
# This is particularly useful when changing the `storage_type` to a GPU array
# type such as `ROCArray` (AMD) or `CuArray` (NVIDIA CUDA).
# On such backends, `tuning` selects performance settings of the kernels, e.g.,
# `Tuning(flux_differencing_kernel = FullSweep())` for the kernel used for the
# flux differencing volume integral.
semi = trixi_adapt(semi; real_type = nothing, storage_type = nothing,
tuning = nothing)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 1000
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
analysis_integrals = ())

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(dt = SECONDS_PER_DAY / 4,
save_initial_solution = true,
save_final_solution = true)

callbacks = CallbackSet(summary_callback,
analysis_callback,
alive_callback,
save_solution)

###############################################################################
# Use a Runge-Kutta method with automatic (error based) time step size control
# Enable threading of the RK method for better performance on multiple threads
tol = 1e-6
sol = solve(ode,
SSPRK43(thread = Trixi.Threaded());
abstol = tol, reltol = tol, ode_default_options()...,
callback = callbacks)
8 changes: 6 additions & 2 deletions src/TrixiAtmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export CompressibleMoistEulerEquations2D,
CompressibleEulerPotentialTemperatureEquationsWithGravity1D,
CompressibleEulerPotentialTemperatureEquationsWithGravity2D,
CompressibleEulerPotentialTemperatureEquationsWithGravity3D,
CompressibleEulerMoistPotentialTemperatureEquations3D,
KesslerMicrophysics,
CompressibleEulerEnergyEquationsWithGravity2D,
CompressibleEulerEnergyEquationsWithGravity3D,
CompressibleEulerInternalEnergyEquationsWithGravity2D,
Expand Down Expand Up @@ -126,11 +128,13 @@ export initial_condition_gaussian, initial_condition_geostrophic_balance,

export initial_condition_adiabatic, initial_condition_gravity_waves,
initial_condition_baroclinic_instability, initial_condition_isothermal,
initial_condition_vortex_shedding
initial_condition_vortex_shedding, initial_condition_moist_baroclinic_instability

export aux_field_gravity_earth

export boundary_condition_horizontal_slip_wall

export source_terms_coriolis_small_earth
export source_terms_coriolis_small_earth, source_terms_microphysics

export MountainWaveSetup, SchärMountain, WitchOfAgnesi, terrain_following_faces

Expand Down
Loading
Loading