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

Move some initial conditions (mostly 1D) #847

Merged
merged 15 commits into from
Sep 12, 2021
Merged

Move some initial conditions (mostly 1D) #847

merged 15 commits into from
Sep 12, 2021

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Sep 9, 2021

Contributes to #685

@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #847 (4d9e924) into main (1dcb022) will decrease coverage by 0.00%.
The diff coverage is 96.48%.

❗ Current head 4d9e924 differs from pull request most recent head 4f3a7f2. Consider uploading reports for the commit 4f3a7f2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #847      +/-   ##
==========================================
- Coverage   92.96%   92.96%   -0.00%     
==========================================
  Files         190      211      +21     
  Lines       17815    17880      +65     
==========================================
+ Hits        16561    16621      +60     
- Misses       1254     1259       +5     
Flag Coverage Δ
unittests 92.96% <96.48%> (-<0.01%) ⬇️

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

Impacted Files Coverage Δ
src/Trixi.jl 66.67% <ø> (ø)
src/equations/compressible_euler_1d.jl 92.45% <ø> (+0.15%) ⬆️
src/equations/compressible_euler_2d.jl 94.08% <ø> (-0.09%) ⬇️
src/equations/compressible_euler_3d.jl 95.09% <ø> (-0.11%) ⬇️
src/equations/hyperbolic_diffusion_1d.jl 84.51% <ø> (ø)
src/equations/ideal_glm_mhd_1d.jl 91.98% <ø> (-1.03%) ⬇️
src/equations/ideal_glm_mhd_2d.jl 93.60% <ø> (-0.20%) ⬇️
src/equations/ideal_glm_mhd_multicomponent_1d.jl 95.90% <ø> (-0.22%) ⬇️
examples/tree_1d_dgsem/elixir_euler_blast_wave.jl 88.89% <88.89%> (ø)
...r_euler_blast_wave_neuralnetwork_perssonperaire.jl 88.89% <88.89%> (ø)
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dcb022...4f3a7f2. Read the comment docs.

@ranocha ranocha requested a review from jlchan September 11, 2021 09:11
Copy link
Contributor

@jlchan jlchan left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Out of curiosity, how did you choose which ICs to keep as exported?

NEWS.md Show resolved Hide resolved
Comment on lines +23 to +29
rho = x[1] <= x_0 ? 3.5 : 1.0 + 0.2 * sin(5.0 * x[1])
v1 = x[1] <= x_0 ? 5.8846 : 0.0
v2 = x[1] <= x_0 ? 1.1198 : 0.0
v3 = 0.0
p = x[1] <= x_0 ? 42.0267 : 1.0
B1 = 1.0
B2 = x[1] <= x_0 ? 3.6359 : 1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question on <= vs <

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewwinters5000? You added this in 53fd46a

Copy link
Member

Choose a reason for hiding this comment

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

This is the setup that Dominik and I used back in the day for the FLASH code. He found it in this PhD thesis https://uwspace.uwaterloo.ca/handle/10012/8597

Comment on lines +26 to +33
rho = x[1] <= 0.5 ? 1.08 : 1.0
v1 = x[1] <= 0.5 ? 1.2 : 0.0
v2 = x[1] <= 0.5 ? 0.01 : 0.0
v3 = x[1] <= 0.5 ? 0.5 : 0.0
p = x[1] <= 0.5 ? 0.95 : 1.0
inv_sqrt4pi = 1.0 / sqrt(4 * pi)
B1 = 2 * inv_sqrt4pi
B2 = x[1] <= 0.5 ? 3.6 * inv_sqrt4pi : 4.0 * inv_sqrt4pi
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, why <= and not < here? The Brio-Wu shock tube also uses <.

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewwinters5000? You added this in 53fd46a

Copy link
Member

Choose a reason for hiding this comment

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

The Ryu & Jones reference is slightly ambiguous in that they just define a left and right state but don't actually state things in terms of < versus <= so I just made a decision. The same is true for the Torrilhon shocktube test. For Brio & Wu I followed how FLASH does it and they use the <

Comment on lines +48 to +54
rho = x[1] <= x_0 ? 1.0 + 0.2 * sin(5.0 * x[1]) : 3.5
v1 = x[1] <= x_0 ? 0.0 : -5.8846
v2 = x[1] <= x_0 ? 0.0 : -1.1198
v3 = 0.0
p = x[1] <= x_0 ? 1.0 : 42.0267
B1 = 1.0
B2 = x[1] <= x_0 ? 1.0 : 3.6359
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question on <= vs <

Comment on lines +20 to +27
rho = x[1] <= 0 ? 3.0 : 1.0
v1 = 0.0
v2 = 0.0
v3 = 0.0
p = x[1] <= 0 ? 3.0 : 1.0
B1 = 1.5
B2 = x[1] <= 0 ? 1.0 : cos(1.5)
B3 = x[1] <= 0 ? 0.0 : sin(1.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question on <= vs <

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewwinters5000? You added this in 518899d

Comment on lines +23 to +26
prim_rho = SVector{ncomponents(equations), real(equations)}(2^(i-1) * (1-2)/(1-2^ncomponents(equations)) * rho for i in eachcomponent(equations))
else
rho = 0.125
prim_rho = SVector{ncomponents(equations), real(equations)}(2^(i-1) * (1-2)/(1-2^ncomponents(equations)) * rho for i in eachcomponent(equations))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why (1-2) and not just -1?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Cczernik? You added this in #449

Copy link
Contributor

Choose a reason for hiding this comment

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

No deeper meaning, -1 can also be used

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.

I didn't do a full review but left a few comments. Overall, I'm ok with this PR, I just would like to have at least one "canonical" setup in the Trixi that is entropy-producing (but I think the medium Sedov blast accounts for that).

@jlchan
Copy link
Contributor

jlchan commented Sep 11, 2021

I didn't do a full review but left a few comments. Overall, I'm ok with this PR, I just would like to have at least one "canonical" setup in the Trixi that is entropy-producing (but I think the medium Sedov blast accounts for that).

Doesn't any discontinuous IC also produce entropy? I seem to remember the weak blast wave being used as an entropy conservation test.

@sloede
Copy link
Member

sloede commented Sep 11, 2021

I didn't do a full review but left a few comments. Overall, I'm ok with this PR, I just would like to have at least one "canonical" setup in the Trixi that is entropy-producing (but I think the medium Sedov blast accounts for that).

Doesn't any discontinuous IC also produce entropy? I seem to remember the weak blast wave being used as an entropy conservation test.

Yes, but the weak blast wave is so weak that it is not a very hard test case for EC/ES schemes. You can run it with an EC flux and it remains stable IIRC

Co-authored-by: Jesse Chan <[email protected]>
@ranocha ranocha requested review from sloede and jlchan September 12, 2021 04:59
sloede
sloede previously approved these changes Sep 12, 2021
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.

with the remaining comments resolved, this LGTM

src/equations/compressible_euler_3d.jl Outdated Show resolved Hide resolved
test/test_tree_1d_mhd.jl Show resolved Hide resolved
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
@ranocha
Copy link
Member Author

ranocha commented Sep 12, 2021

I would like to keep the questions on specific implementations of some ICs open (since this PR didn't change them at all, just moved them somewhere else). This allows us to merge this one soon and move on while we can keep discussing the open questions here and make new PRs if appropriate.

@ranocha
Copy link
Member Author

ranocha commented Sep 12, 2021

Out of curiosity, how did you choose which ICs to keep as exported?

I concentrated on 1D here. Thus, I touched only the 2D/3D parts that were necessary after doing the 1D changes. My rules were

  • Keep academic test cases in src (constant IC, convergence test, weak blast wave as EC test)
  • Move "known" examples to examples (Sedov blast wave)

I tried to follow #685 (comment) and #237 (comment)

@jlchan
Copy link
Contributor

jlchan commented Sep 12, 2021

Sounds good. Since my comments were mostly on old commits we can ignore those for this PR. LGTM - feel free to merge when ready.

@ranocha ranocha merged commit c792bb7 into main Sep 12, 2021
@ranocha ranocha deleted the hr/ics branch September 12, 2021 13:20
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