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

Sc/polytropic #1526

Merged
merged 132 commits into from
Oct 19, 2023
Merged

Sc/polytropic #1526

merged 132 commits into from
Oct 19, 2023

Conversation

SimonCan
Copy link
Contributor

@SimonCan SimonCan commented Jun 13, 2023

Polytropic compressible Euler equations in 2d. Can be used to simulate compressible isothermal Euler equations. No viscosity is involved here.

TODO:

  • Write tests.
  • Add examples.

Convergence tests using examples/structured_2d_dgsem/elixir_eulerpolytropic_convergence.jl:

####################################################################################################
l2
rho                 rho_v1              rho_v2
error     EOC       error     EOC       error     EOC
1.67e-03  -         2.59e-03  -         3.28e-03  -
1.32e-04  3.66      1.34e-04  4.27      2.06e-04  3.99
1.02e-05  3.70      8.57e-06  3.97      1.24e-05  4.06
6.56e-07  3.96      5.26e-07  4.03      7.26e-07  4.09
3.58e-08  4.20      3.09e-08  4.09      4.52e-08  4.01

mean      3.88      mean      4.09      mean      4.04
----------------------------------------------------------------------------------------------------
linf
rho                 rho_v1              rho_v2
error     EOC       error     EOC       error     EOC
1.10e-02  -         1.33e-02  -         2.01e-02  -
1.13e-03  3.28      9.13e-04  3.87      1.90e-03  3.40
1.09e-04  3.38      8.65e-05  3.40      1.27e-04  3.90
7.76e-06  3.82      5.84e-06  3.89      7.93e-06  4.00
4.50e-07  4.11      3.45e-07  4.08      4.92e-07  4.01

mean      3.64      mean      3.81      mean      3.83
----------------------------------------------------------------------------------------------------
Dict{Symbol, Any} with 3 entries:
  :variables => ("rho", "rho_v1", "rho_v2")
  :l2        => [3.87748, 4.08884, 4.03706]
  :linf      => [3.64439, 3.80898, 3.82941]

Entropy conservation test using examples/structured_2d_dgsem/elixir_eulerpolytropic_ec_shockcapturing.jl:

∂S/∂U ⋅ Uₜ :   2.02384406e-17

@SimonCan SimonCan marked this pull request as draft June 13, 2023 10:57
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (dfdaef5) 87.95% compared to head (462bf61) 96.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1526      +/-   ##
==========================================
+ Coverage   87.95%   96.09%   +8.14%     
==========================================
  Files         419      423       +4     
  Lines       34159    34335     +176     
==========================================
+ Hits        30043    32992    +2949     
+ Misses       4116     1343    -2773     
Flag Coverage Δ
unittests 96.09% <100.00%> (+8.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/structured_2d_dgsem/elixir_eulerpolytropic_ec.jl 100.00% <100.00%> (ø)
...2d_dgsem/elixir_eulerpolytropic_isothermal_wave.jl 100.00% <100.00%> (ø)
...structured_2d_dgsem/elixir_eulerpolytropic_wave.jl 100.00% <100.00%> (ø)
src/Trixi.jl 43.48% <ø> (-9.15%) ⬇️
src/auxiliary/math.jl 100.00% <100.00%> (ø)
src/equations/equations.jl 98.04% <ø> (ø)
src/equations/polytropic_euler_2d.jl 100.00% <100.00%> (ø)

... and 57 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SimonCan SimonCan requested a review from sloede June 14, 2023 08:57
@sloede sloede marked this pull request as ready for review June 16, 2023 20:53
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall this looks already very good to me. I have a left only a few minor comments. once resolved, could you please also apply the formatter?

src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
@SimonCan SimonCan requested a review from sloede June 22, 2023 07:43
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review part 1/2. Second part will follow

examples/structured_2d_dgsem/elixir_euler_polytropic.jl Outdated Show resolved Hide resolved
examples/structured_2d_dgsem/elixir_euler_polytropic.jl Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second part of the review 🙂

src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/polytropic_euler_2d.jl Outdated Show resolved Hide resolved
@andrewwinters5000
Copy link
Member

andrewwinters5000 commented Jul 3, 2023

Just a comment on the naming convention used for the new system. I think it is misleading to call this new system PolytropicEuler.

From what I can tell the goal here is to implement the isothermal Euler equations where gamma = 1 and p(rho) = kappa * rho, then we use it in some kind of coupled simulation. Along the way, assuming isothermal Euler, the internal energy is e(rho) = kappa * log(rho) and the flux from Hendrik should work directly for EC/ES by removing the total energy equation contributions.

Generalizing to polytropic Euler, we take gamma > 1 and p(rho) = kappa * rho^gamma so this part is still valid in the isothermal limit because the correct pressure equation is recovered. However, the internal energy for the polytropic Euler changes to be e(rho) = kappa * rho^(gamma-1)/(gamma-1), which necessitates a new form of the EC flux.

@SimonCan
Copy link
Contributor Author

All tests pass now. We might be ready for merging.

@SimonCan SimonCan enabled auto-merge (squash) October 16, 2023 09:10
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very last comment (sorry, this was an oversight by me earlier 🙈), then ready to merge!

test/test_structured_2d.jl Outdated Show resolved Hide resolved
sloede
sloede previously approved these changes Oct 18, 2023
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I just left one small suggestion on a comment in one of the new elixirs.

@sloede sloede disabled auto-merge October 19, 2023 03:51
@sloede sloede merged commit bb60b5d into main Oct 19, 2023
29 of 30 checks passed
@sloede sloede deleted the sc/polytropic branch October 19, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants