50 RP::add(
"Dispersion.B0",
"Guide magnetic field strength (T)", 1.0e-9);
51 RP::add(
"Dispersion.magXPertAbsAmp",
"Absolute amplitude of the magnetic perturbation along x (T)", 1.0e-9);
52 RP::add(
"Dispersion.magYPertAbsAmp",
"Absolute amplitude of the magnetic perturbation along y (T)", 1.0e-9);
53 RP::add(
"Dispersion.magZPertAbsAmp",
"Absolute amplitude of the magnetic perturbation along z (T)", 1.0e-9);
54 RP::add(
"Dispersion.maxwCutoff",
"Cutoff for the maxwellian distribution", 1e-12);
55 RP::add(
"Dispersion.angleXY",
"Orientation of the guide magnetic field with respect to the x-axis in x-y plane (rad)", 0.001);
56 RP::add(
"Dispersion.angleXZ",
"Orientation of the guide magnetic field with respect to the x-axis in x-z plane (rad)", 0.001);
61 RP::add(pop +
"_Dispersion.VX0",
"Bulk velocity (m/s)", 0.0);
62 RP::add(pop +
"_Dispersion.VY0",
"Bulk velocity (m/s)", 0.0);
63 RP::add(pop +
"_Dispersion.VZ0",
"Bulk velocity (m/s)", 0.0);
64 RP::add(pop +
"_Dispersion.rho",
"Number density (m^-3)", 1.0e7);
65 RP::add(pop +
"_Dispersion.Temperature",
"Temperature (K)", 2.0e6);
66 RP::add(pop +
"_Dispersion.densityPertRelAmp",
"Relative amplitude of the density perturbation", 0.1);
67 RP::add(pop +
"_Dispersion.velocityPertAbsAmp",
"Absolute amplitude of the velocity perturbation", 1.0e6);
75 RP::get(
"Dispersion.B0", this->
B0);
79 RP::get(
"Dispersion.maxwCutoff", this->
maxwCutoff);
80 RP::get(
"Dispersion.angleXY", this->
angleXY);
81 RP::get(
"Dispersion.angleXZ", this->
angleXZ);
87 RP::get(pop +
"_Dispersion.VX0", sP.
VX0);
88 RP::get(pop +
"_Dispersion.VY0", sP.
VY0);
89 RP::get(pop +
"_Dispersion.VZ0", sP.
VZ0);
90 RP::get(pop +
"_Dispersion.rho", sP.
DENSITY);
91 RP::get(pop +
"_Dispersion.Temperature", sP.
TEMPERATURE);
101 const dccrg::Dccrg<spatial_cell::SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
162 const uint nRequested
191 vmesh->getBlockInfo(blockGID,&blockCoords[0]);
192 creal vxBlock = blockCoords[0];
193 creal vyBlock = blockCoords[1];
194 creal vzBlock = blockCoords[2];
195 creal dvxCell = blockCoords[3];
196 creal dvyCell = blockCoords[4];
197 creal dvzCell = blockCoords[5];
199 creal vx = vxBlock + (
i+0.5)*dvxCell - initV0X;
200 creal vy = vyBlock + (
j+0.5)*dvyCell - initV0Y;
201 creal vz = vzBlock + (
k+0.5)*dvzCell - initV0Z;
211 std::default_random_engine rndState;
240 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
241 phiprof::initializeTimer(
"setProjectBField"), technical,
242 [=](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
243 const std::array<Real, 3> xyz = coordinates.getPhysicalCoords(stencil.i, stencil.j, stencil.k);
244 auto& cell = perb[stencil.ooo()];
246 const auto seedmodifier = coordinates.globalIDFromLocalCoordinates(stencil.i, stencil.j, stencil.k);
247 std::default_random_engine rndState_l;
248 rndState_l.seed(
seed+seedmodifier);
250 rndBuffer[0] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
251 rndBuffer[1] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
252 rndBuffer[2] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
#define ARCH_INNER_BODY(...)
void setBackgroundField(const FieldFunction &bgFunction, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, bool append)
void initialize(const double Bx, const double By, const double Bz)
virtual void calcCellParameters(spatial_cell::SpatialCell *cell, creal &t) override
virtual void setProjectBField(fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
static void addParameters(void)
virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
virtual bool initialize(void) override
virtual void getParameters(void) override
std::vector< DispersionSpeciesParameters > speciesParams
virtual void hook(cuint &stage, const dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::perbspan perb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) const override
Real getRandomNumber(std::default_random_engine &randGen) const
virtual bool initialize()
virtual void getParameters()
void setRandomCellSeed(spatial_cell::SpatialCell *cell, std::default_random_engine &randGen) const
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::VelocityBlockContainer * get_velocity_blocks(const size_t &popID)
vmesh::VelocityBlockContainer * dev_get_velocity_blocks(const size_t &popID)
vmesh::VelocityMesh * dev_get_velocity_mesh(const size_t &popID)
ARCH_HOSTDEV Realf * getData()
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
ObjectWrapper & getObjectWrapper()
static void parallel_reduce(const uint(&limits)[NDim], Lambda loop_body, T &sum)
std::span< std::array< Real, fsgrids::bfield::N_BFIELD > > perbspan
std::span< technical > technicalspan
std::span< std::array< Real, bgbfield::N_BGB > > bgbspan
ARCH_HOSTDEV Realf MaxwellianPhaseSpaceDensity(creal &vx, creal &vy, creal &vz, creal &T, creal &rho, creal &mass)
std::vector< species::Species > particleSpecies