A class that describes a source of particles. More...
Public Member Functions | |
KrookSourceAdaptive (IdxRangeX const &gridx, IdxRangeVx const &gridvx, RhsType const type, double extent, double stiffness, double amplitude, double density, double temperature) | |
Creates an instance of the KrookSourceAdaptive class. | |
KrookSourceAdaptive (KrookSourceAdaptive &&)=default | |
Creates an instance of the KrookSourceAdaptive class. | |
DFieldSpXVx | operator() (DFieldSpXVx allfdistribu, double dt) const override |
Update the distribution function following the KrookSourceAdaptive operator. | |
void | get_amplitudes (DFieldSpX amplitudes, DConstFieldSpXVx allfdistribu) const |
Computes the amplitude coefficient of the KrookSourceAdaptive operator. | |
void | get_derivative (DFieldSpXVx df, DConstFieldSpXVx f, DConstFieldSpXVx f0) const |
Computes the expression of the time derivative of the distribution function. | |
A class that describes a source of particles.
The KrookSourceAdaptive class solves the following evolution equation: df/dt = -amplitude * mask * (f - ftarget)
mask defines the spatial region where the operator is active.
ftarget is a maxwellian characterized by density and temperature, and a zero fluid velocity.
amplitude depends on space, time and the considered species so that:
The complete description of the operator can be found in rhs docs.
KrookSourceAdaptive::KrookSourceAdaptive | ( | IdxRangeX const & | gridx, |
IdxRangeVx const & | gridvx, | ||
RhsType const | type, | ||
double | extent, | ||
double | stiffness, | ||
double | amplitude, | ||
double | density, | ||
double | temperature | ||
) |
Creates an instance of the KrookSourceAdaptive class.
[in] | gridx | The mesh in the x direction. |
[in] | gridvx | The mesh in the vx direction. |
[in] | type | A RhsType parameter that defines the region where the operator is active. If type = Source, the mask equals one in the central zone of the plasma of width extent; If type = Sink, the mask equals zero in the central zone of the plasma of width extent; |
[in] | extent | A parameter that sets the extent of the source. |
[in] | stiffness | A parameter that sets the stiffness of the source extent. |
[in] | amplitude | A parameter that sets the amplitude of the source. |
[in] | density | A parameter that sets the density of the Maxwellian ftarget. |
[in] | temperature | A parameter that sets the temperature of the Maxwellian ftarget. |
|
overridevirtual |
Update the distribution function following the KrookSourceAdaptive operator.
Update the distribution function for both electrons and ions to show how it is modified following the effect of the KrookSourceAdaptive operator.
[in,out] | allfdistribu | The distribution function. |
[in] | dt | The time step. |
Implements IRightHandSide.
void KrookSourceAdaptive::get_amplitudes | ( | DFieldSpX | amplitudes, |
DConstFieldSpXVx | allfdistribu | ||
) | const |
Computes the amplitude coefficient of the KrookSourceAdaptive operator.
This coefficient depends on the considered species and ensures that the operator conserves the charge locally.
[in,out] | amplitudes | A field that contains on output the amplitude coefficients for each species. |
[in] | allfdistribu | The distribution function. |
void KrookSourceAdaptive::get_derivative | ( | DFieldSpXVx | df, |
DConstFieldSpXVx | f, | ||
DConstFieldSpXVx | f0 | ||
) | const |
Computes the expression of the time derivative of the distribution function.
The expression is df = -amplitude * mask * (f - ftarget). This function is used for the time integrator (RK2 for instance).
[in,out] | df | The time derivative. |
[in] | f | The distribution function. |
[in] | f0 | An optional parameter. |