-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
196 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Trixi" | ||
uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" | ||
authors = ["Michael Schlottke-Lakemper <[email protected]>", "Gregor Gassner <[email protected]>", "Hendrik Ranocha <[email protected]>", "Andrew R. Winters <[email protected]>", "Jesse Chan <[email protected]>"] | ||
version = "0.4.39-pre" | ||
version = "0.4.44-pre" | ||
|
||
[deps] | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
|
@@ -50,7 +50,7 @@ GeometryBasics = "0.3, 0.4" | |
HDF5 = "0.14, 0.15, 0.16" | ||
IfElse = "0.1" | ||
LinearMaps = "2.7, 3.0" | ||
LoopVectorization = "0.12.117" | ||
LoopVectorization = "0.12.118" | ||
MPI = "0.19" | ||
MuladdMacro = "0.2.2" | ||
Octavian = "0.3.5" | ||
|
@@ -63,8 +63,8 @@ Requires = "1.1" | |
SciMLBase = "1.21" | ||
Setfield = "0.8, 1" | ||
StartUpDG = "0.13.1" | ||
Static = "0.3, 0.4, 0.5, 0.6" | ||
StaticArrays = "1.0 - 1.4.4" | ||
Static = "0.3, 0.4, 0.5, 0.6, 0.7" | ||
StaticArrays = "1" | ||
StrideArrays = "0.1.18" | ||
StructArrays = "0.6" | ||
SummationByPartsOperators = "0.5.10" | ||
|
This file contains 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 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 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 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 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 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
125 changes: 125 additions & 0 deletions
125
examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_fjordholm_etal.jl
This file contains 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,125 @@ | ||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
|
||
############################################################################### | ||
# semidiscretization of the compressible Euler equations | ||
gamma = 1.4 | ||
equations = CompressibleEulerEquations2D(gamma) | ||
|
||
""" | ||
initial_condition_kelvin_helmholtz_instability_fjordholm_etal(x, t, equations::CompressibleEulerEquations2D) | ||
A version of the classical Kelvin-Helmholtz instability based on | ||
- Ulrik S. Fjordholm, Roger Käppeli, Siddhartha Mishra, Eitan Tadmor (2014) | ||
Construction of approximate entropy measure valued | ||
solutions for hyperbolic systems of conservation laws | ||
[arXiv: 1402.0909](https://arxiv.org/abs/1402.0909) | ||
""" | ||
function initial_condition_kelvin_helmholtz_instability_fjordholm_etal(x, t, equations::CompressibleEulerEquations2D) | ||
# typical resolution 128^2, 256^2 | ||
# domain size is [0,+1]^2 | ||
# interface is sharp, but randomly perturbed | ||
# The random numbers used in the initial conditions have been generated as follows: | ||
# | ||
# using StableRNGs | ||
# | ||
# rng = StableRNG(100) | ||
# | ||
# a1 = rand(rng, m) | ||
# a2 = rand(rng, m) | ||
# a1 .= a1 / sum(a1) | ||
# a2 .= a2 / sum(a2) | ||
# b1 = (rand(rng, m) .- 0.5) .* pi | ||
# b2 = (rand(rng, m) .- 0.5) .* pi | ||
|
||
m = 10 | ||
a1 = [0.04457096674422902, 0.03891512410182607, 0.0030191053979293433, 0.0993913172320319, | ||
0.1622302137588842, 0.1831383653456182, 0.11758003014101702, 0.07964318348142958, | ||
0.0863245324711805, 0.18518716132585408] | ||
a2 = [0.061688440856337096, 0.23000237877135882, 0.04453793881833177, 0.19251530387370916, | ||
0.11107917357941084, 0.05898041974649702, 0.09949312336096268, 0.07022276346006465, | ||
0.10670366489014596, 0.02477679264318211] | ||
b1 = [0.06582340543754152, 0.9857886297001535, 0.8450452205037154, -1.279648120993805, | ||
0.45454198915209526, -0.13359370986823993, 0.07062615913363897, -1.0097986278512623, | ||
1.0810669017430343, -0.14207309803877177] | ||
b2 = [-1.1376882185131414, -1.4798197129947765, 0.6139290513283818, -0.3319087388365522, | ||
0.14633328999192285, -0.06373231463100072, -0.6270101051216724, 0.13941252226261905, | ||
-1.0337526453303645, 1.0441408867083155] | ||
Y1 = 0.0 | ||
Y2 = 0.0 | ||
for n = 1:m | ||
Y1 += a1[n] * cos(b1[n] + 2 * n * pi * x[1]) | ||
Y2 += a2[n] * cos(b2[n] + 2 * n * pi * x[1]) | ||
end | ||
|
||
J1 = 0.25 | ||
J2 = 0.75 | ||
epsilon = 0.01 | ||
I1 = J1 + epsilon * Y1 | ||
I2 = J2 + epsilon * Y2 | ||
|
||
if (x[2] > I1) && (x[2] < I2) | ||
rho = 2 | ||
v1 = -0.5 | ||
else | ||
rho = 1 | ||
v1 = 0.5 | ||
end | ||
v2 = 0 | ||
p = 2.5 | ||
|
||
return prim2cons(SVector(rho, v1, v2, p), equations) | ||
end | ||
initial_condition = initial_condition_kelvin_helmholtz_instability_fjordholm_etal | ||
|
||
surface_flux = flux_hllc | ||
volume_flux = flux_ranocha | ||
polydeg = 3 | ||
basis = LobattoLegendreBasis(polydeg) | ||
indicator_sc = IndicatorHennemannGassner(equations, basis, | ||
alpha_max=0.001, | ||
alpha_min=0.0001, | ||
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 = (0.0, 0.0) | ||
coordinates_max = (1.0, 1.0) | ||
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level=6, | ||
n_cells_max=100_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 = 400 | ||
analysis_callback = AnalysisCallback(semi, interval=analysis_interval) | ||
|
||
alive_callback = AliveCallback(analysis_interval=analysis_interval) | ||
|
||
save_solution = SaveSolutionCallback(interval=400, | ||
save_initial_solution=true, | ||
save_final_solution=true, | ||
solution_variables=cons2prim) | ||
|
||
callbacks = CallbackSet(summary_callback, | ||
analysis_callback, alive_callback, | ||
save_solution) | ||
|
||
############################################################################### | ||
# run the simulation | ||
sol = solve(ode, SSPRK43(), | ||
save_everystep=false, callback=callbacks); | ||
summary_callback() # print the timer summary |
This file contains 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 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 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 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.