ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
Loading...
Searching...
No Matches
orb5x::BackgroundModule Class Reference

Initializes equilibrium distribution functions used by marker loading and pushing. More...

#include "background.hpp"

Static Public Member Functions

static void get_background_flow (Real s, Real chi, Real phi, Real &vpar, Real &vperp)
 Query equilibrium parallel and perpendicular flow.
static Real get_background_potential (Real s, Real chi, Real phi)
 Query the equilibrium electrostatic potential.
static Real get_KE (Real ut, Real mu, Real b)
 Convert parallel velocity and magnetic moment to kinetic energy.
static Real get_mu (Real ut, Real ze, Real b)
 Recover magnetic moment from energy and parallel velocity.
static Real get_uabs (Real mu, Real ze, Real b)
 Recover the magnitude of parallel velocity from invariants.
static void init_background ()
 Initialize all species background distributions and emit the f0 dump.
static void load_background_fields (const std::string &fname)
 Validate a tabulated background-distribution HDF5 file.
static Real vf0_local_maxwellian (Real vth2, Real nval, Real ze)
 Evaluate an isotropic local Maxwellian.

Detailed Description

Initializes equilibrium distribution functions used by marker loading and pushing.

This facade implements the background-distribution stage of ORB5X: it initializes analytic or tabulated \(f_0\) data for every species, supplies normalized velocity-coordinate identities, and writes the reference distribution diagnostics. Equilibrium density, temperature, magnetic-field, and flow profiles are obtained from Equil; marker operations consume the resulting SpeciesVariables state through ParticleModule.

Member Function Documentation

◆ get_background_flow()

void orb5x::BackgroundModule::get_background_flow ( Real s,
Real chi,
Real phi,
Real & vpar,
Real & vperp )
static

Query equilibrium parallel and perpendicular flow.

Parameters
[in]sNormalized radial coordinate.
[in]chiPoloidal angle [rad].
[in]phiToroidal angle [rad].
[out]vparNormalized parallel flow; currently set to zero.
[out]vperpNormalized perpendicular flow; currently set to zero.
Note
This compatibility entry point is presently a stub, not Equil::profiles.

◆ get_background_potential()

Real orb5x::BackgroundModule::get_background_potential ( Real s,
Real chi,
Real phi )
static

Query the equilibrium electrostatic potential.

Parameters
[in]sNormalized radial coordinate.
[in]chiPoloidal angle [rad].
[in]phiToroidal angle [rad].
Returns
Currently zero; spatial background-potential interpolation is not implemented.

◆ get_KE()

Real orb5x::BackgroundModule::get_KE ( Real ut,
Real mu,
Real b )
static

Convert parallel velocity and magnetic moment to kinetic energy.

Parameters
[in]utNormalized parallel velocity.
[in]muNormalized magnetic moment per unit mass.
[in]bNormalized magnetic-field magnitude.
Returns
\(u_\parallel^2/2+\mu B\) in normalized energy-per-mass units.

◆ get_mu()

Real orb5x::BackgroundModule::get_mu ( Real ut,
Real ze,
Real b )
static

Recover magnetic moment from energy and parallel velocity.

Parameters
[in]utNormalized parallel velocity.
[in]zeNormalized kinetic energy per unit mass.
[in]bNormalized magnetic-field magnitude.
Returns
\((\mathcal{E}-u_\parallel^2/2)/B\), or zero when B is singular.

◆ get_uabs()

Real orb5x::BackgroundModule::get_uabs ( Real mu,
Real ze,
Real b )
static

Recover the magnitude of parallel velocity from invariants.

Parameters
[in]muNormalized magnetic moment per unit mass.
[in]zeNormalized kinetic energy per unit mass.
[in]bNormalized magnetic-field magnitude.
Returns
\(\sqrt{2(\mathcal{E}-\mu B)}\), clipped to zero outside its domain.

◆ init_background()

void orb5x::BackgroundModule::init_background ( )
static

Initialize all species background distributions and emit the f0 dump.

◆ load_background_fields()

void orb5x::BackgroundModule::load_background_fields ( const std::string & fname)
static

Validate a tabulated background-distribution HDF5 file.

Parameters
[in]fnamePath containing /f0/psi, /f0/u, and /f0/ze datasets.
Exceptions
std::runtime_errorif the path or required HDF5 objects are absent.

◆ vf0_local_maxwellian()

Real orb5x::BackgroundModule::vf0_local_maxwellian ( Real vth2,
Real nval,
Real ze )
static

Evaluate an isotropic local Maxwellian.

Parameters
[in]vth2Squared normalized thermal speed \(v_{th}^2\).
[in]nvalLocal normalized density.
[in]zeNormalized kinetic energy per unit mass.
Returns
\(n(2\pi v_{th}^2)^{-3/2}\exp(-\mathcal{E}/v_{th}^2)\), or zero for non-positive density or thermal speed.

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