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

Update input params for diffusion regression problems #188

Merged
merged 3 commits into from
Dec 3, 2018
Merged

Update input params for diffusion regression problems #188

merged 3 commits into from
Dec 3, 2018

Conversation

pdmullen
Copy link
Contributor

@pdmullen pdmullen commented Nov 30, 2018

Prerequisite checklist

  • My code follows the Athena++ Style Guide
  • My change requires a change to the documentation.
  • I have updated the documentation in the Wiki accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Pleas review the CONTRIBUTING.md file for detailed guidelines.

Description

@tomidakn found a bug in the explicit integration of non-ideal MHD in 1-D; this bug was fixed in b25e401. None of the test problems in the diffusion regression suite identified this bug. The reason why: this bug only occurs when a non-ideal MHD problem has nx2=nx3=1, and none of the existing problems have this mesh type.

Presently, the diffusion/*_diffusion(_sts) test problems have nx2=16. This choice of nx2 has been carried over since the inception of resist.cpp/athinput.resist and visc.cpp/athinput.visc in 83a94d7.

This pull request simply changes nx2=nx3=1 for these 1-D convergence test problems (and accordingly changes the cfl_number). NOTE: diffusion/resistive_diffusion would have failed this test problem prior to b25e401. However, diffusion/resistive_diffusion_sts would have passed this test problem prior to b25e401 because EMF's are added in a different way when super-time-stepping.

Testing and validation

All 1-D diffusion problems converge at the expected order using both explicit integration and super-time-stepping schemes. The 3-D diffusion/linear_wave3d(_sts) tests remain unchanged and still pass.

To-do

There needs to be a more robust diffusion test suite. The only convergence test problems available now are those for Ohmic and viscous diffusion, which are only 1D. Furthermore, there are no test problems for diffusive physics in curvilinear coordinates (see #171 ). It seems that this should be relatively straightforward-- @jmshi introduced variations of resist.cpp and visc.cpp that operate on different mesh-types and even curvilinear coordinates. Perhaps these could be adapted into test problems and perhaps even address #171 (@jmshi ) ?

@buildbot-princeton
Copy link
Collaborator

Can one of the admins verify this patch?

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #188 into master will decrease coverage by 21.72%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #188       +/-   ##
===========================================
- Coverage   51.17%   29.46%   -21.72%     
===========================================
  Files         132      114       -18     
  Lines       28520    22569     -5951     
  Branches     9224     7630     -1594     
===========================================
- Hits        14595     6648     -7947     
- Misses      11116    13913     +2797     
+ Partials     2809     2008      -801

@felker
Copy link
Contributor

felker commented Nov 30, 2018

ok to test

@felker felker self-assigned this Nov 30, 2018
@felker felker added testing Regression test suite and CI MHD Relating to components involving the B field labels Nov 30, 2018
@felker felker added this to the v1.1.x milestone Nov 30, 2018
@felker
Copy link
Contributor

felker commented Nov 30, 2018

This PR makes all of those tests 1D only, right? While I am all for the speedup of these tests (overall, the set of 2D tests in diffusion/ take a long time in the CI services), does this not hurt code coverage of the 2D, 3D versions of these calculations? We will know for sure once Jenkins completes the testing of my latest fixes to Codecov in 2ba64f8.

Ideally, all of these tests would repeat for 1D, 2D, 3D, given the very different behaviors of the CT algorithm in each case. This was my interpretation of Kengo's comments in b25e401#commitcomment-31508197

@pdmullen
Copy link
Contributor Author

pdmullen commented Nov 30, 2018

That is correct. This makes the diffusion/*_diffusion(_sts) test problems purely 1D. Setting nx2=16 in these problems was just a remnant from when athinput.resist and athinput.visc were first committed. The diffusion is only in 1D, so the problems should be 1D.

The diffusion/linear_wave3d(_sts) problems still test higher dimensions--so in some regard this PR may (?) increase code coverage because the if (nx2==1) code was never accessed prior.

Nevertheless, I agree with all comments in b25e401 that 2D problems should be made available. I think the obvious choice is to diffuse a B-field (or velocity field) that is initialized diagonally in a 2D domain. I'll assign myself this on Project Board (https://github.com/PrincetonUniversity/athena/projects/1#card-15353779).

In the near future, I also see it imperative that we include 3D diffusion convergence tests and tests in curvilinear coordinates (the latter should dramatically increase code coverage).

@felker felker merged commit b05d6bc into PrincetonUniversity:master Dec 3, 2018
@felker felker deleted the update/diffusion-regression branch December 3, 2018 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MHD Relating to components involving the B field testing Regression test suite and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants