-
Notifications
You must be signed in to change notification settings - Fork 196
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
Problems with magnetostatic solver test input file #5444
Comments
#5446) …ch is currently hard coded, and adding assert to force EB being enabled in order to avoid a seg fault in AMReX when computing the gradient solution. This PR partially addresses #5444. This PR adds semi-coarsening in 3D and then adds an assert to keep the magnetostatic solver from being run without an EB. This is required since in AMReX MLMG->getGradSolution will segfault when not using an EB. It should also be noted that #5175 will use a different scheme around the embedded boundaries to compute gradients, and will likely mitigate these issues. A work around in RZ to use the outer edge is to enable the embedded boundary and set the boundary radius larger than the outer grid radius. This works like it would without an embedded boundary and can be used until either the refactor or the bugfix in AMReX for getGradSolution. --------- Signed-off-by: S. Eric Clark <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@clarkse |
I will remove the assert and submit a new PR today. |
Discussed in #5425
Originally posted by BCatGA October 29, 2024
Hi,
I would like to use the "warpx_magnetostatic=True" option for the Electrostatic solver so I have been running the WarpX Test input file "inputs_test_rz_magnetostatic_eb_picmi.py" to figure out how it works. In this RZ simulation, there is an electron beam of radius 0.1 m going down a pipe (embedded boundary) of radius 0.2 m. The domain is rmax=0.25 m X zmax=1 m, and there are 128 cells in the both the radial and axial directions. The input file is setup to run the simulation for only 1 time step, so it can calculate the electric and magnetic fields.
When I run the input file with Python the simulation converges. But I found that convergence is very sensitive to changes in the pipe radius (say, from 0.2 to 0.21 m) when "warpx_magnetostatic=True", but not when "warpx_magnetostatic=False". I figured out that this sensitivity goes away when I make the cells square (reducing nr to 32 for rmax = 0.25). In that case, I can put the pipe radius right on the domain boundary and the simulation will converge, as long as I make the boundary conditions at rmax the same as the pipe boundary condition (dirichlet,1V).
But that begs the question, why do I need the pipe as an embedded boundary? Why not just remove it and treat the outer boundary as the pipe by setting dirichlet boundary conditions with a constant voltage? However, when I do that, the multigrid solver converges but I get multiple segmentation faults and the simulation crashes. And again, if I set "warpx_magnetostatic=False" everything runs fine.
So, my questions are:
Thanks for your help,
Brian
I have reproduced this problem and am converting it to an issue.
The text was updated successfully, but these errors were encountered: