Sapphire++
 v1.3.0-121-g2682132
Loading...
Searching...
No Matches
sapphirepp::VFP Namespace Reference

Namespace for the Vlasov-Fokker-Planck module. More...

Classes

class  InitialValueFunction
 Initial condition. More...
class  BoundaryValueFunction
 Inflow boundary condition. More...
class  ScatteringFrequency
 Scattering frequency. More...
class  Source
 Source term. More...
class  MagneticField
 Magnetic field. More...
class  BackgroundVelocityField
 Background velocity field. More...
class  DebugInputFunctions
 This class collects the user-defined input functions to output them as debug information. More...
class  NumericalFlux
 Class to compute the numerical fluxes in the VFP equation. More...
class  ParticleVelocity
 A function to compute the particle velocity at a point in reduced phase space \( (\mathbf{x}, p) \). More...
class  ParticleGamma
 Function to compute the particle gamma factor \( \gamma \) at a point in reduced phase space \( (\mathbf{x}, p) \). More...
class  PDESystem
 Calculate the matrices of the PDE system. More...
class  ProbeLocation
 PostProcessor unit to probe location in reduced phase space and reconstruct the phase space distribution. More...
struct  ReferenceValues
 Reference values for the VFP equation. More...
class  VFPParameters
 Parameters class for the VFP module. More...
class  VFPSolver
 This class solves the Vlasov-Fokker-Planck equation. More...

Enumerations

enum class  VFPFlags : std::uint16_t {
  none = 0 , time_evolution = 1 << 0 , spatial_advection = 1 << 1 , collision = 1 << 2 ,
  rotation = 1 << 3 , time_independent_fields = 1 << 4 , momentum = 1 << 5 , linear_p = 1 << 6 ,
  source = 1 << 7 , time_independent_source = 1 << 8 , scaled_distribution_function = 1 << 9 , local_lax_friedrichs_flux = 1 << 10 ,
  radiation_reaction = 1 << 11
}
 Flags to activate the different terms of the VFP equation. More...
enum class  BoundaryConditions : std::uint8_t {
  continuous , zero_inflow , reflective , inflow ,
  periodic
}
 Boundary conditions for the VFP equation. More...
enum class  TimeSteppingMethod : std::uint8_t {
  crank_nicolson , forward_euler , backward_euler , erk4 ,
  lserk4
}
 Time stepping methods for the VFP equation. More...
enum class  GridType : std::uint8_t { hypercube , shock , file }
 Grid generation types for the VFP equation. More...

Functions

template<typename StreamType>
StreamType & operator<< (StreamType &os, const ReferenceValues &reference_values)
 Output reference values to a stream.
constexpr VFPFlags operator| (VFPFlags f1, VFPFlags f2)
 Implement the bitwise OR operator for the VFPFlags.
constexpr VFPFlags operator& (VFPFlags f1, VFPFlags f2)
 Implement the bitwise AND operator for the VFPFlags.
template<typename StreamType>
StreamType & operator<< (StreamType &os, VFPFlags f)
 Print the VFPFlags to a stream.

Variables

constexpr unsigned int dimension = 2
constexpr VFPFlags vfp_flags

Detailed Description

Namespace for the Vlasov-Fokker-Planck module.

Enumeration Type Documentation

◆ BoundaryConditions

enum class sapphirepp::VFP::BoundaryConditions : std::uint8_t
strong

Boundary conditions for the VFP equation.

Enumerator
continuous 

Continuous. The distribution function at the boundary is continuously extrapolated from the interior.

zero_inflow 

Zero inflow. Only outflow, no inflow at the boundary.

reflective 

Reflective. The particles velocity is reflected at the boundary.

inflow 

Inflow. Inflow plus outflow. Inflow at specified boundary is determined by a boundary value function.

periodic 

Periodic boundary conditions. Has to be set on both sides of the boundary.

◆ GridType

enum class sapphirepp::VFP::GridType : std::uint8_t
strong

Grid generation types for the VFP equation.

Enumerator
hypercube 

Create a hypercube grid.

shock 

Create a grid for a shock problem in x-direction.

file 

Use a grid that is read from a file.

◆ TimeSteppingMethod

enum class sapphirepp::VFP::TimeSteppingMethod : std::uint8_t
strong

Time stepping methods for the VFP equation.

Enumerator
crank_nicolson 

Implicit Crank-Nicolson method.

forward_euler 

Explicit Euler method.

backward_euler 

Implicit Euler method.

erk4 

Fourth order Runge-Kutta method.

lserk4 

Low storage fourth order Runge-Kutta method.

◆ VFPFlags

enum class sapphirepp::VFP::VFPFlags : std::uint16_t
strong

Flags to activate the different terms of the VFP equation.

We split the VFP equation into different terms,

\begin{align} \frac{\partial f}{\partial t} & \quad & \text{(time-evolution term)} \\ & + (\mathbf{u} + \mathbf{v}) \cdot \nabla_{x} f & \text{(spatial advection term)} \\ & - \gamma m \frac{\mathrm{D} \mathbf{u}}{\mathrm{D} t} \cdot \nabla_{p}f - \mathbf{p} \cdot\nabla_{x} \mathbf{u}\cdot \nabla_{p} f & \text{(momentum term)} \\ & + q \mathbf{v} \cdot \left( \mathbf{B} \times \nabla_{p} f \right) & \text{(rotation term)} \\ & + \nabla_{p} \cdot \left( \sigma \Big( \mathbf{B}\,(\mathbf{B}\cdot\boldsymbol{\beta}) + \gamma^{2}\,\boldsymbol{\beta}\, \big((\boldsymbol{\beta}\cdot\mathbf{B})^{2} - B^{2}\big) \Big)\, f \right) & \text{(radiation reaction term)} \\ = & \frac{\nu}{2} \Delta_{\theta, \varphi} f & \text{(collision term)} \\ & + S \,. & \text{(source term)} \\ \end{align}

These terms can be individually activated or deactivated.

Enumerator
time_evolution 

Activate the time-evolution term \( \frac{\partial f}{\partial t} \)

spatial_advection 

Activate the spatial advection term \( (\mathbf{u} + \mathbf{v}) \cdot \nabla_x f \)

collision 

Activate the collision term \( \frac{\nu}{2} \Delta_{\theta, \varphi} f \)

rotation 

Activate the rotation term, i.e. the magnetic field \( q \mathbf{v} \cdot \left( \mathbf{B} \times \nabla_{p} f \right) \)

time_independent_fields 

If the fields \( \mathbf{u} \) and \(\mathbf{B} \) are time independent, this flag should be used.
This significantly improves performance, as it requires the dg_matrix to be assembled only once.
By default the fields are assumed to be time dependent.

momentum 

Activate the momentum term \( \left( \gamma m \frac{\mathrm{D} \mathbf{u}}{\mathrm{D} t} + \mathbf{p} \cdot\nabla_{x} \mathbf{u} \right) \cdot \nabla_{p} f \)

linear_p 

Use a linear momentum variable, \( p \).
By default a logarithmic momentum variable, \( \ln(p) \), is used.

source 

Activate the source term \( S(\mathbf{x}, \mathbf{p}, t) \)

time_independent_source 

If the source \( S \) is time independent, this flag should be used.
This significantly improves performance, as it requires the system_rhs to be assembled only once.
By default the source is assumed to be time dependent.

scaled_distribution_function 

Use a scaled in distribution function, \( g = p^s f \). The exponent is fixed to \( s = 3 \), i.e. \( g = p^3 f \).

local_lax_friedrichs_flux 

Use the local Lax-Friedrichs flux instead of the default Upwind flux. The Upwind flux is much more memory heavy but is more robust. The local Lax-Friedrichs flux is less robust but requires less memory.

radiation_reaction 

Activate the radiation reaction term \( + \nabla_{p} \cdot \left( \sigma \Big( \mathbf{B}\,(\mathbf{B}\cdot\boldsymbol{\beta}) + \gamma^{2}\,\boldsymbol{\beta} \left((\boldsymbol{\beta}\cdot\mathbf B)^{2} - B^{2}\right) \Big)\, f \right) \)

Function Documentation

◆ operator&()

VFPFlags sapphirepp::VFP::operator& ( VFPFlags f1,
VFPFlags f2 )
constexpr

Implement the bitwise AND operator for the VFPFlags.

Parameters
f1First VFPFlags
f2Second VFPFlags
Returns
constexpr VFPFlags f1 & f2

◆ operator<<() [1/2]

template<typename StreamType>
StreamType & sapphirepp::VFP::operator<< ( StreamType & os,
const ReferenceValues & reference_values )

Output reference values to a stream.

Template Parameters
StreamTypeType of the stream
Parameters
osOutput stream
reference_valuesReference values
Returns
StreamType& os

◆ operator<<() [2/2]

template<typename StreamType>
StreamType & sapphirepp::VFP::operator<< ( StreamType & os,
VFPFlags f )
inline

Print the VFPFlags to a stream.

Template Parameters
StreamTypeType of the output stream
Parameters
osOutput stream
fVFPFlags
Returns
StreamType& os

◆ operator|()

VFPFlags sapphirepp::VFP::operator| ( VFPFlags f1,
VFPFlags f2 )
constexpr

Implement the bitwise OR operator for the VFPFlags.

Parameters
f1First VFPFlags
f2Second VFPFlags
Returns
constexpr VFPFlags f1 | f2

Variable Documentation

◆ dimension

unsigned int sapphirepp::VFP::dimension = 2
constexpr

[Dimension] Specify reduced phase space dimension \( (\mathbf{x}, p) \)

◆ vfp_flags

VFPFlags sapphirepp::VFP::vfp_flags
constexpr
Initial value:
@ time_independent_fields
Definition vfp-flags.h:109
@ source
Definition vfp-flags.h:128
@ momentum
Definition vfp-flags.h:116
@ time_evolution
Definition vfp-flags.h:81
@ time_independent_source
Definition vfp-flags.h:137
@ collision
Definition vfp-flags.h:93
@ spatial_advection
Definition vfp-flags.h:87

[Dimension] [VFP Flags] Specify which terms of the VFP equation should be active