From 3ded8315e5ec4dfdeafb9652276eecdb15ab1663 Mon Sep 17 00:00:00 2001 From: Cameron Yang Date: Tue, 12 Nov 2019 17:21:22 -0800 Subject: Added comments on MB distribution, added MB docs, and chaned MJ docs --- Docs/source/running_cpp/parameters.rst | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'Docs/source/running_cpp') 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 ``.ux_th``, ``.uy_th`` and ``.uz_th``. + * ``maxwell_boltzmann``: Maxwell-Boltzmann distribution that takes a dimensionless + temperature parameter ``.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 ``.beta`` where beta is equal to v/c. + The plasma will be initialized to move at drift velocity beta*c in the positive + ``.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 ``.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 ``.beta`` where beta is equal to v/c. The plasma - will be initialized to move at velocity beta*c in the ``.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 + ``.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. -- cgit v1.2.3 From 1b05db8f849b7e36e339e32360a2a21b9a36fe64 Mon Sep 17 00:00:00 2001 From: Cameron Yang Date: Wed, 13 Nov 2019 17:16:45 -0800 Subject: Added information on MB method and made code corrections. --- Docs/source/running_cpp/parameters.rst | 11 ++++++----- Source/Initialization/InjectorMomentum.H | 13 +++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index e7c20976f..139811ffc 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -271,10 +271,11 @@ Particle initialization 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 ``.beta`` where beta is equal to v/c. The plasma will be initialized to move at drift velocity beta*c in the positive - ``.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). + ``.direction = 'x', 'y', 'z'`` direction. The MB distribution is initialized + in the drifting frame by sampling three Gaussian distributions in each dimension using, + the Box Mueller method, 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 @@ -285,7 +286,7 @@ Particle initialization 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 ``.beta`` where beta is equal to v/c. The plasma will be initialized to move at velocity beta*c in the positive - ``.direction = 'x', 'y', 'z'``, direction. The MJ distribution will be initialized + ``.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). diff --git a/Source/Initialization/InjectorMomentum.H b/Source/Initialization/InjectorMomentum.H index 272af52c7..5e0494d92 100644 --- a/Source/Initialization/InjectorMomentum.H +++ b/Source/Initialization/InjectorMomentum.H @@ -51,6 +51,10 @@ private: // drift velocity beta, from the Maxwell-Boltzmann distribution. struct InjectorMomentumBoltzmann { + // Constructor whose inputs are: + // the temperature parameter theta, + // boost velocity/c beta, + // and boost direction dir respectively. InjectorMomentumBoltzmann(amrex::Real t, amrex::Real b, int d) noexcept : vave(std::sqrt(2*t)), beta(b), dir(d) {} @@ -64,13 +68,14 @@ struct InjectorMomentumBoltzmann 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 = average velocity / c. + // distribution with sigma = average velocity / c + // using the Box-Mueller Method. 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 = std::sqrt(1+std::pow(gamma,2)); + gamma = std::pow(u[0],2)+std::pow(u[1],2)+std::pow(u[2],2); + gamma = std::sqrt(1+gamma); // 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 @@ -81,7 +86,7 @@ struct InjectorMomentumBoltzmann // 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. + // and MB sampled velocities to the simulation frame. x1 = amrex::Random(); if(-beta*u[dir]/gamma > x1) { -- cgit v1.2.3