46 this->Bz_guiding /= norm;
54 RP::add(
"Alfven.B0",
"Guiding field value (T)", 1.0e-10);
55 RP::add(
"Alfven.Bx_guiding",
"Guiding field x component", 1);
56 RP::add(
"Alfven.By_guiding",
"Guiding field y component", 0);
57 RP::add(
"Alfven.Bz_guiding",
"Guiding field z component", 0);
58 RP::add(
"Alfven.Wavelength",
"Wavelength (m)", 100000.0);
59 RP::add(
"Alfven.A_mag",
"Amplitude of the magnetic perturbation", 0.1);
65 RP::add(pop +
"_Alfven.rho",
"Number density (m^-3)", 1.0e8);
66 RP::add(pop +
"_Alfven.Temperature",
"Temperature (K)", 0.86456498092);
67 RP::add(pop +
"_Alfven.A_vel",
"Amplitude of the velocity perturbation", 0.1);
76 RP::get(
"Alfven.B0", this->
B0);
77 RP::get(
"Alfven.Bx_guiding", this->
Bx_guiding);
78 RP::get(
"Alfven.By_guiding", this->
By_guiding);
79 RP::get(
"Alfven.Bz_guiding", this->
Bz_guiding);
80 RP::get(
"Alfven.Wavelength", this->
WAVELENGTH);
81 RP::get(
"Alfven.A_mag", this->
A_MAG);
89 RP::get(pop +
"_Alfven.rho", sP.
rho);
90 RP::get(pop +
"_Alfven.Temperature",sP.
T);
91 RP::get(pop +
"_Alfven.A_vel", sP.
A_VEL);
113 creal initV0X = sP.
A_VEL * ALFVEN_VEL * sin(this->
ALPHA) * sin(2.0 * M_PI * ksi);
114 creal initV0Y = - sP.
A_VEL * ALFVEN_VEL * cos(this->
ALPHA) * sin(2.0 * M_PI * ksi);
115 creal initV0Z = - sP.
A_VEL * ALFVEN_VEL * cos(2.0 * M_PI * ksi);
137 vmesh->getBlockInfo(blockGID,&blockCoords[0]);
138 creal vxBlock = blockCoords[0];
139 creal vyBlock = blockCoords[1];
140 creal vzBlock = blockCoords[2];
141 creal dvxCell = blockCoords[3];
142 creal dvyCell = blockCoords[4];
143 creal dvzCell = blockCoords[5];
145 creal vx = vxBlock + (
i+0.5)*dvxCell - initV0X;
146 creal vy = vyBlock + (
j+0.5)*dvyCell - initV0Y;
147 creal vz = vzBlock + (
k+0.5)*dvzCell - initV0Z;
176 const auto ALPHA_l = this->
ALPHA;
178 const auto B0_l = this->
B0;
179 const auto A_MAG_l = this->
A_MAG;
181 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
182 phiprof::initializeTimer(
"setProjectBField"), technical,
183 [=](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
184 const std::array<Real, 3> xyz = coordinates.getPhysicalCoords(stencil.i, stencil.j, stencil.k);
185 const std::array<Real, 3> gridSpacing = coordinates.physicalGridSpacing;
186 auto& cell = perb[stencil.ooo()];
188 const Real dx = gridSpacing[0];
189 const Real dy = gridSpacing[1];
190 const Real ksi = ((xyz[0] + 0.5 *
dx) * cos(ALPHA_l) + (xyz[1] + 0.5 * dy) * sin(ALPHA_l)) / WAVELENGTH_l;
191 const Real dBxavg = sin(2.0 * M_PI * ksi);
192 const Real dByavg = sin(2.0 * M_PI * ksi);
193 const Real dBzavg = cos(2.0 * M_PI * ksi);
sqrt(1.0+vA *vA/(c *c))) % Ion-acoustic wave cS
#define ARCH_INNER_BODY(...)
void setBackgroundFieldToZero(FieldSolverGrid &fsgrid, fsgrids::technicalspan technical, fsgrids::bgbspan bgb)
virtual void calcCellParameters(spatial_cell::SpatialCell *cell, creal &t) override
std::vector< AlfvenSpeciesParameters > speciesParams
virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
virtual void setProjectBField(fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
virtual bool initialize(void) override
static void addParameters(void)
virtual void getParameters(void) override
virtual bool initialize()
virtual void getParameters()
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::VelocityBlockContainer * get_velocity_blocks(const size_t &popID)
std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > 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 MaxwellianPhaseSpaceDensity(creal &vx, creal &vy, creal &vz, creal &T, creal &rho, creal &mass)
std::vector< species::Species > particleSpecies