Open n01r opened 2 months ago
Thanks for raising this question @Tissot11.
Regarding continuous plasma injection, you can use the "flux injection" (search for NFluxPerCell
on this page: https://warpx.readthedocs.io/en/latest/usage/parameters.html). Here is an example that uses it:
https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Tests/flux_injection/inputs_3d
Also: here is an example that uses this feature within PICMI:
https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py#L188
Regarding your question on defining the simulation domain in terms of physical length (e.g. electron skin depth): there is currently no such feature in PICMI. The natural to do this in PICMI would be (as you mentioned) to pick a density, compute the corresponding skin depth, and then set the simulation domain accordingly.
Thanks for your answer and these links! It does look very promising that I can use this feature to simulate shocks with WarpX. It appears from these examples, that one could define a drifting Maxwellian plasma in WarpX but not in PICMI? The example for PICMI seems to talk about a Gaussian distribution with zero mean velocity. Is the Maxwell-Juettner distribution is used in WarpX? This is essentially to ensure that one can take into relativistic electron temperatures into account.
Regarding the scale-lengths for domain size, I meant this example https://warpx.readthedocs.io/en/latest/usage/examples/ohm_solver_magnetic_reconnection/README.html
where the domain size is defined in ion skin depth using the PICMI interface. I try to look at it carefully again.
I have now started using WarpX for the simulations, I am interested in. I just wanted to clarify few points regarding the injection.
do_continuous_injection = 1
for injecting/initialising plasma in moving window and boosted frame simulations. Does it mean that do_continuous_injection = 1
only works for these two simulations? Can one also use it for simulations (without moving window/boosted frame) involving drifting plasmas? Then I do not need to continuously inject particles using NFluxPerCell
?NFluxPerCell
but I am interested in injection with a fixed density in a 2D simulation. In your examples, you took flux to be 1. For this calculation, do I need assume some size in missing y
direction? Normally, I can just take it be a product of density and drift velocity...Thanks in advance!
Thanks for the question.
do_continuous_injection
should indeed work to inject a drifting plasma in a fixed (i.e. non-moving) box, but for this to work, you will need to turn on the moving window and give it a zero velocity. This is a bit of a quirk but is currently needed because the continuous injection is implemented as part of the moving window module:
https://github.com/ECP-WarpX/WarpX/blob/development/Source/Utils/WarpXMovingWindow.cpp#L71
Setting the flux to the product of density by drift velocity should still work for NFluxPerCell
in 2D, I think (without having to assume some size in the missing y
direction). That being said, I think that solution 1 (i.e. using do_continuous_injection
) is probably easier.
Thanks for your fast answer and the tip! Indeed, it works the way you suggested and it already helps a lot! The additional flexibility provided by NFluxPerCell
makes WarpX very attractive option for me to use for my research!
If you won't mind, I have three more clarifications to seek
diagField diagPhase diagSpectra diagTracking
. In the first, I only dump diagField.fields_to_plot = Ex Ey Ez By Bz rho
and in the second diagPhase.Eons.variables = x ux diagPhase.Ions.variables = x ux
. The third and fourth arediagSpectra.particle_fields_species = Eons Ions
diagSpectra.particle_fields_to_plot = u
diagSpectra.particle_fields.u(x,y,z,ux,uy,uz) = sqrt( ux*ux + uy*uy + uz*uz)
diagSpectra.particle_fields.u.filter(x,y,z,ux,uy,uz) = (x>=Lx/2) * (x<0.75*Lx)
diagTracking.Eons.plot_filter_function(t,x,y,z,ux,uy,uz) = (ux>=10) * (x<0.75*Lx) * (x>0.25*Lx)
diagTracking.Eons.random_fraction = 0.1
I was only expecting to see grid fields
in the first one, but the remaining three diagnostics also seem to dump E, B, j
always. Is this expected?
The last particle diagnostic should be rather light because of the filter condition (based on previous experiences from simulations) but the file size is huge (~15 GB) from the beginning of a small simulation run. This is after turning off diagTracking.write_species = 0
in all diagnostics to reduce file sizes due to checkpoint
. I tried to read the documentation carefully but I might have skipped some important aspects. I am using for all diagnostics
<diagName>.format = openpmd
<diagName>.openpmd_encoding = g
<diagName>.openpmd_backend = h5
When I pick for xmin
absorbing
and thermal
for xmax
, I got error asking to choose neumann
boundary condition instead of PML
. Is neumann
also for electromagnetic field and not just for electrostatic solver as the documentation says? I am actually interested in reducing the electrostatic field noise at the boundaries.
I found the attribute
features quite useful. But I wanted to ask if you have more general usage in mind regarding the functionalities apart from creating and tracking particles by ionization and QED related physics? Could attributes
be used to create different populations of a single species
to initialise the simulations? I have only seen one or two input files in Tests
directory for possible usages.
Again thanks in advance and I am now really looking forward to use WarpX
for my research work.
Thanks for your interest in the code and for the additional questions.
Some of these questions would be easier to answer by having access to your full input script. Would it be possible for you to post the full script here?
Perhaps, I can send you by email?
Moved discussion from #5077.
User @Tissot11 asked the following questions:
@RevathiJambunathan, do you maybe have experience or guidance given your previous astrophysical WarpX studies?