diff --git a/Project.toml b/Project.toml index bda43724..b1db6f06 100644 --- a/Project.toml +++ b/Project.toml @@ -33,5 +33,5 @@ Static = "0.8, 1" StaticArrayInterface = "1.5.1" StaticArrays = "1" StrideArrays = "0.1.28" -Trixi = "0.14" +Trixi = "0.15" julia = "1.10" diff --git a/examples/advection/cartesian/elixir_cubed_sphere.jl b/examples/advection/cartesian/elixir_cubed_sphere.jl index afefa67b..617909c1 100644 --- a/examples/advection/cartesian/elixir_cubed_sphere.jl +++ b/examples/advection/cartesian/elixir_cubed_sphere.jl @@ -67,7 +67,8 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_convert_to_linear_advection) + source_terms = source_terms_convert_to_linear_advection, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/advection/cartesian/elixir_quad_icosahedron.jl b/examples/advection/cartesian/elixir_quad_icosahedron.jl index 1414b8d2..bc35c541 100644 --- a/examples/advection/cartesian/elixir_quad_icosahedron.jl +++ b/examples/advection/cartesian/elixir_quad_icosahedron.jl @@ -65,7 +65,8 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_convert_to_linear_advection) + source_terms = source_terms_convert_to_linear_advection, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/advection/covariant/elixir_cubed_sphere.jl b/examples/advection/covariant/elixir_cubed_sphere.jl index f8b9c676..897fc2f9 100644 --- a/examples/advection/covariant/elixir_cubed_sphere.jl +++ b/examples/advection/covariant/elixir_cubed_sphere.jl @@ -18,8 +18,8 @@ equations = CovariantLinearAdvectionEquation2D(global_coordinate_system = Global solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs, volume_integral = VolumeIntegralWeakForm()) -# Create a 2D cubed sphere mesh the size of the Earth. For the covariant form to work -# properly, we currently need polydeg to equal that of the solver, +# Create a 2D cubed sphere mesh the size of the Earth. For the covariant form to work +# properly, we currently need polydeg to equal that of the solver, # initial_refinement_level = 0 (default), and element_local_mapping = true. mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, polydeg = Trixi.polydeg(solver), @@ -29,7 +29,8 @@ mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, initial_condition_transformed = transform_initial_condition(initial_condition, equations) # A semidiscretization collects data structures and functions for the spatial discretization -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/advection/covariant/elixir_quad_icosahedron.jl b/examples/advection/covariant/elixir_quad_icosahedron.jl index 293481bb..aeb1c767 100644 --- a/examples/advection/covariant/elixir_quad_icosahedron.jl +++ b/examples/advection/covariant/elixir_quad_icosahedron.jl @@ -18,7 +18,7 @@ equations = CovariantLinearAdvectionEquation2D(global_coordinate_system = Global solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs, volume_integral = VolumeIntegralWeakForm()) -# Create a 2D quadrilateral icosahedral mesh the size of the Earth. For the covariant form +# Create a 2D quadrilateral icosahedral mesh the size of the Earth. For the covariant form # to work properly, we currently need polydeg to equal that of the solver, and # initial_refinement_level = 0 (default) mesh = P4estMeshQuadIcosahedron2D(cells_per_dimension[1], EARTH_RADIUS, @@ -28,7 +28,8 @@ mesh = P4estMeshQuadIcosahedron2D(cells_per_dimension[1], EARTH_RADIUS, initial_condition_transformed = transform_initial_condition(initial_condition, equations) # A semidiscretization collects data structures and functions for the spatial discretization -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -36,11 +37,11 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, (0.0, 12 * SECONDS_PER_DAY)) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() -# The AnalysisCallback allows to analyse the solution in regular intervals and prints the +# The AnalysisCallback allows to analyse the solution in regular intervals and prints the # results analysis_callback = AnalysisCallback(semi, interval = 10, save_analysis = true, @@ -53,7 +54,7 @@ save_solution = SaveSolutionCallback(interval = 10, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.7) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -61,7 +62,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 1.0, save_everystep = false, callback = callbacks) diff --git a/examples/euler/dry_air/buoyancy/elixir_energy_inertia_gravity_waves.jl b/examples/euler/dry_air/buoyancy/elixir_energy_inertia_gravity_waves.jl index 93172524..bcb2647f 100644 --- a/examples/euler/dry_air/buoyancy/elixir_energy_inertia_gravity_waves.jl +++ b/examples/euler/dry_air/buoyancy/elixir_energy_inertia_gravity_waves.jl @@ -72,7 +72,7 @@ polydeg = 3 solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_slip_wall, y_pos = boundary_condition_slip_wall) diff --git a/examples/euler/dry_air/buoyancy/elixir_gemein_bubble.jl b/examples/euler/dry_air/buoyancy/elixir_gemein_bubble.jl index 9f2df478..56487f0c 100644 --- a/examples/euler/dry_air/buoyancy/elixir_gemein_bubble.jl +++ b/examples/euler/dry_air/buoyancy/elixir_gemein_bubble.jl @@ -52,8 +52,8 @@ end initial_condition = initial_condition_warm_bubble -boundary_conditions = Dict(:y_neg => boundary_condition_slip_wall, - :y_pos => boundary_condition_slip_wall) +boundary_conditions = (; y_neg = boundary_condition_slip_wall, + y_pos = boundary_condition_slip_wall) # Gravity source since Q_ph=0 source_term = source_terms_geopotential diff --git a/examples/euler/dry_air/buoyancy/elixir_gemein_nonhydrostatic_gravity_waves.jl b/examples/euler/dry_air/buoyancy/elixir_gemein_nonhydrostatic_gravity_waves.jl index 6347c172..aa048e6f 100644 --- a/examples/euler/dry_air/buoyancy/elixir_gemein_nonhydrostatic_gravity_waves.jl +++ b/examples/euler/dry_air/buoyancy/elixir_gemein_nonhydrostatic_gravity_waves.jl @@ -54,7 +54,7 @@ end source_term = source -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_slip_wall, y_pos = boundary_condition_slip_wall) diff --git a/examples/euler/dry_air/buoyancy/elixir_potential_temperature_inertia_gravity_waves.jl b/examples/euler/dry_air/buoyancy/elixir_potential_temperature_inertia_gravity_waves.jl index 80aba798..00faf823 100644 --- a/examples/euler/dry_air/buoyancy/elixir_potential_temperature_inertia_gravity_waves.jl +++ b/examples/euler/dry_air/buoyancy/elixir_potential_temperature_inertia_gravity_waves.jl @@ -50,7 +50,7 @@ polydeg = 3 solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_slip_wall, y_pos = boundary_condition_slip_wall) diff --git a/examples/euler/dry_air/buoyancy/elixir_potential_temperature_robert_bubble.jl b/examples/euler/dry_air/buoyancy/elixir_potential_temperature_robert_bubble.jl index ed295296..2af1bcf3 100644 --- a/examples/euler/dry_air/buoyancy/elixir_potential_temperature_robert_bubble.jl +++ b/examples/euler/dry_air/buoyancy/elixir_potential_temperature_robert_bubble.jl @@ -59,7 +59,7 @@ polydeg = 3 solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, volume_integral = VolumeIntegralFluxDifferencing(volume_flux)) -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_slip_wall, y_pos = boundary_condition_slip_wall) diff --git a/examples/euler/dry_air/global_circulation/elixir_energy_baroclinic_instability.jl b/examples/euler/dry_air/global_circulation/elixir_energy_baroclinic_instability.jl index a9de07b2..5f6b5cf7 100644 --- a/examples/euler/dry_air/global_circulation/elixir_energy_baroclinic_instability.jl +++ b/examples/euler/dry_air/global_circulation/elixir_energy_baroclinic_instability.jl @@ -200,8 +200,8 @@ equations = CompressibleEulerEnergyEquationsWithGravity3D(c_p = 1004, initial_condition = initial_condition_baroclinic_instability -boundary_conditions = Dict(:inside => boundary_condition_slip_wall, - :outside => boundary_condition_slip_wall) +boundary_conditions = (; inside = boundary_condition_slip_wall, + outside = boundary_condition_slip_wall) polydeg = 5 surface_flux = (FluxLMARS(340), flux_zero) diff --git a/examples/euler/dry_air/global_circulation/elixir_potential_temperature_baroclinic_instability.jl b/examples/euler/dry_air/global_circulation/elixir_potential_temperature_baroclinic_instability.jl index 466ec646..470eb88a 100644 --- a/examples/euler/dry_air/global_circulation/elixir_potential_temperature_baroclinic_instability.jl +++ b/examples/euler/dry_air/global_circulation/elixir_potential_temperature_baroclinic_instability.jl @@ -1,6 +1,6 @@ # An idealized baroclinic instability test case # For optimal results consider increasing the resolution to 16x16x8 trees per cube face. -# +# # This elixir takes about 8 hours, using 16 threads of an AMD Ryzen 7 7800X3D. # # References: @@ -198,8 +198,8 @@ equations = CompressibleEulerPotentialTemperatureEquationsWithGravity3D(c_p = 10 initial_condition = initial_condition_baroclinic_instability -boundary_conditions = Dict(:inside => boundary_condition_slip_wall, - :outside => boundary_condition_slip_wall) +boundary_conditions = (; inside = boundary_condition_slip_wall, + outside = boundary_condition_slip_wall) polydeg = 5 surface_flux = (FluxLMARS(340), flux_zero) diff --git a/examples/euler/dry_air/global_circulation/elixir_potential_temperature_held_suarez.jl b/examples/euler/dry_air/global_circulation/elixir_potential_temperature_held_suarez.jl index f0e0b3c8..97c3f038 100644 --- a/examples/euler/dry_air/global_circulation/elixir_potential_temperature_held_suarez.jl +++ b/examples/euler/dry_air/global_circulation/elixir_potential_temperature_held_suarez.jl @@ -115,8 +115,8 @@ equations = CompressibleEulerPotentialTemperatureEquationsWithGravity3D(c_p = 10 initial_condition = initial_condition_isothermal -boundary_conditions = Dict(:inside => boundary_condition_slip_wall, - :outside => boundary_condition_slip_wall) +boundary_conditions = (; inside = boundary_condition_slip_wall, + outside = boundary_condition_slip_wall) polydeg = 4 surface_flux = (FluxLMARS(340), flux_zero) diff --git a/examples/euler/dry_air/mountain_flow/elixir_potential_temperature_schaer_mountain.jl b/examples/euler/dry_air/mountain_flow/elixir_potential_temperature_schaer_mountain.jl index a7cb9900..49339afb 100644 --- a/examples/euler/dry_air/mountain_flow/elixir_potential_temperature_schaer_mountain.jl +++ b/examples/euler/dry_air/mountain_flow/elixir_potential_temperature_schaer_mountain.jl @@ -98,10 +98,10 @@ alpha = 0.03 xr_B = 20000 schär_setup = SchärSetup(alpha, xr_B) boundary = BoundaryConditionDirichlet(schär_setup) -boundary_conditions = Dict(:x_neg => boundary, - :x_pos => boundary, - :y_neg => boundary_condition_slip_wall, - :y_pos => boundary) +boundary_conditions = (; x_neg = boundary, + x_pos = boundary, + y_neg = boundary_condition_slip_wall, + y_pos = boundary) polydeg = 3 basis = LobattoLegendreBasis(polydeg) diff --git a/examples/euler/dry_air/tests/elixir_gemein_source_terms.jl b/examples/euler/dry_air/tests/elixir_gemein_source_terms.jl index 19580fa1..6e0bb9fa 100644 --- a/examples/euler/dry_air/tests/elixir_gemein_source_terms.jl +++ b/examples/euler/dry_air/tests/elixir_gemein_source_terms.jl @@ -21,10 +21,12 @@ coordinates_max = (2.0, 2.0) cells_per_dimension = (16, 16) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test_dry) + source_terms = source_terms_convergence_test_dry, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_ec.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_ec.jl index eaf79016..68692f53 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_ec.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_ec.jl @@ -23,9 +23,11 @@ coordinates_min = (0.0,) coordinates_max = (1.0,) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 3, - n_cells_max = 100_000) + n_cells_max = 100_000, + periodicity = true) -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_density_wave, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_density_wave, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. tspan = (0.0, 0.4) diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_linear_hydrostatic.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_linear_hydrostatic.jl index 5de8f544..ce366966 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_linear_hydrostatic.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_linear_hydrostatic.jl @@ -104,10 +104,10 @@ linear_hydrostatic_setup = HydrostaticSetup(alpha, xr_B, equations) boundary = BoundaryConditionDirichlet(linear_hydrostatic_setup) -boundary_conditions = Dict(:x_neg => boundary, - :x_pos => boundary, - :y_neg => boundary_condition_slip_wall, - :y_pos => boundary) +boundary_conditions = (; x_neg = boundary, + x_pos = boundary, + y_neg = boundary_condition_slip_wall, + y_pos = boundary) # We have an isothermal background state with T0 = 250 K. # The reference speed of sound can be computed as: diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_linear_nonhydrostatic.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_linear_nonhydrostatic.jl index 1fb5177d..f6cd95db 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_linear_nonhydrostatic.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_linear_nonhydrostatic.jl @@ -101,10 +101,10 @@ linear_hydrostatic_setup = NonHydrostaticSetup(alpha, xr_B) boundary = BoundaryConditionDirichlet(linear_hydrostatic_setup) -boundary_conditions = Dict(:x_neg => boundary, - :x_pos => boundary, - :y_neg => boundary_condition_slip_wall, - :y_pos => boundary) +boundary_conditions = (; x_neg = boundary, + x_pos = boundary, + y_neg = boundary_condition_slip_wall, + y_pos = boundary) polydeg = 3 basis = LobattoLegendreBasis(polydeg) surface_flux = (FluxLMARS(340.0), flux_zero) diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_taylor_green_vortex.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_taylor_green_vortex.jl index 9a26fbe8..91c2df97 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_taylor_green_vortex.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_taylor_green_vortex.jl @@ -30,7 +30,8 @@ mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, periodicity = (true, true, true)) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_taylor_green_vortex, - solver) + solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. tspan = (0.0, 0.2) diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced.jl index be84ab65..952523bf 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced.jl @@ -1,6 +1,6 @@ # References: # - Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025) -# Structure-Preserving High-Order Methods for the Compressible Euler Equations +# Structure-Preserving High-Order Methods for the Compressible Euler Equations # in Potential Temperature Formulation for Atmospheric Flows # https://arxiv.org/abs/2509.10311 (pre-print) using OrdinaryDiffEqSSPRK @@ -50,8 +50,10 @@ mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 3, n_cells_max = 100_000, periodicity = false) -boundary_conditions = (x_pos = boundary_condition_slip_wall, - x_neg = boundary_condition_slip_wall) +boundary_conditions = (; x_pos = boundary_condition_slip_wall, + x_neg = boundary_condition_slip_wall, + y_pos = boundary_condition_slip_wall, + y_neg = boundary_condition_slip_wall) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_adiabatic, solver, boundary_conditions = boundary_conditions) diff --git a/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced_curvilinear.jl b/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced_curvilinear.jl index e6d5f19f..91a02a68 100644 --- a/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced_curvilinear.jl +++ b/examples/euler/dry_air/tests/elixir_potential_temperature_well_balanced_curvilinear.jl @@ -1,6 +1,6 @@ # References: # - Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025) -# Structure-Preserving High-Order Methods for the Compressible Euler Equations +# Structure-Preserving High-Order Methods for the Compressible Euler Equations # in Potential Temperature Formulation for Atmospheric Flows # https://arxiv.org/abs/2509.10311 (pre-print) using OrdinaryDiffEqSSPRK @@ -55,10 +55,10 @@ mesh = P4estMesh(trees_per_dimension, polydeg = polydeg, mapping = mapping, periodicity = (false, false), initial_refinement_level = 0) -boundary_conditions = Dict(:x_pos => boundary_condition_slip_wall, - :x_neg => boundary_condition_slip_wall, - :y_pos => boundary_condition_slip_wall, - :y_neg => boundary_condition_slip_wall) +boundary_conditions = (; x_pos = boundary_condition_slip_wall, + x_neg = boundary_condition_slip_wall, + y_pos = boundary_condition_slip_wall, + y_neg = boundary_condition_slip_wall) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_adiabatic, solver, boundary_conditions = boundary_conditions) diff --git a/examples/euler/moist_air/buoyancy/elixir_hoeck_bubble.jl b/examples/euler/moist_air/buoyancy/elixir_hoeck_bubble.jl index 4df10f39..9f7efd02 100644 --- a/examples/euler/moist_air/buoyancy/elixir_hoeck_bubble.jl +++ b/examples/euler/moist_air/buoyancy/elixir_hoeck_bubble.jl @@ -28,7 +28,7 @@ end equations = CompressibleRainyEulerEquations2D() -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_slip_wall, y_pos = boundary_condition_slip_wall) diff --git a/examples/euler/moist_air/tests/elixir_gemein_source_terms.jl b/examples/euler/moist_air/tests/elixir_gemein_source_terms.jl index 8526da66..5c18aa3e 100644 --- a/examples/euler/moist_air/tests/elixir_gemein_source_terms.jl +++ b/examples/euler/moist_air/tests/elixir_gemein_source_terms.jl @@ -30,10 +30,12 @@ coordinates_max = (2.0, 2.0) cells_per_dimension = (4, 4) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test_moist) + source_terms = source_terms_convergence_test_moist, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble.jl b/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble.jl index 22427026..aef38af4 100644 --- a/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble.jl +++ b/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble.jl @@ -26,7 +26,7 @@ end ############################################################################### # semidiscretization of the compressible rainy Euler equations -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_simple_slip_wall, y_pos = boundary_condition_simple_slip_wall) diff --git a/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble_diffusion.jl b/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble_diffusion.jl index e23facd9..8ef9163f 100644 --- a/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble_diffusion.jl +++ b/examples/euler/precipitation/buoyancy/elixir_hoeck_bubble_diffusion.jl @@ -30,12 +30,12 @@ end diffusivity = 0.5f0 equations_parabolic = LaplaceDiffusion2D(diffusivity, equations) -boundary_conditions = (x_neg = boundary_condition_periodic, +boundary_conditions = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_simple_slip_wall, y_pos = boundary_condition_simple_slip_wall) -boundary_conditions_parabolic = (x_neg = boundary_condition_periodic, +boundary_conditions_parabolic = (; x_neg = boundary_condition_periodic, x_pos = boundary_condition_periodic, y_neg = boundary_condition_laplace, y_pos = boundary_condition_laplace) diff --git a/examples/euler/precipitation/tests/convergence_test.jl b/examples/euler/precipitation/tests/convergence_test.jl index ef215c9f..651cdca0 100644 --- a/examples/euler/precipitation/tests/convergence_test.jl +++ b/examples/euler/precipitation/tests/convergence_test.jl @@ -145,10 +145,12 @@ coordinates_max = (2.0, 2.0) cells_per_dimension = (6, 6) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test_rainy) + source_terms = source_terms_convergence_test_rainy, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -191,10 +193,10 @@ sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false, stage_limite #= #################################################################################################### l2 -rho_dry rho_moist rho_rain rho_v1 rho_v2 energy_density rho_vapour rho_cloud temperature +rho_dry rho_moist rho_rain rho_v1 rho_v2 energy_density rho_vapour rho_cloud temperature error EOC error EOC error EOC error EOC error EOC error EOC error EOC error EOC error EOC -2.40e-06 - 3.89e-05 - 1.52e-05 - 7.53e-03 - 2.09e-02 - 5.20e+01 - 1.75e-08 - 3.89e-05 - 2.16e-04 - +2.40e-06 - 3.89e-05 - 1.52e-05 - 7.53e-03 - 2.09e-02 - 5.20e+01 - 1.75e-08 - 3.89e-05 - 2.16e-04 - 1.43e-07 4.07 2.32e-06 4.07 9.72e-07 3.97 2.90e-04 4.70 1.39e-03 3.91 3.14e+00 4.05 1.15e-09 3.93 2.32e-06 4.07 1.42e-05 3.93 8.48e-09 4.08 1.37e-07 4.08 1.20e-07 3.02 1.13e-05 4.68 3.10e-05 5.49 1.78e-01 4.14 2.69e-11 5.42 1.37e-07 4.08 3.32e-07 5.41 @@ -204,17 +206,17 @@ error EOC error EOC error EOC error EOC mean 4.04 mean 4.04 mean 4.05 mean 4.39 mean 4.77 mean 4.01 mean 4.48 mean 4.04 mean 4.48 ---------------------------------------------------------------------------------------------------- linf -rho_dry rho_moist rho_rain rho_v1 rho_v2 energy_density rho_vapour rho_cloud temperature +rho_dry rho_moist rho_rain rho_v1 rho_v2 energy_density rho_vapour rho_cloud temperature error EOC error EOC error EOC error EOC error EOC error EOC error EOC error EOC error EOC -1.68e-05 - 2.74e-04 - 8.69e-05 - 2.34e-02 - 6.25e-02 - 3.85e+02 - 6.00e-08 - 2.74e-04 - 7.43e-04 - +1.68e-05 - 2.74e-04 - 8.69e-05 - 2.34e-02 - 6.25e-02 - 3.85e+02 - 6.00e-08 - 2.74e-04 - 7.43e-04 - 1.07e-06 3.97 1.73e-05 3.98 4.36e-06 4.32 1.13e-03 4.38 3.11e-03 4.33 2.29e+01 4.07 5.72e-09 3.39 1.73e-05 3.98 7.09e-05 3.39 6.01e-08 4.15 9.73e-07 4.16 3.46e-07 3.66 4.43e-05 4.67 6.53e-05 5.57 1.08e+00 4.40 1.63e-10 5.13 9.73e-07 4.16 2.00e-06 5.15 -3.69e-09 4.02 5.98e-08 4.03 2.91e-08 3.57 2.47e-06 4.16 2.37e-06 4.79 9.44e-02 3.52 9.40e-12 4.12 5.97e-08 4.03 1.15e-07 4.12 -2.30e-10 4.01 3.71e-09 4.01 1.47e-09 4.31 1.50e-07 4.04 1.16e-07 4.35 5.51e-03 4.10 5.70e-13 4.04 3.71e-09 4.01 6.97e-09 4.04 +3.69e-09 4.02 5.98e-08 4.03 2.91e-08 3.57 2.47e-06 4.16 2.37e-06 4.79 9.44e-02 3.52 9.40e-12 4.12 5.97e-08 4.03 1.15e-07 4.12 +2.30e-10 4.01 3.71e-09 4.01 1.47e-09 4.31 1.50e-07 4.04 1.16e-07 4.35 5.51e-03 4.10 5.70e-13 4.04 3.71e-09 4.01 6.97e-09 4.04 -mean 4.04 mean 4.04 mean 3.96 mean 4.31 mean 4.76 mean 4.02 mean 4.17 mean 4.04 mean 4.18 +mean 4.04 mean 4.04 mean 3.96 mean 4.31 mean 4.76 mean 4.02 mean 4.17 mean 4.04 mean 4.18 ---------------------------------------------------------------------------------------------------- Dict{Symbol, Any} with 3 entries: :variables => ("rho_dry", "rho_moist", "rho_rain", "rho_v1", "rho_v2", "energy_density", "rho_vapour", "rho_cloud", "temperature") diff --git a/examples/shallow_water/cartesian/elixir_geostrophic_balance.jl b/examples/shallow_water/cartesian/elixir_geostrophic_balance.jl index 3ba95bed..d6cf9f62 100644 --- a/examples/shallow_water/cartesian/elixir_geostrophic_balance.jl +++ b/examples/shallow_water/cartesian/elixir_geostrophic_balance.jl @@ -1,5 +1,5 @@ ############################################################################### -# Entropy-stable DGSEM for the 3D shallow water equations in Cartesian form on +# Entropy-stable DGSEM for the 3D shallow water equations in Cartesian form on # the cubed sphere: Steady geostrophic balance (Case 2, Williamson et al., 1992) ############################################################################### @@ -37,7 +37,8 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_coriolis_lagrange_multiplier) + source_terms = source_terms_coriolis_lagrange_multiplier, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -58,11 +59,11 @@ for element in eachelement(solver, semi.cache) end end -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() -# The AnalysisCallback allows to analyse the solution in regular intervals and prints the +# The AnalysisCallback allows to analyse the solution in regular intervals and prints the # results analysis_callback = AnalysisCallback(semi, interval = 200, save_analysis = true, @@ -77,7 +78,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -85,7 +86,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/cartesian/elixir_isolated_mountain.jl b/examples/shallow_water/cartesian/elixir_isolated_mountain.jl index 71f3dc0f..619101c0 100644 --- a/examples/shallow_water/cartesian/elixir_isolated_mountain.jl +++ b/examples/shallow_water/cartesian/elixir_isolated_mountain.jl @@ -1,6 +1,6 @@ ############################################################################### -# Entropy-stable DGSEM for the 3D shallow water equations in Cartesian form on -# the cubed sphere: Zonal flow over an isolated mountain (Case 5, Williamson et +# Entropy-stable DGSEM for the 3D shallow water equations in Cartesian form on +# the cubed sphere: Zonal flow over an isolated mountain (Case 5, Williamson et # al., 1992) ############################################################################### @@ -24,7 +24,7 @@ mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, polydeg = po equations = ShallowWaterEquations3D(gravity = EARTH_GRAVITATIONAL_ACCELERATION, rotation_rate = EARTH_ROTATION_RATE) -# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with +# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with # simplification for continuous bottom topography volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, @@ -38,11 +38,12 @@ solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, # Transform the initial condition to the proper set of conservative variables initial_condition_transformed = transform_initial_condition(initial_condition, equations) -# A semidiscretization collects data structures and functions for the spatial -# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to +# A semidiscretization collects data structures and functions for the spatial +# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to # specify the bottom topography. semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_coriolis_lagrange_multiplier) + source_terms = source_terms_coriolis_lagrange_multiplier, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -50,7 +51,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -69,7 +70,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -77,7 +78,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_correction.jl b/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_correction.jl index ced9f2d8..69d08b3e 100644 --- a/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_correction.jl +++ b/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_correction.jl @@ -58,7 +58,8 @@ mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, polydeg = po # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, metric_terms = MetricTermsInvariantCurl(), - source_terms = source_terms_entropy_correction) + source_terms = source_terms_entropy_correction, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_projection.jl b/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_projection.jl index a916f9d2..6245903c 100644 --- a/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_projection.jl +++ b/examples/shallow_water/cartesian/elixir_unsteady_solid_body_rotation_EC_projection.jl @@ -25,7 +25,7 @@ equations = ShallowWaterEquations3D(gravity = EARTH_GRAVITATIONAL_ACCELERATION, volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) surface_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # For provably entropy-stable surface fluxes, use -# surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, DissipationLaxFriedrichsEntropyVariables()), +# surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, DissipationLaxFriedrichsEntropyVariables()), # flux_nonconservative_wintermeyer_etal) solver = DGSEM(polydeg = polydeg, @@ -41,7 +41,8 @@ mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, polydeg = po # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, metric_terms = MetricTermsInvariantCurl(), - source_terms = source_terms_coriolis_lagrange_multiplier) + source_terms = source_terms_coriolis_lagrange_multiplier, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/shallow_water/cartesian/elixir_well_balanced.jl b/examples/shallow_water/cartesian/elixir_well_balanced.jl index 8eff6ed1..df22b710 100644 --- a/examples/shallow_water/cartesian/elixir_well_balanced.jl +++ b/examples/shallow_water/cartesian/elixir_well_balanced.jl @@ -9,7 +9,7 @@ using OrdinaryDiffEqLowStorageRK, Trixi, TrixiAtmo equations = ShallowWaterEquations3D(gravity = EARTH_GRAVITATIONAL_ACCELERATION, rotation_rate = EARTH_ROTATION_RATE) -# Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as +# Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as # surface and volume fluxes polydeg = 3 volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -39,7 +39,8 @@ mesh = P4estMeshCubedSphere2D(cells_per_dimension[1], EARTH_RADIUS, polydeg = po # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, metric_terms = MetricTermsInvariantCurl(), - source_terms = source_terms_coriolis_lagrange_multiplier) + source_terms = source_terms_coriolis_lagrange_multiplier, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/shallow_water/covariant/elixir_barotropic_instability.jl b/examples/shallow_water/covariant/elixir_barotropic_instability.jl index cde63613..18dbbd67 100644 --- a/examples/shallow_water/covariant/elixir_barotropic_instability.jl +++ b/examples/shallow_water/covariant/elixir_barotropic_instability.jl @@ -1,5 +1,5 @@ ############################################################################### -# Entropy-stable DGSEM for the shallow water equations in covariant form +# Entropy-stable DGSEM for the shallow water equations in covariant form # on the cubed sphere: Barotropic instability (Galewsky et al., 2005) ############################################################################### @@ -24,7 +24,7 @@ equations = SplitCovariantShallowWaterEquations2D(EARTH_GRAVITATIONAL_ACCELERATI EARTH_ROTATION_RATE, global_coordinate_system = GlobalCartesianCoordinates()) -# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with +# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with # simplification for continuous (zero) bottom topography volume_flux = (flux_ec, flux_nonconservative_ec) surface_flux = (FluxPlusDissipation(flux_ec, DissipationLocalLaxFriedrichs()), @@ -39,7 +39,8 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_geometric_coriolis) + source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -47,7 +48,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -65,7 +66,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -73,7 +74,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/covariant/elixir_geostrophic_balance.jl b/examples/shallow_water/covariant/elixir_geostrophic_balance.jl index 595a8928..48766bf0 100644 --- a/examples/shallow_water/covariant/elixir_geostrophic_balance.jl +++ b/examples/shallow_water/covariant/elixir_geostrophic_balance.jl @@ -1,5 +1,5 @@ ############################################################################### -# Standard DGSEM for the shallow water equations in covariant form on the cubed +# Standard DGSEM for the shallow water equations in covariant form on the cubed # sphere: Steady geostrophic balance (Case 2, Williamson et al., 1992) ############################################################################### @@ -33,7 +33,8 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, - source_terms = source_terms_geometric_coriolis) + source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -41,11 +42,11 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() -# The AnalysisCallback allows to analyse the solution in regular intervals and prints the +# The AnalysisCallback allows to analyse the solution in regular intervals and prints the # results analysis_callback = AnalysisCallback(semi, interval = 200, save_analysis = true, @@ -58,7 +59,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -66,7 +67,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/covariant/elixir_isolated_mountain.jl b/examples/shallow_water/covariant/elixir_isolated_mountain.jl index 5970bb3b..ccb6880a 100644 --- a/examples/shallow_water/covariant/elixir_isolated_mountain.jl +++ b/examples/shallow_water/covariant/elixir_isolated_mountain.jl @@ -1,6 +1,6 @@ ############################################################################### -# Entropy-stable DGSEM for the shallow water equations in covariant form on the -# cubed sphere: Zonal flow over an isolated mountain (Case 5, Williamson et +# Entropy-stable DGSEM for the shallow water equations in covariant form on the +# cubed sphere: Zonal flow over an isolated mountain (Case 5, Williamson et # al., 1992) ############################################################################### @@ -25,7 +25,7 @@ equations = SplitCovariantShallowWaterEquations2D(EARTH_GRAVITATIONAL_ACCELERATI EARTH_ROTATION_RATE, global_coordinate_system = GlobalCartesianCoordinates()) -# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with +# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with # simplification for continuous bottom topography volume_flux = (flux_ec, flux_nonconservative_ec) surface_flux = (FluxPlusDissipation(flux_ec, DissipationLocalLaxFriedrichs()), @@ -38,11 +38,12 @@ solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, # Transform the initial condition to the proper set of conservative variables initial_condition_transformed = transform_initial_condition(initial_condition, equations) -# A semidiscretization collects data structures and functions for the spatial -# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to +# A semidiscretization collects data structures and functions for the spatial +# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to # specify the bottom topography. semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic, auxiliary_field = bottom_topography_isolated_mountain) ############################################################################### @@ -51,7 +52,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -69,7 +70,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -77,7 +78,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/covariant/elixir_rossby_haurwitz.jl b/examples/shallow_water/covariant/elixir_rossby_haurwitz.jl index 998864b0..df99b73e 100644 --- a/examples/shallow_water/covariant/elixir_rossby_haurwitz.jl +++ b/examples/shallow_water/covariant/elixir_rossby_haurwitz.jl @@ -1,5 +1,5 @@ ############################################################################### -# Entropy-stable DGSEM for the shallow water equations in covariant form on the +# Entropy-stable DGSEM for the shallow water equations in covariant form on the # cubed sphere: Rossby-Haurwitz wave (Case 6, Williamson et al., 1992) ############################################################################### @@ -24,7 +24,7 @@ equations = SplitCovariantShallowWaterEquations2D(EARTH_GRAVITATIONAL_ACCELERATI EARTH_ROTATION_RATE, global_coordinate_system = GlobalCartesianCoordinates()) -# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with +# Use entropy-conservative two-point flux for volume terms, dissipative surface flux with # simplification for continuous (zero) bottom topography volume_flux = (flux_ec, flux_nonconservative_ec) surface_flux = (FluxPlusDissipation(flux_ec, DissipationLocalLaxFriedrichs()), @@ -39,10 +39,11 @@ initial_condition_transformed = transform_initial_condition(initial_condition, e # A semidiscretization collects data structures and functions for the spatial discretization. # Even though `metric_terms = MetricTermsCovariantSphere()` is default, we pass it here -# explicitly, such that `metric_terms` can be adjusted from the `trixi_include()` call in the tests +# explicitly, such that `metric_terms` can be adjusted from the `trixi_include()` call in the tests semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, metric_terms = MetricTermsCovariantSphere(), - source_terms = source_terms_geometric_coriolis) + source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. @@ -50,7 +51,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -68,7 +69,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -76,7 +77,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/covariant/elixir_unsteady_solid_body_rotation_EC.jl b/examples/shallow_water/covariant/elixir_unsteady_solid_body_rotation_EC.jl index 81059e4c..2978c19c 100644 --- a/examples/shallow_water/covariant/elixir_unsteady_solid_body_rotation_EC.jl +++ b/examples/shallow_water/covariant/elixir_unsteady_solid_body_rotation_EC.jl @@ -1,5 +1,5 @@ ############################################################################### -# Entropy-conservative DGSEM for the shallow water equations in covariant form +# Entropy-conservative DGSEM for the shallow water equations in covariant form # on the cubed sphere: Unsteady solid-body rotation (Example 3, Läuter et al., # 2005) ############################################################################### @@ -25,7 +25,7 @@ equations = SplitCovariantShallowWaterEquations2D(EARTH_GRAVITATIONAL_ACCELERATI EARTH_ROTATION_RATE, global_coordinate_system = GlobalCartesianCoordinates()) -# Use entropy-conservative two-point fluxes for volume and surface terms, with the surface +# Use entropy-conservative two-point fluxes for volume and surface terms, with the surface # flux simplified due to the continuous bottom topography volume_flux = (flux_ec, flux_nonconservative_ec) surface_flux = (flux_ec, flux_nonconservative_surface_simplified) @@ -37,11 +37,12 @@ solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, # Transform the initial condition to the proper set of conservative variables initial_condition_transformed = transform_initial_condition(initial_condition, equations) -# A semidiscretization collects data structures and functions for the spatial -# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to +# A semidiscretization collects data structures and functions for the spatial +# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to # specify the bottom topography. semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic, auxiliary_field = bottom_topography_unsteady_solid_body_rotation) ############################################################################### @@ -50,7 +51,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -68,7 +69,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 0.4) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -76,7 +77,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 100.0, save_everystep = false, callback = callbacks) diff --git a/examples/shallow_water/covariant/elixir_well_balanced.jl b/examples/shallow_water/covariant/elixir_well_balanced.jl index a0bb1b02..91560c83 100644 --- a/examples/shallow_water/covariant/elixir_well_balanced.jl +++ b/examples/shallow_water/covariant/elixir_well_balanced.jl @@ -40,11 +40,12 @@ solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, initial_condition_transformed = transform_initial_condition(initial_condition, equations) # A semidiscretization collects data structures and functions for the spatial -# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to -# specify the bottom topography, which is the same as for the standard isolated mountain +# discretization. Here, we pass in the additional keyword argument "auxiliary_field" to +# specify the bottom topography, which is the same as for the standard isolated mountain # case. semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transformed, solver, source_terms = source_terms_geometric_coriolis, + boundary_conditions = boundary_condition_periodic, auxiliary_field = bottom_topography_isolated_mountain) ############################################################################### @@ -53,7 +54,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_transform # Create ODE problem with time span from 0 to T ode = semidiscretize(semi, tspan) -# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation +# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation # setup and resets the timers summary_callback = SummaryCallback() @@ -71,7 +72,7 @@ save_solution = SaveSolutionCallback(dt = (tspan[2] - tspan[1]) / n_saves, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step. stepsize_callback = StepsizeCallback(cfl = 0.1) -# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE +# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE # solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) @@ -79,7 +80,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, ############################################################################### # run the simulation -# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed +# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed # callbacks sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 300.0, save_everystep = false, callback = callbacks) diff --git a/src/semidiscretization/semidiscretization_hyperbolic_2d_manifold_in_3d.jl b/src/semidiscretization/semidiscretization_hyperbolic_2d_manifold_in_3d.jl index 885e5a3b..7c33a001 100644 --- a/src/semidiscretization/semidiscretization_hyperbolic_2d_manifold_in_3d.jl +++ b/src/semidiscretization/semidiscretization_hyperbolic_2d_manifold_in_3d.jl @@ -1,18 +1,18 @@ # The SemidiscretizationHyperbolic constructor has been modified to remove the assertion -# that checks the compatibility between the mesh dimensionality and the equations' -# dimensionality. Instead, we now directly dispatch using the specific mesh type +# that checks the compatibility between the mesh dimensionality and the equations' +# dimensionality. Instead, we now directly dispatch using the specific mesh type # (P4estMesh{2}) for 2D meshes and AbstractEquations{3} for 3D equations. -# This change is necessary to support the implementation of a 2D manifold embedded in a 3D -# space. We also pass in the keyword arguments "metric_terms" and "auxiliary_field", which -# specify the approach used to compute the metric terms as well as any auxiliary fields -# (e.g. bottom topography or a background state) that may be needed by the solver but are +# This change is necessary to support the implementation of a 2D manifold embedded in a 3D +# space. We also pass in the keyword arguments "metric_terms" and "auxiliary_field", which +# specify the approach used to compute the metric terms as well as any auxiliary fields +# (e.g. bottom topography or a background state) that may be needed by the solver but are # not stored in the solution variables or elsewhere in the cache. function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{2}, equations::AbstractEquations{3}, initial_condition, solver; source_terms = nothing, - boundary_conditions = boundary_condition_periodic, + boundary_conditions, # `RealT` is used as real type for node locations etc. # while `uEltype` is used as element type of solutions etc. RealT = real(solver), uEltype = RealT, @@ -40,7 +40,7 @@ function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{2}, performance_counter) end -# Constructor for SemidiscretizationHyperbolic for the covariant form. Requires +# Constructor for SemidiscretizationHyperbolic for the covariant form. Requires # compatibility between the mesh and equations (i.e. the same `NDIMS` and `NDIMS_AMBIENT`) # and sets the default metric terms to MetricTermsCovariantSphere. function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{NDIMS, NDIMS_AMBIENT}, @@ -49,7 +49,7 @@ function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{NDIMS, NDIMS_AMBIENT initial_condition, solver; source_terms = nothing, - boundary_conditions = boundary_condition_periodic, + boundary_conditions, # `RealT` is used as real type for node locations etc. # while `uEltype` is used as element type of solutions etc. RealT = real(solver), uEltype = RealT, diff --git a/test/Project.toml b/test/Project.toml index cbb4d255..3cf375ba 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -15,5 +15,5 @@ NLsolve = "4.5.1" OrdinaryDiffEqLowStorageRK = "1.2" OrdinaryDiffEqSSPRK = "1.2" Test = "1" -Trixi = "0.14" +Trixi = "0.15" TrixiTest = "0.1.3, 0.2"