-
Notifications
You must be signed in to change notification settings - Fork 200
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
Compute electrostatic fields at the beginning of EM simulations, if potential is specified #4723
Compute electrostatic fields at the beginning of EM simulations, if potential is specified #4723
Conversation
@RemiLehe this shouldn't be a problem for the Ohm's law solver since it completely overwrites the E-field, but it would be good to raise a warning if a user tries to specify boundary potentials since they won't actually be taken into account. |
@@ -12,12 +12,6 @@ geometry.prob_hi = 0.26 0.26 0.26 | |||
|
|||
boundary.field_lo = pec pec pec | |||
boundary.field_hi = pec pec pec |
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.
I removed these lines in order to avoid triggering the electrostatic solver, for this particular test.
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.
I think this can go in as is (possibly with the suggestion for a warning that the code might behave differently now for old input scripts).
But one thing that should be fixed is that currently if a user specifies the boundary potential (on purpose or due to an outdated script) and is using damped
, pml
or none
for one of the boundaries the simulation will crash from
https://github.com/ECP-WarpX/WarpX/blob/7317aafb9d99b74d077c5bcc1bae3af29f31d9fd/Source/FieldSolver/ElectrostaticSolver.cpp#L1022
A solution would be to set the Poisson solve to use Neumann BCs if any of the above boundary conditions are used.
Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
for more information, see https://pre-commit.ci
This modifies the behavior of WarpX, such that, if the user uses a Maxwell solver and specifies the potential at the boundaries, an initial Poisson solve will be performed at
t=0
.