-
Notifications
You must be signed in to change notification settings - Fork 151
Add FVO2 for curved 3D meshes
#2755
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
Merged
DanielDoehring
merged 13 commits into
trixi-framework:main
from
ArturYeritsyan:volume-integral-shock-rrg-3d
Jan 22, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3d97888
add second order fv for 3D structured mesh
ArturYeritsyan ecef610
small change
ArturYeritsyan abf0dbb
Update src/solvers/dgsem_structured/dg_3d.jl
DanielDoehring 812d2f7
add 3d p4est mesh for fv02
ArturYeritsyan a3a95df
add 3d t8code mesh for fvO2
ArturYeritsyan 6c86767
change to a non-cartesian mesh
ArturYeritsyan 7549363
add fv02 example with real curved mesh
ArturYeritsyan 9ab0cfa
delete some not needed files
ArturYeritsyan 025e200
apply all suggested changes
ArturYeritsyan c2ba907
delete not needed file
ArturYeritsyan feab0bf
add free stream test
ArturYeritsyan a4ef743
Update examples/p4est_3d_dgsem/elixir_euler_free_stream_extruded_fvO2.jl
DanielDoehring 132c1a2
Merge branch 'main' into volume-integral-shock-rrg-3d
DanielDoehring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
examples/p4est_3d_dgsem/elixir_euler_free_stream_extruded_fvO2.jl
This file contains hidden or 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,88 @@ | ||
| using OrdinaryDiffEqLowStorageRK | ||
| using Trixi | ||
|
|
||
| ############################################################################### | ||
| # semidiscretization of the compressible Euler equations | ||
|
|
||
| equations = CompressibleEulerEquations3D(1.4) | ||
|
|
||
| initial_condition = initial_condition_constant | ||
|
|
||
| boundary_conditions = Dict(:all => BoundaryConditionDirichlet(initial_condition)) | ||
|
|
||
| polydeg = 3 # governs in this case only the number of subcells | ||
| basis = LobattoLegendreBasis(polydeg) | ||
| surface_flux = flux_lax_friedrichs | ||
|
|
||
| volume_integral = VolumeIntegralPureLGLFiniteVolumeO2(basis, | ||
| volume_flux_fv = surface_flux, | ||
| reconstruction_mode = reconstruction_O2_full, | ||
| slope_limiter = monotonized_central) | ||
|
|
||
| solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, | ||
| volume_integral = volume_integral) | ||
|
|
||
| # Mapping as described in https://arxiv.org/abs/2012.12040 but reduced to 2D. | ||
| # This particular mesh is unstructured in the yz-plane, but extruded in x-direction. | ||
| # Apply the warping mapping in the yz-plane to get a curved 2D mesh that is extruded | ||
| # in x-direction to ensure free stream preservation on a non-conforming mesh. | ||
| # See https://doi.org/10.1007/s10915-018-00897-9, Section 6. | ||
| function mapping(xi, eta_, zeta_) | ||
| # Transform input variables between -1 and 1 onto [0,3] | ||
| eta = 1.5 * eta_ + 1.5 | ||
| zeta = 1.5 * zeta_ + 1.5 | ||
|
|
||
| z = zeta + | ||
| 1 / 6 * (cos(1.5 * pi * (2 * eta - 3) / 3) * | ||
| cos(0.5 * pi * (2 * zeta - 3) / 3)) | ||
|
|
||
| y = eta + 1 / 6 * (cos(0.5 * pi * (2 * eta - 3) / 3) * | ||
| cos(2 * pi * (2 * z - 3) / 3)) | ||
|
|
||
| return SVector(xi, y, z) | ||
| end | ||
|
|
||
| # Unstructured mesh with 48 cells of the cube domain [-1, 1]^3 | ||
| mesh_file = Trixi.download("https://gist.githubusercontent.com/efaulhaber/b8df0033798e4926dec515fc045e8c2c/raw/b9254cde1d1fb64b6acc8416bc5ccdd77a240227/cube_unstructured_2.inp", | ||
| joinpath(@__DIR__, "cube_unstructured_2.inp")) | ||
|
|
||
| mesh = P4estMesh{3}(mesh_file, polydeg = polydeg, | ||
| mapping = mapping) | ||
|
|
||
| semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
| boundary_conditions = boundary_conditions) | ||
|
|
||
| ############################################################################### | ||
| # ODE solvers, callbacks etc. | ||
|
|
||
| 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_restart = SaveRestartCallback(interval = 100, | ||
| save_final_restart = true) | ||
|
|
||
| save_solution = SaveSolutionCallback(interval = 100, | ||
| save_initial_solution = true, | ||
| save_final_solution = true, | ||
| solution_variables = cons2prim) | ||
|
|
||
| stepsize_callback = StepsizeCallback(cfl = 1.2) | ||
|
|
||
| callbacks = CallbackSet(summary_callback, | ||
| analysis_callback, alive_callback, | ||
| save_restart, 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 | ||
| ode_default_options()..., callback = callbacks); |
60 changes: 60 additions & 0 deletions
60
examples/structured_3d_dgsem/elixir_euler_source_terms_nonperiodic_fvO2.jl
This file contains hidden or 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,60 @@ | ||
| using OrdinaryDiffEqLowStorageRK | ||
| using Trixi | ||
|
|
||
| ############################################################################### | ||
| # semidiscretization of the compressible Euler equations | ||
|
|
||
| equations = CompressibleEulerEquations3D(1.4) | ||
|
|
||
| initial_condition = initial_condition_convergence_test | ||
| source_terms = source_terms_convergence_test | ||
|
|
||
| polydeg = 2 # governs in this case only the number of subcells | ||
| basis = LobattoLegendreBasis(polydeg) | ||
| surface_flux = flux_hll | ||
|
|
||
| volume_integral = VolumeIntegralPureLGLFiniteVolumeO2(basis, | ||
| volume_flux_fv = surface_flux, | ||
| reconstruction_mode = reconstruction_O2_full, | ||
| slope_limiter = monotonized_central) | ||
|
|
||
| solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux, | ||
| volume_integral = volume_integral) | ||
|
|
||
| coordinates_min = (0.0, 0.0, 0.0) | ||
| coordinates_max = (2.0, 2.0, 2.0) | ||
| cells_per_dimension = (2, 2, 2) | ||
| mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, | ||
| periodicity = false) | ||
|
|
||
| boundary_condition = BoundaryConditionDirichlet(initial_condition) | ||
| boundary_conditions = boundary_condition_default(mesh, boundary_condition) | ||
|
|
||
| semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, | ||
| source_terms = source_terms, | ||
| boundary_conditions = boundary_conditions) | ||
|
|
||
| ############################################################################### | ||
| # 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) | ||
|
|
||
| stepsize_callback = StepsizeCallback(cfl = 1.5) | ||
|
|
||
| callbacks = CallbackSet(summary_callback, | ||
| analysis_callback, alive_callback, | ||
| stepsize_callback) | ||
| ############################################################################### | ||
| # run the simulation | ||
|
|
||
| sol = solve(ode, ParsaniKetchesonDeconinck3S82(); | ||
| dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
| ode_default_options()..., callback = callbacks); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.