Comments (8)
I am do a 3d boosted frame simulation of an electron beam travelling through a 3d undulator field. The boost is along the z direction and this is the field I used
#boost along z
warpx.gamma_boost = gamma_f
warpx.boost_direction = z
#field in lab frame
warpx.B_ext_grid_init_style = parse_B_ext_grid_function
warpx.Bx_external_grid_function(x,y,z) = if((z>(0.0)),if(z<2.15,-(k_x/k_y)\*sin(k_x\*x)*sinh(k_y\*y)*cos(k_u\*z),0.0),0.0)
warpx.By_external_grid_function(x,y,z) = if((z>(0.0)),if(z<2.15,B_0*cos(k_x\*x)\*cosh(k_y\*y)\*cos(k_u\*z),0.0),0.0)
warpx.Bz_external_grid_function(x,y,z) = if((z>(0.0)),if(z<2.15,-(k_u/k_y)\*B_0\*cos(k_x\*x)*sinh(k_y\*y)*sin(k_u\*z),0.0),0.0)
warpx.E_ext_grid_init_style = parse_E_ext_grid_function
warpx.Ex_external_grid_function(x,y,z) = 0
warpx.Ey_external_grid_function(x,y,z) = 0
warpx.Ez_external_grid_function(x,y,z) = 0
Below is a comparision between the z phase space predicted by the osiris simulation and the Warpx simulation
The external field should sinusoidally modulate the z phase space. This is seen in the osiris code. Seems that the field is not applied properly in the WarpX code. Is there additional parameter that I need to specify?
from warpx.
external_particle_function seems to work. I guess external_grid_function doesn't include any time dependence. It doesn't know how to handle the time dependence after Lorentz transformation.
from warpx.
<species_name>.zinject_plane only have spatial dependence as well. Does it transform properly when warpx.gamma_boost is set?
from warpx.
@rl3418
Thanks for your questions, and sorry for the late reply!
You had a number of different questions, so here are a few corresponding answers:
- In general, the
external_particle
fields cannot be visualized in the WarpX output. We might fix this in the near future, but again the current status is that these fields do not show up in the diagnostics (but yet they are indeed applied to the particles during the simulation). You mentioned that the WarpX document suggests otherwise: could you point me to the corresponding part of the documentation? - I would strongly recommend to use the
external_particle
fields instead of theexternal_grid
fields. Theexternal_grid
fields actually add the fields to the Maxwell grid, and the fields are then self-consistently updated, which can be problematic if the fields that you impose do not satisfy the right boundary conditions. It is much simpler to useexternal_particle
fields. - One key point: You should not apply the Lorentz transform in the fields that you pass to WarpX (e.g.
-clightgamma_fbeta_f*(k_x/k_y)B_0sin(k_xx)sinh(k_yy)cos(k_ugamma_f(z+beta_f*t))
). Instead, simply pass the lab-frame expressions. WarpX will automatically transform these fields under the hood. (See these lines and these lines) I suspect that this is one of the main reason why the WarpX and Osiris results differ. - In order to get the results back in the lab-frame, you mentioned that you used a script similar to FBPIC. However, this should not be needed: you can directly use the
BackTransformed
diagnostic in WarpX:
Please let us know if anything is unclear. Also, feel free to post an updated version of your script that takes into account the above points, if you would like us to take another look.
from warpx.
Thanks for the clarification. I was doing the transformation manually just to diagnose the problems. The BackTransformation diagnostics was not working properly, so I tried to do the transformation myself. I need to run more simulations to figure out what is the underlying problem.
I found a typo in my script. The preliminary simulation showed some agreement with the osiris results. This was performed without the injection plane, since it is not possibility to have the zinject_plane change with time. I will run more simulations with the zinject_plane using the WarpX transformation then.
from warpx.
I performed 3d simulations of an electron beam travelling through an undulator in the boosted frame. The warpx simulation and the osiris simulation showed similar behaviour. The beam evolution in the zpz phase space seems to match, but warpx results showed splitting which seems numerical. z is the beam propagation and the boost direction.
The plots here show the phase space distribution in the boosted frame just before the beam fully enters the undulator. The red vertical line marks the boundary of the undulator field in the boosted frame. pz shows sinusoidal modulation as expected due to the z dependence of the undulator field. However, warpx results showed splitting which seems numerical.
warpx
comparision
from warpx.
This is the z pz plot at a later time in the boosted frame
from warpx.
One could argue that this is due to microbunching. But it forms very rapidly and this is not observed in osiris.
from warpx.
Related Issues (20)
- CUDA initialization failed HOT 5
- CMake: Finalize WarpX/ABLASTR Installer HOT 2
- CI: CUDA RZ PSATD
- NERSC Perlmutter Compilation Error (pre-#4986) HOT 3
- Error recompiling on Lassen HOT 3
- Some basic AMR questions`1 HOT 2
- Adios2 using Blosc2 HOT 3
- Poor scaling to multiple GPUs with electrostatic solver HOT 5
- PICMI documentation is gone HOT 4
- Issue with Limiting External Electric Field to Specific Boundary in 3D Simulation HOT 8
- Clean code: remove `tmp_particle_data`
- Bug: Invalid memory access occurred during AMReX::GpuDevice::streamSynchronize HOT 10
- Convergence behavior of electrostatic solver changes whether embedded boundary support is on or off HOT 1
- Cannot get FFT method to work for electrostatic solver HOT 4
- NumPy 2.0 Compatibility HOT 5
- Runtime error with Laser Ion acceleration test run HOT 2
- Clean code: avoid duplication in Source/Parallelization/WarpXComm.cpp
- Segfault converting SOA particles to conduit blueprint
- How to utilize WarpX to investigate the evolution of relativistic electron beams in vacuum HOT 2
- Laser injected at an angle having non-physical effects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warpx.