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

Adding primitive variable Dirichlet BCs for Navier-Stokes parabolic terms for P4estMesh{2} #1553

Merged
merged 13 commits into from
Oct 8, 2023

Conversation

apey236
Copy link
Contributor

@apey236 apey236 commented Jun 27, 2023

No description provided.

@jlchan jlchan changed the title Adding Dirichlet BCs for Navier-Stokes parabolic terms for P4estMesh{2} Adding primitive variable Dirichlet BCs for Navier-Stokes parabolic terms for P4estMesh{2} Jun 27, 2023
@jlchan
Copy link
Contributor

jlchan commented Jun 27, 2023

@apey236 the formatting check failed. Can you use JuliaFormatter.jl to format the changed files? You should also be able to format the src directory.

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #1553 (fb82c77) into main (ce81702) will increase coverage by 3.24%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1553      +/-   ##
==========================================
+ Coverage   92.90%   96.14%   +3.24%     
==========================================
  Files         402      403       +1     
  Lines       33034    33158     +124     
==========================================
+ Hits        30690    31879    +1189     
+ Misses       2344     1279    -1065     
Flag Coverage Δ
unittests 96.14% <100.00%> (+3.24%) ⬆️

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

Files Changed Coverage Δ
...sem/elixir_navierstokes_convergence_nonperiodic.jl 100.00% <100.00%> (ø)
src/equations/compressible_navier_stokes_2d.jl 98.25% <100.00%> (+0.08%) ⬆️

... and 40 files with indirect coverage changes

@jlchan
Copy link
Contributor

jlchan commented Jun 28, 2023

@apey236 when you are ready, please re-request a review from me.

@ranocha @andrewwinters5000 if either of you have time, it would be great to get a review from you on this as well.

@jlchan jlchan self-requested a review June 28, 2023 17:44
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Seems reasonable but a review from @andrewwinters5000 would be nice

@ranocha
Copy link
Member

ranocha commented Jul 28, 2023

@andrewwinters5000 Do you have time for a review?

@ranocha
Copy link
Member

ranocha commented Jul 28, 2023

@apey236 @jlchan Could you please look into the precompilation warnings we get after merging your p4est PR recently?

@jlchan
Copy link
Contributor

jlchan commented Jul 28, 2023

Yes, will look at it tomorrow

@jlchan
Copy link
Contributor

jlchan commented Jul 28, 2023

Interesting; all functions causing CI issues were tagged with !!! TODO: Figure out why this cannot removed eventhough it exists in the dg_2d_parabolic.jl file. Removing them fixes the issue, and it still works locally. I'll make a PR to fix this.

Edit: #1593

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 assume that you have run convergence_test and verified that you get the correct EOCs. It will be useful to have these boundary conditions and a convergence elixir available on P4estMesh for testing the further development of the parabolic mortars implementation from #1571

@jlchan
Copy link
Contributor

jlchan commented Aug 1, 2023

I don't think we checked convergence_test - @apey236 can you check this? There are some examples of it being called in the test directory.

@jlchan
Copy link
Contributor

jlchan commented Aug 7, 2023

Bump - @apey236 can you post the results of convergence_test to this thread?

@apey236
Copy link
Contributor Author

apey236 commented Aug 8, 2023

@andrewwinters5000 > LGTM, I assume that you have run convergence_test and verified that you get the correct EOCs. It will be useful to have these boundary conditions and a convergence elixir available on P4estMesh for testing the further development of the parabolic mortars implementation from #1571

Here is the convergence test on "/p4est_2d_dgsem/elixir_navierstokes_convergence_nonperiodic.jl" example:

####################################################################################################
l2
rho rho_v1 rho_v2 rho_e
error EOC error EOC error EOC error EOC
5.02e-06 - 2.13e-05 - 1.56e-05 - 1.84e-05 -
7.86e-08 6.00 1.86e-07 6.84 1.49e-07 6.71 5.08e-07 5.18
1.86e-09 5.40 2.40e-09 6.28 1.54e-09 6.60 1.51e-08 5.07

mean 5.70 mean 6.56 mean 6.66 mean 5.13

linf
rho rho_v1 rho_v2 rho_e
error EOC error EOC error EOC error EOC
3.45e-05 - 3.44e-04 - 8.93e-05 - 1.31e-04 -
4.33e-07 6.32 2.56e-06 7.07 5.03e-07 7.47 1.80e-06 6.19
2.56e-08 4.08 5.16e-08 5.63 4.62e-08 3.44 4.94e-07 1.87

mean 5.20 mean 6.35 mean 5.46 mean 4.03

Dict{Symbol, Any} with 3 entries:
:variables => ("rho", "rho_v1", "rho_v2", "rho_e")
:l2 => [5.7011, 6.55785, 6.65646, 5.12526]
:linf => [5.19767, 6.35028, 5.45823, 4.02554]

@apey236 apey236 requested a review from ranocha August 8, 2023 20:07
@ranocha ranocha removed their request for review August 9, 2023 04:03
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.

Interesting, the EOCs look fine from the convergence test but perhaps a bit better than expected. For a polydeg=3 we typically see that a mesh refinement study, like the one you have performed, gives an EOC of approximately p+1 (so 4 in this case). That you are achieving an EOC of p+2 is an unexpected surprise.

I think it is because the manufactured solution rho = c + A * sin(pi_x) * cos(pi_y) * cos(pi_t) is approximately 0.0 at the final time you chose in the tspan=(0.0, 0.5). It is always dangerous to test convergence around an exact solution near zero because of round-off errors. I am relatively sure that the implementation of the new BCs is working properly. However, and I know it is a pain, could you rerun the EOC test with tspan=(0.0, 0.75)? For this I expect that the EOC values will be closer to the expected p+1 values.

@apey236
Copy link
Contributor Author

apey236 commented Aug 9, 2023

Interesting, the EOCs look fine from the convergence test but perhaps a bit better than expected. For a polydeg=3 we typically see that a mesh refinement study, like the one you have performed, gives an EOC of approximately p+1 (so 4 in this case). That you are achieving an EOC of p+2 is an unexpected surprise.

I think it is because the manufactured solution rho = c + A * sin(pi_x) * cos(pi_y) * cos(pi_t) is approximately 0.0 at the final time you chose in the tspan=(0.0, 0.5). It is always dangerous to test convergence around an exact solution near zero because of round-off errors. I am relatively sure that the implementation of the new BCs is working properly. However, and I know it is a pain, could you rerun the EOC test with tspan=(0.0, 0.75)? For this I expect that the EOC values will be closer to the expected p+1 values.

@andrewwinters5000, you are right. I changed the time span to 0.75 and now here is the results of the convergence test:

####################################################################################################
l2
rho rho_v1 rho_v2 rho_e
error EOC error EOC error EOC error EOC
1.07e-05 - 2.06e-05 - 2.60e-05 - 5.72e-05 -
6.92e-07 3.95 1.02e-06 4.33 1.42e-06 4.20 3.88e-06 3.88
4.79e-08 3.85 5.08e-08 4.33 6.55e-08 4.43 2.82e-07 3.78

mean 3.90 mean 4.33 mean 4.32 mean 3.83

linf
rho rho_v1 rho_v2 rho_e
error EOC error EOC error EOC error EOC
7.31e-05 - 3.16e-04 - 1.27e-04 - 7.73e-04 -
5.88e-06 3.64 1.88e-05 4.07 8.01e-06 3.99 5.43e-05 3.83
4.24e-07 3.79 8.56e-07 4.45 4.40e-07 4.19 3.63e-06 3.90

mean 3.71 mean 4.26 mean 4.09 mean 3.87

Dict{Symbol, Any} with 3 entries:
:variables => ("rho", "rho_v1", "rho_v2", "rho_e")
:l2 => [3.8991, 4.33148, 4.31606, 3.83189]
:linf => [3.71468, 4.26389, 4.08836, 3.86772]

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.

The new EOCS and everything LGTM!

jlchan
jlchan previously approved these changes Aug 10, 2023
@jlchan jlchan dismissed stale reviews from andrewwinters5000 and themself via ab9da82 October 6, 2023 17:41
@jlchan
Copy link
Contributor

jlchan commented Oct 7, 2023

@ranocha @andrewwinters5000 we previously approved this PR, but I forgot to merge. After updating, it looks like the MPI and threaded windows tests are failing, but the issues don't seem related to this PR. OK to merge or would you like us to wait until CI is fixed?

@ranocha
Copy link
Member

ranocha commented Oct 8, 2023

We can merge this now. The same kind of CI failures appear in other PRs

@ranocha ranocha merged commit 22856f4 into trixi-framework:main Oct 8, 2023
27 of 29 checks passed
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.

4 participants