-
Notifications
You must be signed in to change notification settings - Fork 96
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
Elm-pb example with relaxing phi #3081
base: next
Are you sure you want to change the base?
Conversation
Adds an option phi_boundary_relax. If set to true, then the radial boundary conditions on the potential phi are relaxed over a given timescale towards zero gradient. Adapted from Hermes-3 (https://github.com/boutproject/hermes-3/blob/master/src/vorticity.cxx#L261).
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
philocal += phi(mesh->xstart, j, k); | ||
} | ||
} | ||
MPI_Comm comm_inner = mesh->getYcomm(0); |
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: no header providing "MPI_Comm" is directly included [misc-include-cleaner]
examples/elm-pb/elm_pb.cxx:23:
+ #include <mpi.h>
} | ||
MPI_Comm comm_inner = mesh->getYcomm(0); | ||
int np; | ||
MPI_Comm_size(comm_inner, &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: no header providing "MPI_Comm_size" is directly included [misc-include-cleaner]
MPI_Comm_size(comm_inner, &np);
^
MPI_Comm comm_inner = mesh->getYcomm(0); | ||
int np; | ||
MPI_Comm_size(comm_inner, &np); | ||
MPI_Allreduce(&philocal, &phivalue, 1, MPI_DOUBLE, MPI_SUM, comm_inner); |
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: no header providing "MPI_Allreduce" is directly included [misc-include-cleaner]
MPI_Allreduce(&philocal, &phivalue, 1, MPI_DOUBLE, MPI_SUM, comm_inner);
^
MPI_Comm comm_inner = mesh->getYcomm(0); | ||
int np; | ||
MPI_Comm_size(comm_inner, &np); | ||
MPI_Allreduce(&philocal, &phivalue, 1, MPI_DOUBLE, MPI_SUM, comm_inner); |
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: no header providing "MPI_SUM" is directly included [misc-include-cleaner]
MPI_Allreduce(&philocal, &phivalue, 1, MPI_DOUBLE, MPI_SUM, comm_inner);
^
@@ -1494,7 +1681,11 @@ | |||
// Jpar | |||
Field3D B0U = B0 * U; | |||
mesh->communicate(B0U); | |||
ddt(Jpar) = -Grad_parP(B0U, loc) / B0 + eta * Delp2(Jpar); | |||
if (laplace_perp) { | |||
ddt(Jpar) = -Grad_parP(B0U, loc) / B0 + eta * Laplace_perp(Jpar); |
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: no header providing "ddt" is directly included [misc-include-cleaner]
ddt(Jpar) = -Grad_parP(B0U, loc) / B0 + eta * Laplace_perp(Jpar);
^
Should average over Z
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Adds an option phi_boundary_relax. If set to true, then the radial boundary conditions on the potential phi are relaxed over a given timescale towards zero gradient.
Adapted from Hermes-3
(https://github.com/boutproject/hermes-3/blob/master/src/vorticity.cxx#L261).