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

Compute electrostatic fields at the beginning of EM simulations, if potential is specified #4723

Merged
merged 15 commits into from
Mar 14, 2024

Conversation

RemiLehe
Copy link
Member

@RemiLehe RemiLehe commented Feb 23, 2024

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.

@roelof-groenewald
Copy link
Member

@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.

@RemiLehe RemiLehe changed the title [WIP] Compute electrostatic fields at the beginning of EM simulations, if potential is specified Compute electrostatic fields at the beginning of EM simulations, if potential is specified Feb 29, 2024
@@ -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
Copy link
Member Author

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.

@RemiLehe RemiLehe requested a review from dpgrote March 7, 2024 00:20
@RemiLehe RemiLehe assigned dpgrote and RemiLehe and unassigned RemiLehe Mar 7, 2024
Copy link
Member

@roelof-groenewald roelof-groenewald left a 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.

RemiLehe and others added 2 commits March 14, 2024 08:50
Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
@roelof-groenewald roelof-groenewald enabled auto-merge (squash) March 14, 2024 17:05
@roelof-groenewald roelof-groenewald merged commit 5f96976 into BLAST-WarpX:development Mar 14, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants