forked from trixi-framework/Trixi.jl
-
Notifications
You must be signed in to change notification settings - Fork 1
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
7 changed files
with
209 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
advection_velocity = (0.2, -0.7, 0.5) | ||
equations = LinearScalarAdvectionEquation3D(advection_velocity) | ||
|
||
initial_condition = initial_condition_convergence_test | ||
|
||
solver = FV(order = 2, extended_reconstruction_stencil = false, | ||
surface_flux = flux_lax_friedrichs) | ||
|
||
coordinates_min = (-1.0, -1.0, -1.0) # minimum coordinates (min(x), min(y), min(z)) | ||
coordinates_max = (1.0, 1.0, 1.0) # maximum coordinates (max(x), max(y), max(z)) | ||
|
||
trees_per_dimension = (8, 8, 8) | ||
|
||
mesh = T8codeMesh(trees_per_dimension, | ||
coordinates_min = coordinates_min, coordinates_max = coordinates_max, | ||
initial_refinement_level = 3) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
tspan = (0.0, 1.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 = 10, | ||
solution_variables = cons2prim) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 0.9) | ||
|
||
callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, | ||
stepsize_callback, save_solution) | ||
|
||
############################################################################### | ||
# 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() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
#################################################### | ||
|
||
advection_velocity = (0.2, -0.7, 0.5) | ||
equations = LinearScalarAdvectionEquation3D(advection_velocity) | ||
|
||
initial_condition = initial_condition_gauss | ||
|
||
solver = FV(order = 2, surface_flux = flux_lax_friedrichs) | ||
|
||
initial_refinement_level = 4 | ||
# cmesh = Trixi.cmesh_new_periodic_hybrid() | ||
cmesh = Trixi.cmesh_quad_3d(periodicity = (true, true, true)) | ||
mesh = T8codeMesh(cmesh, solver, initial_refinement_level = initial_refinement_level) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
tspan = (0.0, 5.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 = 10, | ||
solution_variables = cons2prim) | ||
|
||
stepsize_callback = StepsizeCallback(cfl = 0.7) | ||
|
||
callbacks = CallbackSet(summary_callback, save_solution, analysis_callback, alive_callback, | ||
stepsize_callback) | ||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),#Euler(), | ||
dt = 5.0e-2, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
save_everystep = false, callback = callbacks); | ||
summary_callback() |
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