Skip to content

Commit 9d6bbf5

Browse files
Add unit and type tests (#117)
* add unit tests for ec fluxes * add test unit for tec, etec and lmars fluxe * include test_unit.jl * add unit tests for shallow water * fix formatting * increase coverage * format * change pressure computation * add first type stable tests * add some more type stable tests * add all tests for potential temperature * fix formatting * add type stable test for moist euler * fix exa mples * fix typo * add ShalloWater 3D tests * remove @show * update test_type.jl * update test_type.jl * update runtests.jl * increase coverage * apply code review suggestions * fix elixirs * apply review suggestions --------- Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent 9dd3b48 commit 9d6bbf5

28 files changed

+1691
-152
lines changed

examples/elixir_euler_potential_temperature_baroclinic_instability.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ end
193193

194194
return SVector(du1, du2, du3, du4, du5, zero(eltype(u)))
195195
end
196-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity3D()
196+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity3D(c_p = 1004,
197+
c_v = 717,
198+
gravity = 9.81)
197199

198200
initial_condition = initial_condition_baroclinic_instability
199201

examples/elixir_euler_potential_temperature_ec.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function initial_condition_density_wave(x, t,
99
return prim2cons(SVector(rho, v1, p), equations)
1010
end
1111

12-
equations = CompressibleEulerPotentialTemperatureEquations1D()
12+
equations = CompressibleEulerPotentialTemperatureEquations1D(c_p = 1004, c_v = 717)
1313

1414
polydeg = 3
1515
basis = LobattoLegendreBasis(polydeg)

examples/elixir_euler_potential_temperature_inertia_gravity_waves.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ function initial_condition_gravity_waves(x, t,
3636
return prim2cons(SVector(rho, v1, v2, p, g * x[2]), equations)
3737
end
3838

39-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D()
39+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 1004,
40+
c_v = 717,
41+
gravity = 9.81)
4042

4143
# We have an isothermal background state with T0 = 250 K.
4244
# The reference speed of sound can be computed as:

examples/elixir_euler_potential_temperature_linear_hydrostatic.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ end
9595
return prim2cons(SVector(rho, v1, v2, p, g * x[2]), equations)
9696
end
9797

98-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D()
98+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 1004,
99+
c_v = 717,
100+
gravity = 9.81)
99101
alpha = 0.035
100102
xr_B = 60000.0
101103
linear_hydrostatic_setup = HydrostaticSetup(alpha, xr_B, equations)

examples/elixir_euler_potential_temperature_linear_nonhydrostatic.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ end
9191
return prim2cons(SVector(rho, v1, v2, p, g * x[2]), equations)
9292
end
9393

94-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D()
94+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 1004,
95+
c_v = 717,
96+
gravity = 9.81)
9597
alpha = 0.03
9698
xr_B = 40000.0
9799

examples/elixir_euler_potential_temperature_robert_bubble.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151
return SVector(zero(eltype(u)), zero(eltype(u)), -g * rho, zero(eltype(u)))
5252
end
5353

54-
equations = CompressibleEulerPotentialTemperatureEquations2D()
54+
equations = CompressibleEulerPotentialTemperatureEquations2D(c_p = 1004, c_v = 717)
5555

5656
surface_flux = FluxLMARS(340)
5757
volume_flux = flux_tec

examples/elixir_euler_potential_temperature_schaer_mountain.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ end
9191

9292
###############################################################################
9393
# semidiscretization of the compressible Euler equations
94-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D()
94+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 1004,
95+
c_v = 717,
96+
gravity = 9.81)
9597
alpha = 0.03
9698
xr_B = 20000
9799
schär_setup = SchärSetup(alpha, xr_B)

examples/elixir_euler_potential_temperature_taylor_green_vortex.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function initial_condition_taylor_green_vortex(x, t,
1414
return prim2cons(SVector(rho, v1, v2, v3, p), equations)
1515
end
1616

17-
equations = CompressibleEulerPotentialTemperatureEquations3D()
17+
equations = CompressibleEulerPotentialTemperatureEquations3D(c_p = 1004, c_v = 717)
1818
polydeg = 3
1919
basis = LobattoLegendreBasis(polydeg)
2020
surface_flux = flux_etec

examples/elixir_euler_potential_temperature_well_balanced.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function initial_condition_adiabatic(x, t,
3232
return prim2cons(SVector(rho, v1, p, g * x[1]), equations)
3333
end
3434

35-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity1D()
35+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity1D(c_p = 1004,
36+
c_v = 717,
37+
gravity = 9.81)
3638
polydeg = 2
3739
basis = LobattoLegendreBasis(polydeg)
3840
cs = 340.0

examples/elixir_euler_potential_temperature_well_balanced_curvilinear.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ function initial_condition_adiabatic(x, t,
3333
return prim2cons(SVector(rho, v1, v2, p, g * x[2]), equations)
3434
end
3535

36-
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D()
36+
equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 1004,
37+
c_v = 717,
38+
gravity = 9.81)
3739
polydeg = 2
3840
basis = LobattoLegendreBasis(polydeg)
3941
cs = 340

0 commit comments

Comments
 (0)