WarpX
Loading...
Searching...
No Matches
InjectorMomentum.H
Go to the documentation of this file.
1/* Copyright 2019-2020 Andrew Myers, Axel Huebl, Cameron Yang,
2 * Maxence Thevenet, Weiqun Zhang
3 *
4 * This file is part of WarpX.
5 *
6 * License: BSD-3-Clause-LBNL
7 */
8#ifndef WARPX_INJECTOR_MOMENTUM_H_
9#define WARPX_INJECTOR_MOMENTUM_H_
10
11#include "GetTemperature.H"
12#include "GetVelocity.H"
14#include "VelocityProperties.H"
16#include "Utils/TextMsg.H"
17#include "Utils/WarpXConst.H"
18
19#include <AMReX.H>
20#include <AMReX_Config.H>
21#include <AMReX_Dim3.H>
22#include <AMReX_GpuQualifiers.H>
23#include <AMReX_REAL.H>
24#include <AMReX_Parser.H>
25#include <AMReX_Random.H>
26
27#include <AMReX_BaseFwd.H>
28
29#include <cmath>
30#include <string>
31
32// struct whose getMomentum returns constant momentum.
34{
36 : m_ux(a_ux), m_uy(a_uy), m_uz(a_uz) {}
37
38 [[nodiscard]]
42 amrex::RandomEngine const&) const noexcept
43 {
44 return amrex::XDim3{m_ux,m_uy,m_uz};
45 }
46
47 [[nodiscard]]
51 {
52 return amrex::XDim3{m_ux,m_uy,m_uz};
53 }
54
55private:
57};
58
59// struct whose getMomentum returns momentum for 1 particle, from random
60// gaussian distribution.
62{
64 amrex::Real a_uz_m, amrex::Real a_ux_th,
65 amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
66 : m_ux_m(a_ux_m), m_uy_m(a_uy_m), m_uz_m(a_uz_m),
67 m_ux_th(a_ux_th), m_uy_th(a_uy_th), m_uz_th(a_uz_th)
68 {}
69
70 [[nodiscard]]
74 amrex::RandomEngine const& engine) const noexcept
75 {
79 }
80
81 [[nodiscard]]
84 getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
85 {
87 }
88
89private:
92};
93
94// struct whose getMomentum returns momentum for 1 particle, from random
95// gaussian flux distribution in the specified direction.
96// Along the normal axis, the distribution is v*Gaussian,
97// with the sign set by flux_direction.
99{
101 amrex::Real a_uz_m, amrex::Real a_ux_th,
102 amrex::Real a_uy_th, amrex::Real a_uz_th,
103 int a_flux_normal_axis, int a_flux_direction) noexcept
104 : m_ux_m(a_ux_m), m_uy_m(a_uy_m), m_uz_m(a_uz_m),
105 m_ux_th(a_ux_th), m_uy_th(a_uy_th), m_uz_th(a_uz_th),
106 m_flux_normal_axis(a_flux_normal_axis),
107 m_flux_direction(a_flux_direction)
108 {
109 }
110
111 [[nodiscard]]
115 amrex::RandomEngine const& engine) const noexcept
116 {
117 using namespace amrex::literals;
118
119 // Generate the distribution in the direction of the flux
120 amrex::Real u_m = 0, u_th = 0;
121 if (m_flux_normal_axis == 0) {
122 u_m = m_ux_m;
123 u_th = m_ux_th;
124 } else if (m_flux_normal_axis == 1) {
125 u_m = m_uy_m;
126 u_th = m_uy_th;
127 } else if (m_flux_normal_axis == 2) {
128 u_m = m_uz_m;
129 u_th = m_uz_th;
130 }
131 amrex::Real u = generateGaussianFluxDist(u_m, u_th, engine);
132 if (m_flux_direction < 0) { u = -u; }
133
134 // Note: Here, in RZ geometry, the variables `ux` and `uy` actually
135 // correspond to the radial and azimuthal component of the momentum
136 // (and e.g.`m_flux_normal_axis==1` corresponds to v*Gaussian along theta)
137 amrex::Real const ux = (m_flux_normal_axis == 0 ? u : amrex::RandomNormal(m_ux_m, m_ux_th, engine));
138 amrex::Real const uy = (m_flux_normal_axis == 1 ? u : amrex::RandomNormal(m_uy_m, m_uy_th, engine));
139 amrex::Real const uz = (m_flux_normal_axis == 2 ? u : amrex::RandomNormal(m_uz_m, m_uz_th, engine));
140 return amrex::XDim3{ux, uy, uz};
141 }
142
143 [[nodiscard]]
146 getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
147 {
149 }
150
151private:
156};
157
158
159// struct whose getMomentum returns momentum for 1 particle, from random
160// uniform distribution u_min < u < u_max
162{
164 amrex::Real a_uz_min, amrex::Real a_ux_max,
165 amrex::Real a_uy_max, amrex::Real a_uz_max) noexcept
166 : m_ux_min(a_ux_min), m_uy_min(a_uy_min), m_uz_min(a_uz_min),
167 m_ux_max(a_ux_max), m_uy_max(a_uy_max), m_uz_max(a_uz_max),
174 {}
175
176 [[nodiscard]]
180 amrex::RandomEngine const& engine) const noexcept
181 {
182 return amrex::XDim3{m_ux_min + amrex::Random(engine) * m_Dux,
183 m_uy_min + amrex::Random(engine) * m_Duy,
184 m_uz_min + amrex::Random(engine) * m_Duz};
185 }
186
187 [[nodiscard]]
190 getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
191 {
193 }
194
195private:
200};
201
202// struct whose getMomentum returns momentum for 1 particle with relativistic
203// bulk drift momentum u_mean, from the Maxwellian distribution.
205{
206 // Constructor whose inputs are:
207 // a reference to the initial temperature container t,
208 // a reference to the initial velocity container b
212
213 [[nodiscard]]
216 getMomentum (amrex::Real const x, amrex::Real const y, amrex::Real const z,
217 amrex::RandomEngine const& engine) const noexcept
218 {
219 using namespace amrex::literals;
220 const amrex::XDim3 u_std = temperature(x,y,z);
221 const amrex::XDim3 u_mean = velocity(x,y,z);
222 if (u_std.x < 0.0_rt || u_std.y < 0.0_rt || u_std.z < 0.0_rt) {
223 amrex::Abort("The standard deviation of normalized momentum must be non-negative.");
224 }
225 const amrex::Real ux_std = amrex::RandomNormal(u_mean.x, u_std.x, engine);
226 const amrex::Real uy_std = amrex::RandomNormal(u_mean.y, u_std.y, engine);
227 const amrex::Real uz_std = amrex::RandomNormal(u_mean.z, u_std.z, engine);
228 return amrex::XDim3 {ux_std, uy_std, uz_std};
229 }
230
231 [[nodiscard]]
234 getBulkMomentum (amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
235 {
236 using namespace amrex::literals;
237 const amrex::XDim3 u_mean = velocity(x,y,z);
238 return amrex::XDim3 {u_mean.x, u_mean.y, u_mean.z};
239 }
240
241private:
244};
245
246// struct whose getMomentum returns momentum for 1 particle with relativistic
247// bulk drift momentum u_mean, from the Maxwell-Juttner distribution. Method is
248// from Zenitani 2015 (Phys. Plasmas 22, 042116).
250{
251 // Constructor whose inputs are:
252 // a reference to the initial temperature container t,
253 // a reference to the initial velocity container b
255 : velocity(b), temperature(t)
256 {}
257
258 [[nodiscard]]
261 getMomentum (amrex::Real const x, amrex::Real const y, amrex::Real const z,
262 amrex::RandomEngine const& engine) const noexcept
263 {
264 using namespace amrex::literals;
265 amrex::Real x1, x2, gamma;
266 amrex::Real u [3];
267 amrex::Real const theta = temperature(x,y,z);
268 if (theta < 0) {
269 amrex::Abort("Temperature parameter theta is less than zero, "
270 "which is not allowed for Maxwell-Juttner distribution.");
271 }
272 // The bulk drift is specified as the normalized momentum u_mean = gamma*v/c.
273 // Derive the corresponding bulk velocity beta = v/c, the bulk Lorentz factor
274 // gamma_bulk = 1/sqrt(1-beta^2) = sqrt(1+|u_mean|^2), and the unit boost
275 // direction n = u_mean/|u_mean|.
276 const amrex::XDim3 u_mean = velocity(x,y,z);
277 amrex::Real const umean_mag = std::sqrt(u_mean.x*u_mean.x + u_mean.y*u_mean.y + u_mean.z*u_mean.z);
278 amrex::Real const gamma_bulk = std::sqrt(1._rt + umean_mag*umean_mag);
279 amrex::Real const beta = umean_mag/gamma_bulk;
280 // Unit boost direction (zero vector if there is no bulk drift)
281 amrex::Real nx = 0._rt, ny = 0._rt, nz = 0._rt;
282 if (umean_mag > 0._rt) {
283 nx = u_mean.x/umean_mag;
284 ny = u_mean.y/umean_mag;
285 nz = u_mean.z/umean_mag;
286 }
287 // Sample the rest-frame momentum vector u = (u[0],u[1],u[2]) and the
288 // corresponding Lorentz factor gamma. The Maxwell-Juttner distribution is
289 // isotropic in the rest frame, so u is sampled directly in the simulation
290 // axes; the bulk drift is then applied along the boost direction n further below.
291 // The Sobol rejection method used below becomes inefficient at low
292 // temperature: its acceptance efficiency is K_2(1/theta)/(2 theta^2),
293 // which tends to zero as theta -> 0
294 // (Zenitani et al. Phys. Plasmas 22, 042116, 2015, Eq. 13).
295 // For theta < 0.1 the Maxwell-Juttner distribution is indistinguishable
296 // from a non-relativistic Maxwellian, so we instead sample the
297 // momentum from a Gaussian with thermal spread
298 // u_th = sqrt(theta) per component (i.e. sqrt(kB*T/(m*c^2)),
299 // in the Lorentz frame that moves with the bulk drift
300 // where u is the normalized momentum u=gamma*beta.
301 // The flipping method and Lorentz transform below then handle
302 // the bulk drift, exactly as for the Sobol-sampled momentum.
303 if (theta < 0.1_rt) {
304 amrex::Real const u_th = std::sqrt(theta);
305 u[0] = amrex::RandomNormal(0._rt, u_th, engine);
306 u[1] = amrex::RandomNormal(0._rt, u_th, engine);
307 u[2] = amrex::RandomNormal(0._rt, u_th, engine);
308 gamma = std::sqrt(1._rt + u[0]*u[0] + u[1]*u[1] + u[2]*u[2]);
309 } else {
310 // Sobol method for sampling MJ Speeds,
311 // from Zenitani et al. Phys. Plasmas 22, 042116, 2015, Eq. 13.
312 x1 = 0._rt;
313 gamma = 0._rt;
314 // This condition is equation 10 in Zenitani,
315 // though x1 is defined differently.
316 amrex::Real umag = 0._rt;
317 while(umag-gamma <= x1)
318 {
319 umag = -theta*
320 std::log(amrex::Random(engine)*amrex::Random(engine)*amrex::Random(engine));
321 gamma = std::sqrt(1._rt+umag*umag);
322 x1 = theta*std::log(amrex::Random(engine));
323 }
324 // The following code samples a random unit vector
325 // and multiplies the result by speed umag.
326 x1 = amrex::Random(engine);
327 x2 = amrex::Random(engine);
328 auto const [sin_x2, cos_x2] = amrex::Math::sincos(2._rt*MathConst::pi*x2);
329 u[0] = 2._rt*umag*std::sqrt(x1*(1._rt-x1))*sin_x2;
330 u[1] = 2._rt*umag*std::sqrt(x1*(1._rt-x1))*cos_x2;
331 u[2] = umag*(2._rt*x1-1._rt);
332 }
333 if (umean_mag == 0._rt) {
334 return amrex::XDim3 {u[0], u[1], u[2]};
335 }
336 // Decompose u into the component parallel to the boost direction (u_par)
337 // and the perpendicular part (u_perp = u - u_par*n).
338 amrex::Real u_par = u[0]*nx + u[1]*ny + u[2]*nz;
339 amrex::Real const ux_perp = u[0] - u_par*nx;
340 amrex::Real const uy_perp = u[1] - u_par*ny;
341 amrex::Real const uz_perp = u[2] - u_par*nz;
342 x1 = amrex::Random(engine);
343 // The following condition is equation 32 in Zenitani, called
344 // The flipping method. It transforms the integral: d3x' -> d3x
345 // where d3x' is the volume element for positions in the boosted frame.
346 // The particle positions and densities can be initialized in the
347 // simulation frame with this method.
348 // The flipping method can similarly transform any
349 // symmetric distribution from one reference frame to another moving at
350 // a relative velocity of beta.
351 // An equivalent alternative to this method native to WarpX
352 // would be to initialize the particle positions and densities in the
353 // frame moving at speed beta, and then perform a Lorentz transform
354 // on their positions and MJ sampled velocities to the simulation frame.
355 if(-beta*u_par/gamma>x1)
356 {
357 u_par = -u_par;
358 }
359 // This Lorentz transform is equation 17 in Zenitani.
360 // It transforms the integral d3u' -> d3u
361 // where d3u' is the volume element for momentum in the boosted frame.
362 // It only affects the component along the boost direction.
363 u_par = gamma_bulk*(u_par + gamma*beta);
364 return amrex::XDim3 {ux_perp + u_par*nx, uy_perp + u_par*ny, uz_perp + u_par*nz};
365 }
366
367 [[nodiscard]]
370 getBulkMomentum (amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
371 {
372 return velocity(x,y,z);
373 }
374
375private:
378};
379
380// struct whose getMomentum returns local momentum computed from parser.
382{
383 explicit InjectorMomentumParser (GetVelocityVector const& a_velocity) noexcept
384 : m_velocity(a_velocity) {}
385
386 [[nodiscard]]
390 amrex::RandomEngine const&) const noexcept
391 {
392 return m_velocity(x,y,z);
393 }
394
395 [[nodiscard]]
399 {
400 return m_velocity(x,y,z);
401 }
402
404};
405
406// Base struct for momentum injector.
407// InjectorMomentum contains a union (called Object) that holds any one
408// instance of:
409// - InjectorMomentumConstant : to generate constant density;
410// - InjectorMomentumGaussian : to generate gaussian distribution;
411// - InjectorMomentumGaussianFlux : to generate v*gaussian distribution;
412// - InjectorMomentumParser : to generate momentum from parser;
413// - InjectorMomentumMaxwellian : to generate Maxwellian distribution;
414// The choice is made at runtime, depending in the constructor called.
415// This mimics virtual functions.
417{
418 // This constructor stores a InjectorMomentumConstant in union object.
420 amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz)
421 : type(Type::constant),
422 object(t, a_ux, a_uy, a_uz)
423 { }
424
425 // This constructor stores a InjectorMomentumParser in union object.
427 GetVelocityVector const& a_velocity)
428 : type(Type::parser),
429 object(t, a_velocity)
430 { }
431
432 // This constructor stores a InjectorMomentumGaussian in union object.
434 amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m,
435 amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th)
436 : type(Type::gaussian),
437 object(t,a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th)
438 { }
439
440 // This constructor stores a InjectorMomentumGaussianFlux in union object.
442 amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m,
443 amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th,
444 int a_flux_normal_axis, int a_flux_direction)
446 object(t,a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th,a_flux_normal_axis,a_flux_direction)
447 { }
448
449 // This constructor stores a InjectorMomentumUniform in union object.
451 amrex::Real a_ux_min, amrex::Real a_uy_min, amrex::Real a_uz_min,
452 amrex::Real a_ux_max, amrex::Real a_uy_max, amrex::Real a_uz_max)
453 : type(Type::uniform),
454 object(t,a_ux_min,a_uy_min,a_uz_min,a_ux_max,a_uy_max,a_uz_max)
455 { }
456
458 GetTemperatureVector const& temperature, GetVelocityVector const& velocity)
459 : type(Type::maxwellian),
460 object(t, temperature, velocity)
461 { }
462
463 // This constructor stores a InjectorMomentumJuttner in union object.
465 GetTemperature const& temperature, GetVelocityVector const& velocity)
466 : type(Type::juttner),
467 object(t, temperature, velocity)
468 { }
469
470 // Explicitly prevent the compiler from generating copy constructors
471 // and copy assignment operators.
474 void operator= (InjectorMomentum const&) = delete;
475 void operator= (InjectorMomentum &&) = delete;
476
477 // Default destructor
478 ~InjectorMomentum() = default;
479
480 void clear ();
481
482 // call getMomentum from the object stored in the union
483 // (the union is called Object, and the instance is called object).
484 [[nodiscard]]
488 amrex::RandomEngine const& engine) const noexcept
489 {
490 switch (type)
491 {
492 case Type::parser:
493 {
494 return object.parser.getMomentum(x,y,z,engine);
495 }
496 case Type::gaussian:
497 {
498 return object.gaussian.getMomentum(x,y,z,engine);
499 }
501 {
502 return object.gaussianflux.getMomentum(x,y,z,engine);
503 }
504 case Type::uniform:
505 {
506 return object.uniform.getMomentum(x,y,z,engine);
507 }
508 case Type::maxwellian:
509 {
510 return object.maxwellian.getMomentum(x,y,z,engine);
511 }
512 case Type::juttner:
513 {
514 return object.juttner.getMomentum(x,y,z,engine);
515 }
516 case Type::constant:
517 {
518 return object.constant.getMomentum(x,y,z,engine);
519 }
520 default:
521 {
522 amrex::Abort("InjectorMomentum: unknown type");
523 return {0.0,0.0,0.0};
524 }
525 }
526 }
527
528 // call getBulkMomentum from the object stored in the union
529 // (the union is called Object, and the instance is called object).
530 [[nodiscard]]
534 {
535 switch (type)
536 {
537 case Type::parser:
538 {
539 return object.parser.getBulkMomentum(x,y,z);
540 }
541 case Type::gaussian:
542 {
543 return object.gaussian.getBulkMomentum(x,y,z);
544 }
546 {
547 return object.gaussianflux.getBulkMomentum(x,y,z);
548 }
549 case Type::uniform:
550 {
551 return object.uniform.getBulkMomentum(x,y,z);
552 }
553 case Type::maxwellian:
554 {
555 return object.maxwellian.getBulkMomentum(x,y,z);
556 }
557 case Type::juttner:
558 {
559 return object.juttner.getBulkMomentum(x,y,z);
560 }
561 case Type::constant:
562 {
563 return object.constant.getBulkMomentum(x,y,z);
564 }
565 default:
566 {
567 amrex::Abort("InjectorMomentum: unknown type");
568 return {0.0,0.0,0.0};
569 }
570 }
571 }
572
575
576private:
577
578 // An instance of union Object constructs and stores any one of
579 // the objects declared (constant or gaussian or parser).
580 union Object {
582 amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
583 : constant(a_ux,a_uy,a_uz) {}
585 amrex::Real a_ux_m, amrex::Real a_uy_m,
586 amrex::Real a_uz_m, amrex::Real a_ux_th,
587 amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
588 : gaussian(a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th) {}
590 amrex::Real a_ux_m, amrex::Real a_uy_m,
591 amrex::Real a_uz_m, amrex::Real a_ux_th,
592 amrex::Real a_uy_th, amrex::Real a_uz_th,
593 int a_flux_normal_axis, int a_flux_direction) noexcept
594 : gaussianflux(a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th,a_flux_normal_axis,a_flux_direction) {}
596 amrex::Real a_ux_min, amrex::Real a_uy_min,
597 amrex::Real a_uz_min, amrex::Real a_ux_max,
598 amrex::Real a_uy_max, amrex::Real a_uz_max) noexcept
599 : uniform(a_ux_min,a_uy_min,a_uz_min,a_ux_max,a_uy_max,a_uz_max) {}
601 GetTemperatureVector const& t, GetVelocityVector const& b) noexcept
602 : maxwellian(t,b) {}
604 GetTemperature const& t, GetVelocityVector const& b) noexcept
605 : juttner(t,b) {}
607 GetVelocityVector const& a_velocity) noexcept
608 : parser(a_velocity) {}
616 };
618};
619
620// In order for InjectorMomentum to be trivially copyable, its destructor
621// must be trivial. So we have to rely on a custom deleter for unique_ptr.
624 if (p) {
625 p->clear();
626 delete p;
627 }
628 }
629};
630
631#endif //WARPX_INJECTOR_MOMENTUM_H_
#define AMREX_GPU_HOST_DEVICE
amrex_real Real
Real Random()
Real RandomNormal(Real mean, Real stddev)
constexpr auto pi
ratio of a circle's circumference to its diameter
Definition constant.H:29
__host__ __device__ std::pair< double, double > sincos(double x)
void Abort(const std::string &msg)
Get temperature at a point on the grid.
Definition GetTemperature.H:23
Definition GetTemperature.H:73
Definition GetVelocity.H:21
Definition InjectorMomentum.H:34
amrex::Real m_uy
Definition InjectorMomentum.H:56
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition InjectorMomentum.H:50
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &) const noexcept
Definition InjectorMomentum.H:41
amrex::Real m_ux
Definition InjectorMomentum.H:56
InjectorMomentumConstant(amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
Definition InjectorMomentum.H:35
amrex::Real m_uz
Definition InjectorMomentum.H:56
Definition InjectorMomentum.H:622
void operator()(InjectorMomentum *p) const
Definition InjectorMomentum.H:623
Definition InjectorMomentum.H:99
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition InjectorMomentum.H:146
amrex::Real m_uy_m
Definition InjectorMomentum.H:152
int m_flux_normal_axis
Definition InjectorMomentum.H:154
amrex::Real m_ux_m
Definition InjectorMomentum.H:152
amrex::Real m_uz_th
Definition InjectorMomentum.H:153
amrex::Real m_ux_th
Definition InjectorMomentum.H:153
amrex::Real m_uy_th
Definition InjectorMomentum.H:153
InjectorMomentumGaussianFlux(amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th, int a_flux_normal_axis, int a_flux_direction) noexcept
Definition InjectorMomentum.H:100
amrex::Real m_uz_m
Definition InjectorMomentum.H:152
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:114
int m_flux_direction
Definition InjectorMomentum.H:155
Definition InjectorMomentum.H:62
amrex::Real m_uz_m
Definition InjectorMomentum.H:90
amrex::Real m_ux_m
Definition InjectorMomentum.H:90
amrex::Real m_ux_th
Definition InjectorMomentum.H:91
amrex::Real m_uy_th
Definition InjectorMomentum.H:91
amrex::Real m_uy_m
Definition InjectorMomentum.H:90
InjectorMomentumGaussian(amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
Definition InjectorMomentum.H:63
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:73
amrex::Real m_uz_th
Definition InjectorMomentum.H:91
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition InjectorMomentum.H:84
Definition InjectorMomentum.H:417
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:487
Type type
Definition InjectorMomentum.H:574
InjectorMomentum(InjectorMomentum &&)=delete
~InjectorMomentum()=default
void operator=(InjectorMomentum const &)=delete
void clear()
Definition InjectorMomentum.cpp:12
InjectorMomentum(InjectorMomentumConstant *t, amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz)
Definition InjectorMomentum.H:419
InjectorMomentum(InjectorMomentum const &)=delete
InjectorMomentum(InjectorMomentumGaussian *t, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th)
Definition InjectorMomentum.H:433
InjectorMomentum(InjectorMomentumUniform *t, amrex::Real a_ux_min, amrex::Real a_uy_min, amrex::Real a_uz_min, amrex::Real a_ux_max, amrex::Real a_uy_max, amrex::Real a_uz_max)
Definition InjectorMomentum.H:450
Type
Definition InjectorMomentum.H:573
@ maxwellian
Definition InjectorMomentum.H:573
@ gaussian
Definition InjectorMomentum.H:573
@ parser
Definition InjectorMomentum.H:573
@ gaussianflux
Definition InjectorMomentum.H:573
@ constant
Definition InjectorMomentum.H:573
@ juttner
Definition InjectorMomentum.H:573
@ uniform
Definition InjectorMomentum.H:573
Object object
Definition InjectorMomentum.H:617
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition InjectorMomentum.H:533
InjectorMomentum(InjectorMomentumGaussianFlux *t, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th, int a_flux_normal_axis, int a_flux_direction)
Definition InjectorMomentum.H:441
InjectorMomentum(InjectorMomentumMaxwellian *t, GetTemperatureVector const &temperature, GetVelocityVector const &velocity)
Definition InjectorMomentum.H:457
InjectorMomentum(InjectorMomentumJuttner *t, GetTemperature const &temperature, GetVelocityVector const &velocity)
Definition InjectorMomentum.H:464
InjectorMomentum(InjectorMomentumParser *t, GetVelocityVector const &a_velocity)
Definition InjectorMomentum.H:426
Definition InjectorMomentum.H:250
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
Definition InjectorMomentum.H:370
GetTemperature temperature
Definition InjectorMomentum.H:377
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real const x, amrex::Real const y, amrex::Real const z, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:261
GetVelocityVector velocity
Definition InjectorMomentum.H:376
InjectorMomentumJuttner(GetTemperature const &t, GetVelocityVector const &b) noexcept
Definition InjectorMomentum.H:254
Definition InjectorMomentum.H:205
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real const x, amrex::Real const y, amrex::Real const z, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:216
GetTemperatureVector temperature
Definition InjectorMomentum.H:243
GetVelocityVector velocity
Definition InjectorMomentum.H:242
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
Definition InjectorMomentum.H:234
InjectorMomentumMaxwellian(GetTemperatureVector const &t, GetVelocityVector const &b) noexcept
Definition InjectorMomentum.H:209
Definition InjectorMomentum.H:382
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &) const noexcept
Definition InjectorMomentum.H:389
InjectorMomentumParser(GetVelocityVector const &a_velocity) noexcept
Definition InjectorMomentum.H:383
GetVelocityVector m_velocity
Definition InjectorMomentum.H:403
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition InjectorMomentum.H:398
Definition InjectorMomentum.H:162
amrex::Real m_Dux
Definition InjectorMomentum.H:198
amrex::Real m_Duz
Definition InjectorMomentum.H:198
amrex::Real m_uz_min
Definition InjectorMomentum.H:196
amrex::Real m_ux_h
Definition InjectorMomentum.H:199
amrex::Real m_uz_h
Definition InjectorMomentum.H:199
amrex::Real m_ux_max
Definition InjectorMomentum.H:197
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition InjectorMomentum.H:190
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition InjectorMomentum.H:179
amrex::Real m_uz_max
Definition InjectorMomentum.H:197
amrex::Real m_uy_h
Definition InjectorMomentum.H:199
amrex::Real m_uy_max
Definition InjectorMomentum.H:197
InjectorMomentumUniform(amrex::Real a_ux_min, amrex::Real a_uy_min, amrex::Real a_uz_min, amrex::Real a_ux_max, amrex::Real a_uy_max, amrex::Real a_uz_max) noexcept
Definition InjectorMomentum.H:163
amrex::Real m_uy_min
Definition InjectorMomentum.H:196
amrex::Real m_Duy
Definition InjectorMomentum.H:198
amrex::Real m_ux_min
Definition InjectorMomentum.H:196
Definition InjectorMomentum.H:580
InjectorMomentumGaussian gaussian
Definition InjectorMomentum.H:610
InjectorMomentumUniform uniform
Definition InjectorMomentum.H:612
Object(InjectorMomentumJuttner *, GetTemperature const &t, GetVelocityVector const &b) noexcept
Definition InjectorMomentum.H:603
Object(InjectorMomentumGaussianFlux *, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th, int a_flux_normal_axis, int a_flux_direction) noexcept
Definition InjectorMomentum.H:589
Object(InjectorMomentumMaxwellian *, GetTemperatureVector const &t, GetVelocityVector const &b) noexcept
Definition InjectorMomentum.H:600
InjectorMomentumJuttner juttner
Definition InjectorMomentum.H:614
Object(InjectorMomentumUniform *, amrex::Real a_ux_min, amrex::Real a_uy_min, amrex::Real a_uz_min, amrex::Real a_ux_max, amrex::Real a_uy_max, amrex::Real a_uz_max) noexcept
Definition InjectorMomentum.H:595
InjectorMomentumGaussianFlux gaussianflux
Definition InjectorMomentum.H:611
InjectorMomentumMaxwellian maxwellian
Definition InjectorMomentum.H:613
Object(InjectorMomentumGaussian *, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
Definition InjectorMomentum.H:584
InjectorMomentumParser parser
Definition InjectorMomentum.H:615
InjectorMomentumConstant constant
Definition InjectorMomentum.H:609
Object(InjectorMomentumParser *, GetVelocityVector const &a_velocity) noexcept
Definition InjectorMomentum.H:606
Object(InjectorMomentumConstant *, amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
Definition InjectorMomentum.H:581