49 RP::add(
"LossCone.BX0",
"Background field value (T)", 1.0e-9);
50 RP::add(
"LossCone.BY0",
"Background field value (T)", 2.0e-9);
51 RP::add(
"LossCone.BZ0",
"Background field value (T)", 3.0e-9);
52 RP::add(
"LossCone.magXPertAbsAmp",
"Amplitude of the magnetic perturbation along x", 1.0e-9);
53 RP::add(
"LossCone.magYPertAbsAmp",
"Amplitude of the magnetic perturbation along y", 1.0e-9);
54 RP::add(
"LossCone.magZPertAbsAmp",
"Amplitude of the magnetic perturbation along z", 1.0e-9);
60 RP::add(pop +
"_LossCone.rho",
"Number density (m^-3)", 1.0e7);
61 RP::add(pop +
"_LossCone.TemperatureX",
"Temperature (K)", 2.0e6);
62 RP::add(pop +
"_LossCone.TemperatureY",
"Temperature (K)", 2.0e6);
63 RP::add(pop +
"_LossCone.TemperatureZ",
"Temperature (K)", 2.0e6);
64 RP::add(pop +
"_LossCone.densityPertRelAmp",
"Amplitude factor of the density perturbation", 0.1);
65 RP::add(pop +
"_LossCone.VX0",
"Initial bulk velocity in x-direction", 0.0);
66 RP::add(pop +
"_LossCone.VY0",
"Initial bulk velocity in y-direction", 0.0);
67 RP::add(pop +
"_LossCone.VZ0",
"Initial bulk velocity in z-direction", 0.0);
68 RP::add(pop +
"_LossCone.velocityPertAbsAmp",
"Amplitude of the velocity perturbation", 1.0e6);
69 RP::add(pop +
"_LossCone.muLimit",
"Cutoff value for pitch-cosine mu positive and negative)", 0.5);
77 RP::get(
"LossCone.BX0", this->
BX0);
78 RP::get(
"LossCone.BY0", this->
BY0);
79 RP::get(
"LossCone.BZ0", this->
BZ0);
88 RP::get(pop +
"_LossCone.rho", sP.
DENSITY);
89 RP::get(pop +
"_LossCone.VX0", sP.
V0[0]);
90 RP::get(pop +
"_LossCone.VY0", sP.
V0[1]);
91 RP::get(pop +
"_LossCone.VZ0", sP.
V0[2]);
92 RP::get(pop +
"_LossCone.TemperatureX", sP.
TEMPERATUREX);
93 RP::get(pop +
"_LossCone.TemperatureY", sP.
TEMPERATUREY);
94 RP::get(pop +
"_LossCone.TemperatureZ", sP.
TEMPERATUREZ);
97 RP::get(pop +
"_LossCone.muLimit", sP.
muLimit);
104 const uint nRequested
139 vmesh->getBlockInfo(blockGID,&blockCoords[0]);
140 creal vxBlock = blockCoords[0];
141 creal vyBlock = blockCoords[1];
142 creal vzBlock = blockCoords[2];
143 creal dvxCell = blockCoords[3];
144 creal dvyCell = blockCoords[4];
145 creal dvzCell = blockCoords[5];
147 creal vx = vxBlock + (
i+0.5)*dvxCell - initV0X;
148 creal vy = vyBlock + (
j+0.5)*dvyCell - initV0Y;
149 creal vz = vzBlock + (
k+0.5)*dvzCell - initV0Z;
154 Real modv =
sqrt(vx*vx + vy*vy + vz*vz);
159 if (
mu > -muLimit &&
mu < muLimit) {
192 creal vx = vx_in - initV0X;
193 creal vy = vy_in - initV0Y;
194 creal vz = vz_in - initV0Z;
214 std::default_random_engine rndState;
244 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
245 phiprof::initializeTimer(
"setProjectBField"), technical,
246 [=](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
247 auto& cell = perb[stencil.ooo()];
249 const auto seedmodifier = coordinates.globalIDFromLocalCoordinates(stencil.i, stencil.j, stencil.k);
250 std::default_random_engine rndState_l;
251 rndState_l.seed(
seed+seedmodifier);
253 rndBuffer[0] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
254 rndBuffer[1] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
255 rndBuffer[2] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
271 std::array<Real, 3> V0 {{0.0, 0.0, 0.0}};
272 std::vector<std::array<Real, 3> > centerPoints;
273 centerPoints.push_back(V0);
sqrt(1.0+vA *vA/(c *c))) % Ion-acoustic wave cS
#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 std::vector< std::array< Real, 3 > > getV0(creal x, creal y, creal z, const uint popID) const override
Return a vector containing the velocity coordinate of the centre of each ion population in the distri...
virtual bool initialize(void) override
virtual void calcCellParameters(spatial_cell::SpatialCell *cell, creal &t) override
virtual Realf probePhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, Real vx_in, Real vy_in, Real vz_in) const override
virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
std::vector< LossConeSpeciesParameters > speciesParams
static void addParameters(void)
virtual void setProjectBField(fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
virtual void getParameters(void) 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)
Real * get_cell_parameters()
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 TriMaxwellianPhaseSpaceDensity(creal &vx, creal &vy, creal &vz, creal &Tx, creal &Ty, creal &Tz, creal &rho, creal &mass)
std::vector< species::Species > particleSpecies
static ARCH_HOSTDEV VecSimple< T > abs(const VecSimple< T > &l)