-
Notifications
You must be signed in to change notification settings - Fork 90
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
SNB and InvertParDiv for nonuniform grids #2572
Conversation
Solves `A + Div_par( B Grad_par )` in divergence form. Adapted from `InvertPar` which uses `Grad2_par2 = Grad_par(Grad_par)` in non-conservative form.
Enables the fluxes at the boundaries to be fixes to be the same as the Spitzer-Harm calculation.
The integral of Div(Q) over the domain should be the same for SNB and S-H methods, because the Neumann boundary conditions on H should ensure this.
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.
clang-tidy made some suggestions
Runs in open domain with boundaries, checking that the boundary fluxes are the same for SH and SNB calculations even with non-uniform mesh.
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.
clang-tidy made some suggestions
Strangely, changing calculation of dy, J from float to double makes difference between SNB and SH heat fluxes larger.
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.
clang-tidy made some suggestions
Forgot to add, so wouldn't be compiled in Autotools build
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
clang-tidy made some suggestions
|
||
if (closed) { | ||
// Twist-shift | ||
int rank; |
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.
warning: variable 'rank' is not initialized [cppcoreguidelines-init-variables]
int rank; | |
int rank = 0; |
if (closed) { | ||
// Twist-shift | ||
int rank; | ||
int np; |
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.
warning: variable 'np' is not initialized [cppcoreguidelines-init-variables]
int np; | |
int np = 0; |
Tested on SD1D in 1D: The behaviour disappears when using a uniform grid. |
SNB solver was giving incorrect fluxes on non-uniform grids because the
InvertPar
solver doesn't handle these consistently.InvertParDeriv
class that solves equations of the formA + Div_par(B Grad_par)
similar toInvertPar
which solvesA + B Grad2_par2 + ...
.InvertParDiv