diff options
Diffstat (limited to '')
-rw-r--r-- | Docs/source/running_cpp/parameters.rst | 29 | ||||
-rw-r--r-- | Source/Initialization/InjectorMomentum.H | 34 |
2 files changed, 41 insertions, 22 deletions
diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 70cf7c199..e7c20976f 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -266,14 +266,35 @@ Particle initialization well as standard deviations along each direction ``<species_name>.ux_th``, ``<species_name>.uy_th`` and ``<species_name>.uz_th``. + * ``maxwell_boltzmann``: Maxwell-Boltzmann distribution that takes a dimensionless + temperature parameter ``<species_name>.theta`` as an input, where theta is kb*T/(m*c^2), + kb is the Boltzmann constant, c is the speed of light, and m is the mass of the species. + It also includes the optional parameter ``<species_name>.beta`` where beta is equal to v/c. + The plasma will be initialized to move at drift velocity beta*c in the positive + ``<species_name>.direction = 'x', 'y', 'z'``, direction. The MB distribution is initialized + in the drifting frame by sampling three Gaussian distributions in each dimension, and then + the distribution is transformed to the simulation frame using the flipping method. The + flipping method can be found in Zenitani 2015 section III. B. (Phys. Plasmas 22, 042116). + + Note that though the particles may move at relativistic speeds in the simulation frame, + they are not relativistic in the drift frame. This is as opposed to the Maxwell Juttner + setting, which initializes particles with relativistc momentums in their drifting frame. + * ``maxwell_juttner``: Maxwell-Juttner distribution for high temperature plasma. This mode requires a dimensionless temperature parameter ``<species_name>.theta``, where theta is equal to kb*T/(m*c^2), where kb is the Boltzmann constant, and m is the mass of the species. It also includes the optional parameter ``<species_name>.beta`` where beta is equal to v/c. The plasma - will be initialized to move at velocity beta*c in the ``<species_name>.direction = 'x', 'y', 'z'``, - direction. The MJ distribution will be initialized in the moving frame using the Sobol method, - and then the distribution will be transformed to the simulation frame using the flipping method. - Both the Sobol and the flipping method can be found in Zenitani 2015 (Phys. Plasmas 22, 042116). + will be initialized to move at velocity beta*c in the positive + ``<species_name>.direction = 'x', 'y', 'z'``, direction. The MJ distribution will be initialized + in the moving frame using the Sobol method, and then the distribution will be transformed to the + simulation frame using the flipping method. Both the Sobol and the flipping method can be found + in Zenitani 2015 (Phys. Plasmas 22, 042116). + + Please take notice that particles initialized with this setting can be relativistic in two ways. + In the simulation frame, they can drift with a relativistic speed beta. Then, in the drifting + frame they are still moving with relativistic speeds due to high temperature. This is as opposed + to the Maxwell Boltzmann setting, which initializes non-relativistic plasma in their relativistic + drifting frame. * ``radial_expansion``: momentum depends on the radial coordinate linearly. This requires additional parameter ``u_over_r`` which is the slope. diff --git a/Source/Initialization/InjectorMomentum.H b/Source/Initialization/InjectorMomentum.H index 5bbad36c3..272af52c7 100644 --- a/Source/Initialization/InjectorMomentum.H +++ b/Source/Initialization/InjectorMomentum.H @@ -61,29 +61,27 @@ struct InjectorMomentumBoltzmann { amrex::Real x1, x2, gamma; amrex::Real u[3]; - vave = std::sqrt(2*t); x1 = amrex::Random(); x2 = amrex::Random(); // Each value of sqrt(-log(x1))*sin(2*pi*x2) is a sample from a Gaussian - // distribution with sigma = vave. - u[(dir+1)%3] = vave* std::sqrt(-std::log(x1)) *std::sin(2*M_PI*x2); - u[(dir+2)%3] = vave* std::sqrt(-std::log(x1)) *std::cos(2*M_PI*x2); + // distribution with sigma = average velocity / c. + u[(dir+1)%3] = vave*std::sqrt(-std::log(x1)) *std::sin(2*M_PI*x2); + u[(dir+2)%3] = vave*std::sqrt(-std::log(x1)) *std::cos(2*M_PI*x2); u[dir] = vave*std::sqrt(-std::log(amrex::Random()))* std::sin(2*M_PI*amrex::Random()); gamma = std::sqrt(std::pow(u[0],2)+std::pow(u[1],2)+std::pow(u[2],2)); - gamma = np.sqrt(1+gamma**2); - // The following condition is equtaion 32 in Zenitani, called - // The flipping method. It transforms the intergral: d3x' -> d3x - // where d3x' is the volume element for positions in the boosted frame. - // The particle positions and densities can be initialized in the - // simulation frame with this method. - // The flipping method can similarly transform any - // symmetric distribution from one reference frame to another moving at - // a relative velocity of beta. - // An equivalent alternative to this method native to WarpX - // would be to initialize the particle positions and densities in the - // frame moving at speed beta, and then perform a Lorentz transform - // on their positions and MJ sampled velocities to the simulation frame. + gamma = std::sqrt(1+std::pow(gamma,2)); + // The following condition is equtaion 32 in Zenitani 2015 + // (Phys. Plasmas 22, 042116) , called the flipping method. It + // transforms the intergral: d3x' -> d3x where d3x' is the volume + // element for positions in the boosted frame. The particle positions + // and densities can be initialized in the simulation frame. + // The flipping method can transform any symmetric distribution from one + // reference frame to another moving at a relative velocity of beta. + // An equivalent alternative to this method native to WarpX would be to + // initialize the particle positions and densities in the frame moving + // at speed beta, and then perform a Lorentz transform on the positions + // and MJ sampled velocities to the simulation frame. x1 = amrex::Random(); if(-beta*u[dir]/gamma > x1) { @@ -254,7 +252,7 @@ struct InjectorMomentum : type(Type::gaussian), object(t,a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th) { } - + InjectorMomentum (InjectorMomentumBoltzmann* t, amrex::Real theta, amrex::Real beta, int dir) : type(Type::boltzmann), |