Gyselalib++
 
Loading...
Searching...
No Matches
KrookSourceAdaptive Class Reference

A class that describes a source of particles. More...

Inheritance diagram for KrookSourceAdaptive:
IRightHandSide

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.
 

Detailed Description

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:

  • amplitude(ions) = m_amplitude = constant
  • amplitude(electrons, x, t) = m_amplitude (density_ions(x,t) - m_density) / (density_electrons(x,t) - m_density)
    so that the operator conserves locally the charge.

The complete description of the operator can be found in rhs docs.

Constructor & Destructor Documentation

◆ KrookSourceAdaptive()

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.

Parameters
[in]gridxThe mesh in the x direction.
[in]gridvxThe mesh in the vx direction.
[in]typeA 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]extentA parameter that sets the extent of the source.
[in]stiffnessA parameter that sets the stiffness of the source extent.
[in]amplitudeA parameter that sets the amplitude of the source.
[in]densityA parameter that sets the density of the Maxwellian ftarget.
[in]temperatureA parameter that sets the temperature of the Maxwellian ftarget.

Member Function Documentation

◆ operator()()

DFieldSpXVx KrookSourceAdaptive::operator() ( DFieldSpXVx  allfdistribu,
double  dt 
) const
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.

Parameters
[in,out]allfdistribuThe distribution function.
[in]dtThe time step.
Returns
A field referencing the distribution function passed as argument.

Implements IRightHandSide.

◆ get_amplitudes()

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.

Parameters
[in,out]amplitudesA field that contains on output the amplitude coefficients for each species.
[in]allfdistribuThe distribution function.

◆ get_derivative()

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).

Parameters
[in,out]dfThe time derivative.
[in]fThe distribution function.
[in]f0An optional parameter.

The documentation for this class was generated from the following file: