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// drift velocity beta, from the Maxwell-Juttner distribution. Method is from
248// 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 // Calculate local velocity and abort if |beta|>=1
273 amrex::Real const beta = velocity(x,y,z);
274 if (beta <= -1._rt || beta >= 1._rt) {
275 amrex::Abort("beta = v/c magnitude greater than or equal to 1");
276 }
277 int const dir = velocity.direction();
278 // The Sobol rejection method used below becomes inefficient at low
279 // temperature: its acceptance efficiency is K_2(1/theta)/(2 theta^2),
280 // which tends to zero as theta -> 0
281 // (Zenitani et al. Phys. Plasmas 22, 042116, 2015, Eq. 13).
282 // For theta < 0.1 the Maxwell-Juttner distribution is indistinguishable
283 // from a non-relativistic Maxwellian, so we instead sample the
284 // momentum from a Gaussian with thermal spread
285 // u_th = sqrt(theta) per component (i.e. sqrt(kB*T/(m*c^2)),
286 // in the Lorentz frame that moves with the bulk drift
287 // where u is the normalized momentum u=gamma*beta.
288 // The flipping method and Lorentz transform below then handle
289 // the bulk drift, exactly as for the Sobol-sampled momentum.
290 if (theta < 0.1_rt) {
291 amrex::Real const u_th = std::sqrt(theta);
292 u[0] = amrex::RandomNormal(0._rt, u_th, engine);
293 u[1] = amrex::RandomNormal(0._rt, u_th, engine);
294 u[2] = amrex::RandomNormal(0._rt, u_th, engine);
295 gamma = std::sqrt(1._rt + u[0]*u[0] + u[1]*u[1] + u[2]*u[2]);
296 } else {
297 // Sobol method for sampling MJ Speeds,
298 // from Zenitani et al. Phys. Plasmas 22, 042116, 2015, Eq. 13.
299 x1 = 0._rt;
300 gamma = 0._rt;
301 u[dir] = 0._rt;
302 // This condition is equation 10 in Zenitani,
303 // though x1 is defined differently.
304 while(u[dir]-gamma <= x1)
305 {
306 u[dir] = -theta*
307 std::log(amrex::Random(engine)*amrex::Random(engine)*amrex::Random(engine));
308 gamma = std::sqrt(1._rt+u[dir]*u[dir]);
309 x1 = theta*std::log(amrex::Random(engine));
310 }
311 // The following code samples a random unit vector
312 // and multiplies the result by speed u[dir].
313 x1 = amrex::Random(engine);
314 x2 = amrex::Random(engine);
315 // Direction dir is an input parameter that sets the boost direction:
316 // 'x' -> d = 0, 'y' -> d = 1, 'z' -> d = 2.
317 auto const [sin_x2, cos_x2] = amrex::Math::sincos(2._rt*MathConst::pi*x2);
318 u[(dir+1)%3] = 2._rt*u[dir]*std::sqrt(x1*(1._rt-x1))*sin_x2;
319 u[(dir+2)%3] = 2._rt*u[dir]*std::sqrt(x1*(1._rt-x1))*cos_x2;
320 // The value of dir is the boost direction to be transformed.
321 u[dir] = u[dir]*(2._rt*x1-1._rt);
322 }
323 x1 = amrex::Random(engine);
324 // The following condition is equation 32 in Zenitani, called
325 // The flipping method. It transforms the integral: d3x' -> d3x
326 // where d3x' is the volume element for positions in the boosted frame.
327 // The particle positions and densities can be initialized in the
328 // simulation frame with this method.
329 // The flipping method can similarly transform any
330 // symmetric distribution from one reference frame to another moving at
331 // a relative velocity of beta.
332 // An equivalent alternative to this method native to WarpX
333 // would be to initialize the particle positions and densities in the
334 // frame moving at speed beta, and then perform a Lorentz transform
335 // on their positions and MJ sampled velocities to the simulation frame.
336 if(-beta*u[dir]/gamma>x1)
337 {
338 u[dir] = -u[dir];
339 }
340 // This Lorentz transform is equation 17 in Zenitani.
341 // It transforms the integral d3u' -> d3u
342 // where d3u' is the volume element for momentum in the boosted frame.
343 u[dir] = 1._rt/std::sqrt(1._rt-beta*beta)*(u[dir]+gamma*beta);
344 // Note that if beta = 0 then the flipping method and Lorentz transform
345 // have no effect on the u[dir] direction.
346 return amrex::XDim3 {u[0],u[1],u[2]};
347 }
348
349 [[nodiscard]]
352 getBulkMomentum (amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
353 {
354 using namespace amrex::literals;
355 amrex::Real u[3];
356 for (auto& el : u) { el = 0.0_rt; }
357 amrex::Real const beta = velocity(x,y,z);
358 int const dir = velocity.direction();
359 auto const gamma = 1._rt/std::sqrt(1._rt-beta*beta);
360 u[dir] = gamma*beta;
361 return amrex::XDim3 {u[0],u[1],u[2]};
362 }
363
364private:
367};
368
369// struct whose getMomentum returns local momentum computed from parser.
371{
373 amrex::ParserExecutor<3> const& a_uy_parser,
374 amrex::ParserExecutor<3> const& a_uz_parser) noexcept
375 : m_ux_parser(a_ux_parser), m_uy_parser(a_uy_parser),
376 m_uz_parser(a_uz_parser) {}
377
378 [[nodiscard]]
382 amrex::RandomEngine const&) const noexcept
383 {
384 return amrex::XDim3{m_ux_parser(x,y,z),m_uy_parser(x,y,z),m_uz_parser(x,y,z)};
385 }
386
387 [[nodiscard]]
391 {
392 return amrex::XDim3{m_ux_parser(x,y,z),m_uy_parser(x,y,z),m_uz_parser(x,y,z)};
393 }
394
396};
397
398// Base struct for momentum injector.
399// InjectorMomentum contains a union (called Object) that holds any one
400// instance of:
401// - InjectorMomentumConstant : to generate constant density;
402// - InjectorMomentumGaussian : to generate gaussian distribution;
403// - InjectorMomentumGaussianFlux : to generate v*gaussian distribution;
404// - InjectorMomentumParser : to generate momentum from parser;
405// - InjectorMomentumMaxwellian : to generate Maxwellian distribution;
406// The choice is made at runtime, depending in the constructor called.
407// This mimics virtual functions.
409{
410 // This constructor stores a InjectorMomentumConstant in union object.
412 amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz)
413 : type(Type::constant),
414 object(t, a_ux, a_uy, a_uz)
415 { }
416
417 // This constructor stores a InjectorMomentumParser in union object.
419 amrex::ParserExecutor<3> const& a_ux_parser,
420 amrex::ParserExecutor<3> const& a_uy_parser,
421 amrex::ParserExecutor<3> const& a_uz_parser)
422 : type(Type::parser),
423 object(t, a_ux_parser, a_uy_parser, a_uz_parser)
424 { }
425
426 // This constructor stores a InjectorMomentumGaussian in union object.
428 amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m,
429 amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th)
430 : type(Type::gaussian),
431 object(t,a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th)
432 { }
433
434 // This constructor stores a InjectorMomentumGaussianFlux in union object.
436 amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m,
437 amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th,
438 int a_flux_normal_axis, int a_flux_direction)
440 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)
441 { }
442
443 // This constructor stores a InjectorMomentumUniform in union object.
445 amrex::Real a_ux_min, amrex::Real a_uy_min, amrex::Real a_uz_min,
446 amrex::Real a_ux_max, amrex::Real a_uy_max, amrex::Real a_uz_max)
447 : type(Type::uniform),
448 object(t,a_ux_min,a_uy_min,a_uz_min,a_ux_max,a_uy_max,a_uz_max)
449 { }
450
452 GetTemperatureVector const& temperature, GetVelocityVector const& velocity)
453 : type(Type::maxwellian),
454 object(t, temperature, velocity)
455 { }
456
457 // This constructor stores a InjectorMomentumJuttner in union object.
459 GetTemperature const& temperature, GetVelocity const& velocity)
460 : type(Type::juttner),
461 object(t, temperature, velocity)
462 { }
463
464 // Explicitly prevent the compiler from generating copy constructors
465 // and copy assignment operators.
468 void operator= (InjectorMomentum const&) = delete;
469 void operator= (InjectorMomentum &&) = delete;
470
471 // Default destructor
472 ~InjectorMomentum() = default;
473
474 void clear ();
475
476 // call getMomentum from the object stored in the union
477 // (the union is called Object, and the instance is called object).
478 [[nodiscard]]
482 amrex::RandomEngine const& engine) const noexcept
483 {
484 switch (type)
485 {
486 case Type::parser:
487 {
488 return object.parser.getMomentum(x,y,z,engine);
489 }
490 case Type::gaussian:
491 {
492 return object.gaussian.getMomentum(x,y,z,engine);
493 }
495 {
496 return object.gaussianflux.getMomentum(x,y,z,engine);
497 }
498 case Type::uniform:
499 {
500 return object.uniform.getMomentum(x,y,z,engine);
501 }
502 case Type::maxwellian:
503 {
504 return object.maxwellian.getMomentum(x,y,z,engine);
505 }
506 case Type::juttner:
507 {
508 return object.juttner.getMomentum(x,y,z,engine);
509 }
510 case Type::constant:
511 {
512 return object.constant.getMomentum(x,y,z,engine);
513 }
514 default:
515 {
516 amrex::Abort("InjectorMomentum: unknown type");
517 return {0.0,0.0,0.0};
518 }
519 }
520 }
521
522 // call getBulkMomentum from the object stored in the union
523 // (the union is called Object, and the instance is called object).
524 [[nodiscard]]
528 {
529 switch (type)
530 {
531 case Type::parser:
532 {
533 return object.parser.getBulkMomentum(x,y,z);
534 }
535 case Type::gaussian:
536 {
537 return object.gaussian.getBulkMomentum(x,y,z);
538 }
540 {
541 return object.gaussianflux.getBulkMomentum(x,y,z);
542 }
543 case Type::uniform:
544 {
545 return object.uniform.getBulkMomentum(x,y,z);
546 }
547 case Type::maxwellian:
548 {
549 return object.maxwellian.getBulkMomentum(x,y,z);
550 }
551 case Type::juttner:
552 {
553 return object.juttner.getBulkMomentum(x,y,z);
554 }
555 case Type::constant:
556 {
557 return object.constant.getBulkMomentum(x,y,z);
558 }
559 default:
560 {
561 amrex::Abort("InjectorMomentum: unknown type");
562 return {0.0,0.0,0.0};
563 }
564 }
565 }
566
569
570private:
571
572 // An instance of union Object constructs and stores any one of
573 // the objects declared (constant or gaussian or parser).
574 union Object {
576 amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
577 : constant(a_ux,a_uy,a_uz) {}
579 amrex::Real a_ux_m, amrex::Real a_uy_m,
580 amrex::Real a_uz_m, amrex::Real a_ux_th,
581 amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
582 : gaussian(a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th) {}
584 amrex::Real a_ux_m, amrex::Real a_uy_m,
585 amrex::Real a_uz_m, amrex::Real a_ux_th,
586 amrex::Real a_uy_th, amrex::Real a_uz_th,
587 int a_flux_normal_axis, int a_flux_direction) noexcept
588 : 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) {}
590 amrex::Real a_ux_min, amrex::Real a_uy_min,
591 amrex::Real a_uz_min, amrex::Real a_ux_max,
592 amrex::Real a_uy_max, amrex::Real a_uz_max) noexcept
593 : uniform(a_ux_min,a_uy_min,a_uz_min,a_ux_max,a_uy_max,a_uz_max) {}
595 GetTemperatureVector const& t, GetVelocityVector const& b) noexcept
596 : maxwellian(t,b) {}
598 GetTemperature const& t, GetVelocity const& b) noexcept
599 : juttner(t,b) {}
601 amrex::ParserExecutor<3> const& a_ux_parser,
602 amrex::ParserExecutor<3> const& a_uy_parser,
603 amrex::ParserExecutor<3> const& a_uz_parser) noexcept
604 : parser(a_ux_parser, a_uy_parser, a_uz_parser) {}
612 };
614};
615
616// In order for InjectorMomentum to be trivially copyable, its destructor
617// must be trivial. So we have to rely on a custom deleter for unique_ptr.
620 if (p) {
621 p->clear();
622 delete p;
623 }
624 }
625};
626
627#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 GetVelocity.H:91
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:618
void operator()(InjectorMomentum *p) const
Definition InjectorMomentum.H:619
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:409
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:481
Type type
Definition InjectorMomentum.H:568
InjectorMomentum(InjectorMomentum &&)=delete
~InjectorMomentum()=default
InjectorMomentum(InjectorMomentumParser *t, amrex::ParserExecutor< 3 > const &a_ux_parser, amrex::ParserExecutor< 3 > const &a_uy_parser, amrex::ParserExecutor< 3 > const &a_uz_parser)
Definition InjectorMomentum.H:418
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:411
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:427
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:444
Type
Definition InjectorMomentum.H:567
@ maxwellian
Definition InjectorMomentum.H:567
@ gaussian
Definition InjectorMomentum.H:567
@ parser
Definition InjectorMomentum.H:567
@ gaussianflux
Definition InjectorMomentum.H:567
@ constant
Definition InjectorMomentum.H:567
@ juttner
Definition InjectorMomentum.H:567
@ uniform
Definition InjectorMomentum.H:567
Object object
Definition InjectorMomentum.H:613
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition InjectorMomentum.H:527
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:435
InjectorMomentum(InjectorMomentumMaxwellian *t, GetTemperatureVector const &temperature, GetVelocityVector const &velocity)
Definition InjectorMomentum.H:451
InjectorMomentum(InjectorMomentumJuttner *t, GetTemperature const &temperature, GetVelocity const &velocity)
Definition InjectorMomentum.H:458
Definition InjectorMomentum.H:250
GetVelocity velocity
Definition InjectorMomentum.H:365
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
Definition InjectorMomentum.H:352
GetTemperature temperature
Definition InjectorMomentum.H:366
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
InjectorMomentumJuttner(GetTemperature const &t, GetVelocity 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:371
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &) const noexcept
Definition InjectorMomentum.H:381
InjectorMomentumParser(amrex::ParserExecutor< 3 > const &a_ux_parser, amrex::ParserExecutor< 3 > const &a_uy_parser, amrex::ParserExecutor< 3 > const &a_uz_parser) noexcept
Definition InjectorMomentum.H:372
amrex::ParserExecutor< 3 > m_uz_parser
Definition InjectorMomentum.H:395
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition InjectorMomentum.H:390
amrex::ParserExecutor< 3 > m_uy_parser
Definition InjectorMomentum.H:395
amrex::ParserExecutor< 3 > m_ux_parser
Definition InjectorMomentum.H:395
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:574
InjectorMomentumGaussian gaussian
Definition InjectorMomentum.H:606
InjectorMomentumUniform uniform
Definition InjectorMomentum.H:608
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:583
Object(InjectorMomentumMaxwellian *, GetTemperatureVector const &t, GetVelocityVector const &b) noexcept
Definition InjectorMomentum.H:594
Object(InjectorMomentumParser *, amrex::ParserExecutor< 3 > const &a_ux_parser, amrex::ParserExecutor< 3 > const &a_uy_parser, amrex::ParserExecutor< 3 > const &a_uz_parser) noexcept
Definition InjectorMomentum.H:600
InjectorMomentumJuttner juttner
Definition InjectorMomentum.H:610
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:589
InjectorMomentumGaussianFlux gaussianflux
Definition InjectorMomentum.H:607
InjectorMomentumMaxwellian maxwellian
Definition InjectorMomentum.H:609
Object(InjectorMomentumJuttner *, GetTemperature const &t, GetVelocity const &b) noexcept
Definition InjectorMomentum.H:597
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:578
InjectorMomentumParser parser
Definition InjectorMomentum.H:611
InjectorMomentumConstant constant
Definition InjectorMomentum.H:605
Object(InjectorMomentumConstant *, amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
Definition InjectorMomentum.H:575