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

WIP: Sc/polytropic 2d wave speed #1816

Merged
merged 168 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 163 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
bb07419
Added coupling converters.
SimonCan Jun 26, 2023
95892bf
Added generic converter_function for structured 2d meshes.
SimonCan Jun 29, 2023
4e82276
Added example elixir for coupling converters.
SimonCan Jul 3, 2023
7355ed0
Cleaned up converter coupling elixir.
SimonCan Jul 3, 2023
b8cabf4
Added equations in coupling converters.
SimonCan Jul 3, 2023
6d521a7
Added converter functions.
SimonCan Jul 4, 2023
ab8e750
Added identity converter function.
SimonCan Jul 4, 2023
24773c7
Autoformat for converter coupling implementation.
SimonCan Jul 5, 2023
c7da2cc
Added coupled converter elixir.
SimonCan Jul 5, 2023
98bf2cf
Corrected file name of coupled converters test.
SimonCan Jul 5, 2023
79da4e9
Merge branch 'main' into sc/converters_coupling
sloede Jul 11, 2023
d97302d
Removed redundant doc string.
SimonCan Jul 18, 2023
4a22bfe
Added function signature in doc string.
SimonCan Jul 18, 2023
f1f6ee8
Removed coverage_override in coupled tests.
SimonCan Jul 18, 2023
7a7def0
Removed old commented code.
SimonCan Jul 18, 2023
9045c5d
Update make.jl
SimonCan Jul 19, 2023
31cf07f
Update make.jl
SimonCan Jul 19, 2023
2f19315
Create coupling.md
SimonCan Jul 19, 2023
26d8dd3
Update coupling.md
SimonCan Jul 19, 2023
05579d1
Removed troublesome AnalysisCallbackCoupled from test.
SimonCan Jul 20, 2023
84c872e
Chenged coupling converter function.
SimonCan Jul 20, 2023
78f9948
Changed coupling converter function and updated tests.
SimonCan Jul 20, 2023
2e35046
Sepcialized coupling function call.
SimonCan Jul 24, 2023
6bc7c3b
Removed volume coupling from documentation to avoit confusion.
SimonCan Jul 25, 2023
b4decb7
Update src/coupling_converters/coupling_converters.jl
SimonCan Jul 25, 2023
54d8180
Removed redundant converter function for coupling.
SimonCan Jul 25, 2023
160c7bf
Removed redundant coupling converter file mentioned in some files.
SimonCan Jul 25, 2023
8a2187a
Merge branch 'sc/converters_coupling' of github.com:trixi-framework/T…
SimonCan Jul 25, 2023
cab33c2
Autoreformatted.
SimonCan Jul 25, 2023
024106c
Removed old coupled elixir and replaced it with one using converter f…
SimonCan Jul 25, 2023
5c93324
Merge branch 'main' into sc/converters_coupling
SimonCan Jul 28, 2023
c6d6da6
Updated errors for coupled tests.
SimonCan Aug 1, 2023
62d1408
Corrected test results for coupled equations.
SimonCan Aug 1, 2023
09fd691
Corrected comment.
SimonCan Aug 2, 2023
df67f00
Removed coupled test from special tests.
SimonCan Aug 2, 2023
35980a1
Removed coupled test from specials.
SimonCan Aug 2, 2023
aac8430
Chaned the coupling function to the identity.
SimonCan Aug 2, 2023
eaeec5b
Updated coupling tests.
SimonCan Aug 2, 2023
f161938
Updated errors for coupled test.
SimonCan Aug 3, 2023
fe5312b
Merge branch 'main' into sc/converters_coupling
SimonCan Aug 16, 2023
569da04
Added advice about binary compatability for coupled equations in the …
SimonCan Sep 7, 2023
ab417e7
Merge branch 'main' into sc/converters_coupling
SimonCan Sep 19, 2023
93fc571
Typo.
SimonCan Sep 19, 2023
fac0410
Merge branch 'main' into sc/converters_coupling
SimonCan Sep 28, 2023
00e5150
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 2, 2023
b42d753
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 4, 2023
d3334a8
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 4, 2023
ed1fec9
Added numerical fluxes.
SimonCan Oct 5, 2023
3ea484d
Corrected rs copy routine. Now loop over this semi's components.
SimonCan Oct 6, 2023
e5a5dfb
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 9, 2023
c87095e
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 10, 2023
bfd4ec1
Reformatted equations source file.
SimonCan Oct 11, 2023
5ff438a
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 12, 2023
f3e1ee6
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 13, 2023
c4bc8b3
Removed problemating include of time_integration.jl.
SimonCan Oct 16, 2023
cdd984a
Removed export of deleted methods.
SimonCan Oct 16, 2023
4668b26
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 18, 2023
e572ac0
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 19, 2023
6eb92b6
Reverted to old version of compressible Euler multicomponent with no …
SimonCan Oct 20, 2023
8d26189
Renamed documentation file for multi-physics coupling.
SimonCan Oct 20, 2023
afbcc9d
Renamed doc reference.
SimonCan Oct 20, 2023
e730c9a
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Oct 20, 2023
29f82f9
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 20, 2023
2747e85
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 24, 2023
1cbed94
Update docs/src/multi-physics_coupling.md
SimonCan Oct 24, 2023
fefbe59
Update docs/src/multi-physics_coupling.md
SimonCan Oct 24, 2023
f9ab642
Update docs/src/multi-physics_coupling.md
SimonCan Oct 24, 2023
b1f63dc
Reinstated structured_2d_dgsem coupled in special tests.
SimonCan Oct 24, 2023
4c3254b
Update examples/structured_2d_dgsem/elixir_advection_coupled.jl
SimonCan Oct 24, 2023
64e8dda
Renamed CouplingFunction to CouplingConverter.
SimonCan Oct 24, 2023
bd59f72
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Oct 24, 2023
2331cc1
Cleaned the copy of coupled boundary values.
SimonCan Oct 24, 2023
35bffba
Reduced time span for example coupling elixir.
SimonCan Oct 24, 2023
488cef8
Removed redundant loop.
SimonCan Oct 24, 2023
81a10d0
Applied formatter.
SimonCan Oct 24, 2023
f407e1a
git pushMerge branch 'sc/converters_coupling' of github.com:trixi-fra…
SimonCan Oct 24, 2023
0579dc1
Removed default coupling covnerter function.
SimonCan Oct 24, 2023
baf28fd
Moved coupling converter function into elixir.
SimonCan Oct 24, 2023
7c3d558
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 24, 2023
a4971a5
Apply suggestions from code review
sloede Oct 25, 2023
3491b1a
Update docs/make.jl
sloede Oct 25, 2023
0ff77e2
Removed coupling_converters.jl from the include.
SimonCan Oct 25, 2023
1993560
Corrected introduced issue with coupling boundary copy.
SimonCan Oct 25, 2023
d5129e2
Corrected comment on final simulation time.
SimonCan Oct 25, 2023
21f203f
Updated errors for coupled test to reflect changed final simulation t…
SimonCan Oct 25, 2023
fe4b216
Merge branch 'main' into sc/converters_coupling
SimonCan Oct 25, 2023
4f92bc6
Added miladd.
SimonCan Oct 30, 2023
8789c4b
Corrected coordinate finding in semidiscretization_coupled.
SimonCan Nov 3, 2023
87609bc
Fixed issued related to memory allocation.
SimonCan Nov 3, 2023
2906208
Corrected loop over semidiscretization.
SimonCan Nov 3, 2023
9ee224f
Removed commented out code.
SimonCan Nov 3, 2023
329cbf6
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 6, 2023
dd847e4
Fixed type instability with loops over semidiscretizations using
SimonCan Nov 7, 2023
a54a9e8
Removed obsolete code.
SimonCan Nov 8, 2023
eb14606
Fixed another typa instability in coupled semidiscretization.
SimonCan Nov 8, 2023
20a1676
Cleaning up of the coupled semidiscretization.
SimonCan Nov 8, 2023
58ec8fb
Autoformatted coupled semidiscretization.
SimonCan Nov 8, 2023
52fcb5b
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 8, 2023
ee197c1
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 9, 2023
6886bff
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 13, 2023
49b121e
Fixed last type instability in coupling.
SimonCan Nov 14, 2023
3b5d492
Autoformatter on semidiscretization.
SimonCan Nov 14, 2023
538e401
Fixed bug in boundary values copy that arose when coupling multiple s…
SimonCan Nov 15, 2023
e6b621a
aplpied autoformatter on coupled semidiscretization.
SimonCan Nov 15, 2023
9da5c9f
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 16, 2023
03f7696
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 17, 2023
8b6f7b3
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 20, 2023
cf262a8
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 21, 2023
6737a43
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 23, 2023
2a7fea3
Extended the structured 2d example elixir for the coupled advection
SimonCan Nov 23, 2023
e8c2d52
Updated test results for coupled advection in 2d to reflect
SimonCan Nov 23, 2023
4f76579
Added correct errors for tests for the coupled adveciton equations in…
SimonCan Nov 24, 2023
756eaf1
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 24, 2023
8414741
Merge branch 'main' into sc/converters_coupling
SimonCan Nov 29, 2023
3ea1967
Merge branch 'main' into sc/converters_coupling
SimonCan Dec 4, 2023
824217c
Merge branch 'main' into sc/converters_coupling
SimonCan Dec 8, 2023
418796a
Update examples/structured_2d_dgsem/elixir_advection_coupled.jl
SimonCan Dec 11, 2023
fa4852b
Update examples/structured_2d_dgsem/elixir_advection_coupled.jl
SimonCan Dec 11, 2023
9b55294
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
c830e22
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
e064a56
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
9d8f4e5
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
6c60c3e
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
388a309
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
0e7fd19
Update src/semidiscretization/semidiscretization_coupled.jl
SimonCan Dec 11, 2023
b4493a2
Corrected foreach_enumerate implementation.
SimonCan Dec 11, 2023
98f7eed
Merge branch 'sc/converters_coupling' of github.com:trixi-framework/T…
SimonCan Dec 11, 2023
bbca47e
Merge branch 'main' into sc/converters_coupling
sloede Dec 14, 2023
4753bf5
Merge branch 'main' into sc/converters_coupling
SimonCan Dec 17, 2023
012e01e
Merge branch 'main' into sc/converters_coupling
sloede Dec 19, 2023
34e6fcd
Fix closing parens
sloede Dec 19, 2023
4c2b90b
Remove unused recursive rhs!
sloede Dec 19, 2023
f0911c0
Pass equations to converter function
sloede Dec 19, 2023
dbf2aea
Apply formatting
sloede Dec 19, 2023
307f68a
Merge branch 'main' into sc/converters_coupling
SimonCan Jan 4, 2024
401e835
Reverted copy_to_coupled_boundary to previou version
SimonCan Jan 9, 2024
6472d36
Corrected computation of coupled semidiscretizations and fixed memory…
SimonCan Jan 11, 2024
52f7645
Removed redundant nelements function, as it is no longer used.
SimonCan Jan 15, 2024
dc9dda2
Merge branch 'main' into sc/converters_coupling
SimonCan Jan 15, 2024
9bfc7cc
Applied autoformatter.
SimonCan Jan 15, 2024
26e4c94
Merge branch 'main' into sc/converters_coupling
SimonCan Jan 22, 2024
6eccc51
Added max_abs_speed_naive( and max_abs_speed_naive for PolytropicEule…
SimonCan Jan 29, 2024
0994011
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Jan 29, 2024
673a51a
Reverted coupling elixir to main branch version.
SimonCan Jan 30, 2024
ea74285
Removed some modified coupling code as this should be part of a diffe…
SimonCan Jan 30, 2024
7975e9d
Reverted changes on ooupling semidiscretization as this should be par…
SimonCan Jan 30, 2024
35f7c0d
Reverted changes partaining the coupling PR.
SimonCan Jan 30, 2024
7ab4a73
Merge branch 'sc/polytropic_2d_wave_speed' of github.com:trixi-framew…
SimonCan Jan 30, 2024
f437ec9
Removed changes partaining coupling PR.
SimonCan Jan 30, 2024
b659ce2
REverted to version including elixir_euler_warm_bubble.jl tests.
SimonCan Jan 30, 2024
8c5eb3b
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 30, 2024
66457c2
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 30, 2024
b891b5b
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 30, 2024
39168e3
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Jan 30, 2024
2007993
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 30, 2024
a168e88
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 30, 2024
e0fd66e
Update src/equations/polytropic_euler_2d.jl
SimonCan Jan 31, 2024
35c8787
Added consistency and rotation test for LAx-friedrich fluxes for poly…
iomsn Feb 1, 2024
a28b554
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Feb 1, 2024
7a5771c
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Feb 5, 2024
debca0e
Applied auto-formatter on polytropic 2d equation.
iomsn Feb 5, 2024
a025612
Merge branch 'sc/polytropic_2d_wave_speed' of https://github.com/trix…
iomsn Feb 5, 2024
cf3320d
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Feb 7, 2024
4f5cc57
Update src/equations/polytropic_euler_2d.jl
SimonCan Feb 15, 2024
d47880c
Merge branch 'main' into sc/polytropic_2d_wave_speed
SimonCan Feb 15, 2024
3f4ec02
Merge branch 'main' into sc/polytropic_2d_wave_speed
andrewwinters5000 Feb 16, 2024
994d7ff
Merge branch 'main' into sc/polytropic_2d_wave_speed
andrewwinters5000 Feb 16, 2024
5f82e11
Merge branch 'main' into sc/polytropic_2d_wave_speed
andrewwinters5000 Feb 20, 2024
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
40 changes: 40 additions & 0 deletions src/equations/polytropic_euler_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,46 @@ end
return abs(v1) + c, abs(v2) + c
end

# Calculate maximum wave speed for local Lax-Friedrichs-type dissipation as the
# maximum velocity magnitude plus the maximum speed of sound
@inline function max_abs_speed_naive(u_ll, u_rr, orientation::Integer,
equations::PolytropicEulerEquations2D)
rho_ll, v1_ll, v2_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr = cons2prim(u_rr, equations)

# Get the velocity value in the appropriate direction
if orientation == 1
v_ll = v1_ll
v_rr = v1_rr
else # orientation == 2
v_ll = v2_ll
v_rr = v2_rr
end
# Calculate sound speeds (we have p = kappa * rho^gamma)
c_ll = sqrt(equations.gamma * equations.kappa * rho_ll^(equations.gamma - 1))
c_rr = sqrt(equations.gamma * equations.kappa * rho_rr^(equations.gamma - 1))

λ_max = max(abs(v_ll), abs(v_rr)) + max(c_ll, c_rr)
end

@inline function max_abs_speed_naive(u_ll, u_rr, normal_direction::AbstractVector,
equations::PolytropicEulerEquations2D)
rho_ll, v1_ll, v2_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr = cons2prim(u_rr, equations)

# Calculate normal velocities and sound speed (we have p = kappa * rho^gamma)
# left
v_ll = v1_ll * normal_direction[1] +
v2_ll * normal_direction[2]
c_ll = sqrt(equations.gamma * equations.kappa * rho_ll^(equations.gamma - 1))
# right
v_rr = v1_rr * normal_direction[1] +
v2_rr * normal_direction[2]
SimonCan marked this conversation as resolved.
Show resolved Hide resolved
c_rr = sqrt(equations.gamma * equations.kappa * rho_rr^(equations.gamma - 1))

return max(abs(v_ll), abs(v_rr)) + max(c_ll, c_rr) * norm(normal_direction)
end

# Convert conservative variables to primitive
@inline function cons2prim(u, equations::PolytropicEulerEquations2D)
rho, rho_v1, rho_v2 = u
Expand Down
24 changes: 24 additions & 0 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,30 @@ end
end
end

@timed_testset "Consistency check for Lax-Friedrich flux: Polytropic CEE" begin
for gamma in [1.4, 1.0, 5 / 3]
kappa = 0.5 # Scaling factor for the pressure.
equations = PolytropicEulerEquations2D(gamma, kappa)
u = SVector(1.1, -0.5, 2.34)

orientations = [1, 2]
for orientation in orientations
@test flux_lax_friedrichs(u, u, orientation, equations) ≈
flux(u, orientation, equations)
end

normal_directions = [SVector(1.0, 0.0),
SVector(0.0, 1.0),
SVector(0.5, -0.5),
SVector(-1.2, 0.3)]

for normal_direction in normal_directions
@test flux_lax_friedrichs(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end
end
end

@timed_testset "Consistency check for HLL flux with Davis wave speed estimates: LEE" begin
flux_hll = FluxHLL(min_max_speed_davis)

Expand Down
Loading