Skip to content
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

Compressible Euler Quasi-1D #1757

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
deb1fb6
implementation of quasi 1d compressible Euler Equation
KrisshChawla Nov 24, 2023
62734c0
added example elixir for quasi 1d compressible Euler equations
KrisshChawla Nov 24, 2023
34af782
added example elixir with a discontinuous initial condition
KrisshChawla Nov 24, 2023
bb3815d
including and exported CompressibleEulerEquationsQuasi1D
KrisshChawla Nov 24, 2023
f5c15be
formatting
KrisshChawla Nov 24, 2023
75c8dca
added entropy conservative test
KrisshChawla Nov 24, 2023
f911772
Merge branch 'main' into compressible_euler_quasi_1d
KrisshChawla Nov 24, 2023
0ef0305
fixing spelling
KrisshChawla Nov 24, 2023
f51e161
formatting
KrisshChawla Nov 24, 2023
862f8dc
Update examples/tree_1d_dgsem/elixir_euler_quasi_1d_discontinuous.jl
KrisshChawla Nov 25, 2023
110d268
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
59fdbbf
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
b13eb72
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
bd2a155
updated test_tree_1d_euler.jl and formatting
KrisshChawla Nov 25, 2023
72eb0e0
Merge branch 'compressible_euler_quasi_1d' of https://github.com/Kris…
KrisshChawla Nov 25, 2023
b49a388
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
4522f4c
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
20c0a10
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
ecb5345
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
6e11565
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
5f9c15c
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
dd38840
adding consistency check for flux
KrisshChawla Nov 25, 2023
33bc713
Update compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
240690e
formatting
KrisshChawla Nov 25, 2023
582078a
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
8190208
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
f6c822a
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
5827a87
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 25, 2023
dc7ccf0
Update compressible_euler_quasi_1d and test_tree_1d_euler
KrisshChawla Nov 25, 2023
d1ccb20
formatting
KrisshChawla Nov 25, 2023
5854bd7
Update examples/tree_1d_dgsem/elixir_euler_quasi_1d_discontinuous.jl
KrisshChawla Nov 26, 2023
8be7c58
Update examples/tree_1d_dgsem/elixir_euler_quasi_1d_ec.jl
KrisshChawla Nov 26, 2023
e3f523a
Update examples/tree_1d_dgsem/elixir_euler_quasi_1d_source_terms.jl
KrisshChawla Nov 26, 2023
f3db12c
Update src/equations/compressible_euler_quasi_1d.jl
jlchan Nov 26, 2023
2264693
Update src/equations/compressible_euler_quasi_1d.jl
jlchan Nov 26, 2023
d2bddf4
Update src/equations/compressible_euler_quasi_1d.jl
KrisshChawla Nov 26, 2023
2c4f3a4
update boundary condition slip wall
KrisshChawla Nov 26, 2023
b67db30
update compressible_euler_quasi_1d.jl
KrisshChawla Nov 26, 2023
3713f0f
Merge branch 'main' into compressible_euler_quasi_1d
DanielDoehring Nov 28, 2023
fa9687a
Merge branch 'main' into compressible_euler_quasi_1d
ranocha Dec 1, 2023
aaadbc8
Update src/equations/compressible_euler_quasi_1d.jl
DanielDoehring Dec 2, 2023
4eb51bf
Update src/equations/compressible_euler_quasi_1d.jl
DanielDoehring Dec 2, 2023
2eb0804
Merge branch 'main' into compressible_euler_quasi_1d
ranocha Dec 4, 2023
279f81d
Merge branch 'main' into compressible_euler_quasi_1d
jlchan Dec 12, 2023
7b2ed23
Merge branch 'main' into compressible_euler_quasi_1d
jlchan Dec 13, 2023
db0e311
remove boundary_condition_slip_wall
KrisshChawla Dec 13, 2023
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
85 changes: 85 additions & 0 deletions examples/tree_1d_dgsem/elixir_euler_quasi_1d_discontinuous.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using OrdinaryDiffEq
using Trixi

###############################################################################
# Semidiscretization of the quasi 1d compressible Euler equations
# See Chan et al. https://doi.org/10.48550/arXiv.2307.12089 for details

equations = CompressibleEulerEquationsQuasi1D(1.4)

"""
initial_condition_discontinuity(x, t, equations::CompressibleEulerEquations1D)

A discontinuous initial condition taken from
- Jesse Chan, Khemraj Shukla, Xinhui Wu, Ruofeng Liu, Prani Nalluri (2023)
High order entropy stable schemes for the quasi-one-dimensional
shallow water and compressible Euler equations
[DOI: 10.48550/arXiv.2307.12089](https://doi.org/10.48550/arXiv.2307.12089)
"""
function initial_condition_discontinuity(x, t,
equations::CompressibleEulerEquationsQuasi1D)
rho = (x[1] < 0) ? 3.4718 : 2.0
v1 = (x[1] < 0) ? -2.5923 : -3.0
p = (x[1] < 0) ? 5.7118 : 2.639
a = (x[1] < 0) ? 1.0 : 1.5

return prim2cons(SVector(rho, v1, p, a), equations)
end

initial_condition = initial_condition_discontinuity

volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal)
surface_flux = (flux_lax_friedrichs, flux_nonconservative_chan_etal)
jlchan marked this conversation as resolved.
Show resolved Hide resolved
KrisshChawla marked this conversation as resolved.
Show resolved Hide resolved

basis = LobattoLegendreBasis(3)
indicator_sc = IndicatorHennemannGassner(equations, basis,
alpha_max = 0.5,
alpha_min = 0.001,
alpha_smooth = true,
variable = density_pressure)
volume_integral = VolumeIntegralShockCapturingHG(indicator_sc;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
solver = DGSEM(basis, surface_flux, volume_integral)

coordinates_min = (-1.0,)
coordinates_max = (1.0,)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 6,
n_cells_max = 10_000)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 2.0)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 100

analysis_callback = AnalysisCallback(semi, interval = analysis_interval)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 100,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.5)

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

###############################################################################
# run the simulation

sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary
73 changes: 73 additions & 0 deletions examples/tree_1d_dgsem/elixir_euler_quasi_1d_ec.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using OrdinaryDiffEq
using Trixi

###############################################################################
# Semidiscretization of the quasi 1d compressible Euler equations with a discontinuous nozzle width function.
# See Chan et al. https://doi.org/10.48550/arXiv.2307.12089 for details

equations = CompressibleEulerEquationsQuasi1D(1.4)

# Setup a truly discontinuous density function and nozzle width for
# this academic testcase of entropy conservation. The errors from the analysis
# callback are not important but the entropy error for this test case
# `∑∂S/∂U ⋅ Uₜ` should be around machine roundoff.
# Works as intended for TreeMesh1D with `initial_refinement_level=6`. If the mesh
# refinement level is changed the initial condition below may need changed as well to
# ensure that the discontinuities lie on an element interface.
function initial_condition_ec(x, t, equations::CompressibleEulerEquationsQuasi1D)
v1 = 0.1
rho = 2.0 + 0.1 * x[1]
p = 3.0
a = 2.0 + x[1]

return prim2cons(SVector(rho, v1, p, a), equations)
end

initial_condition = initial_condition_ec

volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal)
surface_flux = volume_flux
KrisshChawla marked this conversation as resolved.
Show resolved Hide resolved
solver = DGSEM(polydeg = 4, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

coordinates_min = (-1.0,)
coordinates_max = (1.0,)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 6,
n_cells_max = 10_000)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 0.4)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 100

analysis_callback = AnalysisCallback(semi, interval = analysis_interval)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 100,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.8)

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

###############################################################################
# run the simulation

sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary
60 changes: 60 additions & 0 deletions examples/tree_1d_dgsem/elixir_euler_quasi_1d_source_terms.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using OrdinaryDiffEq
using Trixi
using ForwardDiff

###############################################################################
# Semidiscretization of the quasi 1d compressible Euler equations
# See Chan et al. https://doi.org/10.48550/arXiv.2307.12089 for details

equations = CompressibleEulerEquationsQuasi1D(1.4)

initial_condition = initial_condition_convergence_test

volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal)
surface_flux = volume_flux
KrisshChawla marked this conversation as resolved.
Show resolved Hide resolved
solver = DGSEM(polydeg = 4, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

coordinates_min = -1.0
coordinates_max = 1.0
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 4,
n_cells_max = 10_000)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
source_terms = source_terms_convergence_test)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 2.0)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
extra_analysis_errors = (:l2_error_primitive,
:linf_error_primitive))

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 100,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.8)

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

###############################################################################
# run the simulation

sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary
1 change: 1 addition & 0 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export AcousticPerturbationEquations2D,
CompressibleEulerEquations3D,
CompressibleEulerMulticomponentEquations1D,
CompressibleEulerMulticomponentEquations2D,
CompressibleEulerEquationsQuasi1D,
IdealGlmMhdEquations1D, IdealGlmMhdEquations2D, IdealGlmMhdEquations3D,
IdealGlmMhdMulticomponentEquations1D, IdealGlmMhdMulticomponentEquations2D,
HyperbolicDiffusionEquations1D, HyperbolicDiffusionEquations2D,
Expand Down
Loading
Loading