-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
evolve_pressure: Important fix to P boundary
Must clear P parallel slices or Grad_par will use them. Alternatively, setBoundaryTo should clear the parallel slices if they are not set in the argument.
- Loading branch information
Showing
2 changed files
with
2 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97a21fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bendudson, what does clearParallelSlices do?
97a21fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two ways to take parallel derivatives in BOUT++: One is to shift a field into field-aligned coordinates, and the other is to use other fields (the parallel slices) to store the values in the yup and ydown directions. When an operator like
Grad_par
operates on a field, it first checks to see if it has parallel slices. If it does then it uses them (no shifting needed), and if it doesn't then it does the to/from field aligned operation.There are therefore two possible ways to apply boundary conditions:
(1) Shift field to aligned coordinates, apply the boundary, and shift back. The boundary values are stored in the guard cells of the field itself, not in its yup/down parallel slices. This is what Hermes-3 sheath_boundary etc. do.
(2) Store them in the parallel slices.
The sheath boundary components clear the parallel slices (so Grad_par etc won't use them), but in this case we keep a copy of the original pressure field in
evolve_pressure
, and set its boundary condition from the value in the state. This was done to help with handling of low-density regions. The sheath boundary condition cleared the parallel slices of the pressure in the state, but not for the copy stored inevolve_pressure
. The result was thatGrad_par
used the wrong boundary condition on pressure.I think the correct fix is probably to improve
setBoundaryTo
in BOUT++ (called here https://github.com/bendudson/hermes-3/blob/master/src/evolve_pressure.cxx#L219) so that it handles the presence (or lack) of poloidal slices.97a21fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request with fix into BOUT++
next
branch here: boutproject/BOUT-dev#2962