Repository navigation
add 3D moist Euler equation with Kessler scheme #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,402
−5
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
23b873e
add Kessler on the sphere
MarcoArtiano 88bdf6f
add turbo fluxes and clean-up
MarcoArtiano beff4d5
some clean up
MarcoArtiano 1b780a8
resolve conflicts
MarcoArtiano 26e16ab
add a first generalization of microphysics
MarcoArtiano f0566ce
constants in the struct
MarcoArtiano a116910
use aux consistently as positional argument
MarcoArtiano 7900f77
fix constant
MarcoArtiano b5dcc01
Apply batched suggestions from code review
MarcoArtiano 18a5a33
adjust comments and references
MarcoArtiano 960600d
fix references
MarcoArtiano 68ba113
Update src/equations/microphysics/microphysics.jl
MarcoArtiano c794df9
fix comments, simplify tests
MarcoArtiano 629a9c3
Merge branch 'ma/kessler_3d' of github.com:trixi-framework/TrixiAtmo.…
MarcoArtiano 57c1bd6
add docs for terminal velocity rain for Doppler scheme
MarcoArtiano 5b18e93
Merge branch 'main' into ma/kessler_3d
MarcoArtiano 1408c89
Update src/equations/compressible_euler_moist_potential_temperature_3…
MarcoArtiano ba9c8b7
use @unpack consistently
MarcoArtiano 35b9c3f
rename water with precipitation
MarcoArtiano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...itation/global_circulation/elixir_potential_temperature_kessler_baroclinic_instability.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.