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

Add Dan Barnes' effective potential (semi-implicit) Poisson solver #5079

Open
wants to merge 33 commits into
base: development
Choose a base branch
from

Conversation

roelof-groenewald
Copy link
Member

@roelof-groenewald roelof-groenewald commented Jul 23, 2024

This PR adds a new electrostatic solver based on the semi-implicit scheme developed by Barnes, Journal of Comp. Phys., 424 (2021), 109852 (see Appendix A of reference).

The implementation was tested through the simulation of a Langmuir probe placed inside a uniform plasma. To this end a 2d simulation was performed with an initial uniform plasma with a conducting disk inserted in the center of the domain. The disk is kept at 0 V while Neumann boundary conditions are used for the domain boundary. Electrons and hydrogen ions were injected from all the domain boundaries using the UniformFluxDistribution in order to simulate the particle flux from a uniform plasma. Thermal boundaries were used for the particles with the same temperatures as the initial plasma particles. The expected outcome of this simulation is that a sheath develops around the "Langmuir probe" with value
$V_s = 0.5T_e\ln\left(2\pi\frac{m_e}{2m_p}(1 + \frac{T_i}{T_e})\right) $.
A pre-sheath of roughly $0.7T_e$ is also expected to form but the exact value of this depends on the domain size since the pre-sheath extends for many Debye lengths.
The figure below shows an example outcome from a simulation as described above in which the semi-implicit factor was set to $C_{SI} = 10$.
image

Required before merging:

@roelof-groenewald roelof-groenewald added enhancement New feature or request component: electrostatic electrostatic solver labels Jul 23, 2024
@archermarx
Copy link
Contributor

archermarx commented Jul 24, 2024

Neat! I think the paper reference is off, though. That one points to

Improved C1 shape functions for simplex meshes

Is the paper you're referring to this one? (Barnes, Journal of Computational Physics., (2022) 111151)

Time-explicit Darwin PIC algorithm

@roelof-groenewald
Copy link
Member Author

I updated the description to specify Appendix A of the reference (see https://www.osti.gov/servlets/purl/1670766) where the semi-implicit method is described. I believe this reference was earlier than the Darwin model paper which is why I opted for it, but it is nice to have the other paper referenced in the PR as well. Thanks @archermarx!

@roelof-groenewald
Copy link
Member Author

For the sake of simplicity I opted for a different example problem. I now use a simulation of a plasma column expanding inside a conducting cylinder. This problem is useful to show the strength (and accuracy) of the semi-implicit scheme. The expansion of the plasma is tracked at fixed radii. The result below compare the semi-implicit results to those from a fully resolved, explicit simulation as well as a under-resolved explicit simulation.
comparison
Note that the resolved explicit results and the semi-implicit results agree very well even though the semi-implicit simulation was 4x faster.

@roelof-groenewald
Copy link
Member Author

Thanks @archermarx! I'll use your script to debug and let you know what I find. I won't have time to get to it until early next week however. Sorry for the delay.

@archermarx
Copy link
Contributor

No worries! Thanks for writing this feature!

@roelof-groenewald
Copy link
Member Author

The CI test was updated to more-or-less follow benchmark C from https://doi.org/10.1109/TPS.2021.3072353, but using different parameters in order to exploit the semi-implicit value. Nonetheless, the plasma expansion matches the analytic solution from that paper (dashed lines show analytic result at each time point):
image

@roelof-groenewald
Copy link
Member Author

@archermarx I found the reason why you didn't get any E-field - the E-field was only updated if EBs were used. I fixed that issue now. Would you please pull the latest changes and try your case again?

@archermarx
Copy link
Contributor

Yes, I'm compiling and will test shortly.

@archermarx
Copy link
Contributor

Can confirm, this particular issue is fixed. I'm going to try out longer runs now to see how the physics are affected.

image

@roelof-groenewald
Copy link
Member Author

Can confirm, this particular issue is fixed. I'm going to try out longer runs now to see how the physics are affected.

Awesome! Thanks for checking. I'd recommend moving slowly towards larger cell sizes and larger timesteps. Maybe first using the same settings as you use explicitly. It is important to keep the electron streaming factor below 1.

@archermarx
Copy link
Contributor

The results look pretty good to me, I ran at 2x grid size and 2x timestep with a factor of 2 and got results quite close to the explicit results with a total speedup of ~4x. I will run more tests but overall this seems to work great!

@roelof-groenewald
Copy link
Member Author

The results look pretty good to me, I ran at 2x grid size and 2x timestep with a factor of 2 and got results quite close to the explicit results with a total speedup of ~4x. I will run more tests but overall this seems to work great!

Thanks for following up! I'm glad to hear it is working for your use case so far. I'd be curious to hear how far you can push it before the physics start to suffer. We've run it using $\Delta t \omega_p$ up to ~100 without losing accuracy on the effects we were interested in but the ceiling will really depend on the specifics of the problem.

@archermarx
Copy link
Contributor

archermarx commented Oct 25, 2024

Interesting! I'm running the explicit version with larger dt and dx to start as a point of comparison, but I'll try 4x now. We're quite close to the streaming limit already so we can only really increase dt by increasing dx. The main question for us is how the larger effective plasma frequency and grid size affect the growth and propagation of the instability we care about, its effects on the plasma, and any numerical heating we might see.

@archermarx
Copy link
Contributor

Do you have any guidance for choosing the implicit parameter? i know it needs to be greater than 1, and that higher values are more stable, but any other rules of thumb?

@roelof-groenewald
Copy link
Member Author

Do you have any guidance for choosing the implicit parameter? i know it needs to be greater than 1, and that higher values are more stable, but any other rules of thumb?

At a given $\Delta t$ the higher you make $C_{SI}$ the more you suppress the plasma frequency, or alternatively, at a fixed $C_{SI}$ the larger your $\Delta t$ the more you suppress the plasma frequency. Using $C_{SI} = 4$ we get something like this:
image

So generally I try to run with the lowest $C_{SI}$ I can get away with to minimize the possibility of the plasma mode hybridizing with some mode I care about and changing the results. Luckily for me I usually care about ion modes which are so far removed from the plasma mode that there is a long way the plasma mode can be lowered before it gets close to frequencies I care about. Hope that helps!

@archermarx
Copy link
Contributor

Appreciate it, that's useful.

@roelof-groenewald
Copy link
Member Author

@RemiLehe and @archermarx I spoke with Dan Barnes and he suggested we use "effective potential" as the name for this method (giving EP-PIC) in order to address Remi's concern of possible confusion with the semi-implicit method of Chen et al.
I likely missed some spots in the code where the method is referred to as semi-implicit so please let me know if you spot any such occurrences.

@roelof-groenewald roelof-groenewald changed the title Add Dan Barnes' semi-implicit Poisson solver Add Dan Barnes' effective potential (semi-implicit) Poisson solver Nov 4, 2024
Copy link
Contributor

@archermarx archermarx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think i found any remaining references to semi-implicit on its own

Co-authored-by: Thomas Marks <[email protected]>
@roelof-groenewald
Copy link
Member Author

Think i found any remaining references to semi-implicit on its own

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: electrostatic electrostatic solver enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants