ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::EfluidModule Class Reference

Advances the reduced FLU-ORB electron density, parallel flow, pressure, and Ohm response. More...

#include "efluid.hpp"

Public Types

using FieldP2COperatorHook = void(*)(int matnum, const Kokkos::View< Real *** > &in, Kokkos::View< Real *** > &out)
 Signature of an injectable projection-to-coefficient solve operator.
 
using MatmulOperatorHook = void(*)(int matnum, const Kokkos::View< Real *** > &in, Kokkos::View< Real *** > &out)
 Signature of an injectable matrix multiplication operator.
 

Static Public Member Functions

static void apar_rk4 (int i_it)
 Execute one RK4 stage for the Ohm-law parallel vector potential.
 
static void clear_test_operator_hooks ()
 Clear test hooks and restore production field operators.
 
static void destroyStaticViews ()
 Release electron-fluid Kokkos allocations before Kokkos::finalize().
 
static Kokkos::View< Real *** > get_apar_ohm ()
 Return a shallow view of the Ohm-law \(A_\parallel\) coefficients.
 
static void icond_efluid ()
 Project the configured analytic electron-density initial condition into spline coefficients.
 
static void init_efluid ()
 Allocate fluid unknowns and RK4 work arrays on the field B-spline bounds.
 
static void ne_rk4 (int i_it)
 Execute one RK4 stage for electron density.
 
static void pe_rk4 (int i_it)
 Execute one RK4 stage for electron pressure.
 
static void push_apar ()
 Evaluate the generalized-Ohm RHS \(\partial A_\parallel/\partial t\) into RK4 work storage.
 
static void push_ne ()
 Evaluate the electron continuity-equation RHS into RK4 work storage.
 
static void push_pe ()
 Evaluate the electron pressure-closure RHS into RK4 work storage.
 
static void restart_fields (int flag, int datn)
 Read or write pullback and electron-fluid restart fields.
 
static void set_test_operator_hooks (MatmulOperatorHook matmul_hook, FieldP2COperatorHook fieldP2C_hook)
 Install deterministic matrix operators for unit tests.
 
static void sol_phi ()
 Solve quasineutrality for electrostatic potential using the current electron density.
 
static void sol_ue ()
 Solve the electron parallel-flow constraint from current/Ampere coupling.
 
static void update_field (int i_it, Kokkos::View< Real *** > &work0, Kokkos::View< Real *** > &work1, Kokkos::View< Real *** > &work2)
 Combine one RK4 stage into a fluid field and its accumulators.
 
static void update_work1 (int iter, Kokkos::View< Real *** > &work1)
 Scale or accumulate an RK4 stage derivative in work1.
 

Detailed Description

Advances the reduced FLU-ORB electron density, parallel flow, pressure, and Ohm response.

This model replaces kinetic electrons with field-aligned fluid continuity, generalized Ohm, and pressure equations while retaining kinetic-ion coupling through the common finite-element field solver. Unknowns are stored as tensor-product B-spline coefficients and advanced with classical RK4.

Fortran reference efluid.F90, module efluid.

Member Typedef Documentation

◆ FieldP2COperatorHook

using orb5x::EfluidModule::FieldP2COperatorHook = void (*)(int matnum, const Kokkos::View<Real***>& in, Kokkos::View<Real***>& out)

Signature of an injectable projection-to-coefficient solve operator.

Parameters
[in]matnumField-solver matrix selector.
[in]inProjected coefficients.
[out]outSolution-space spline coefficients.

◆ MatmulOperatorHook

using orb5x::EfluidModule::MatmulOperatorHook = void (*)(int matnum, const Kokkos::View<Real***>& in, Kokkos::View<Real***>& out)

Signature of an injectable matrix multiplication operator.

Parameters
[in]matnumField-solver matrix selector.
[in]inSolution-space spline coefficients.
[out]outProjected coefficients.

Member Function Documentation

◆ apar_rk4()

static void orb5x::EfluidModule::apar_rk4 ( int  i_it)
static

Execute one RK4 stage for the Ohm-law parallel vector potential.

Parameters
[in]i_itRK4 stage selector expected by update_field().

◆ clear_test_operator_hooks()

static void orb5x::EfluidModule::clear_test_operator_hooks ( )
static

Clear test hooks and restore production field operators.

◆ destroyStaticViews()

static void orb5x::EfluidModule::destroyStaticViews ( )
static

Release electron-fluid Kokkos allocations before Kokkos::finalize().

◆ get_apar_ohm()

static Kokkos::View< Real *** > orb5x::EfluidModule::get_apar_ohm ( )
static

Return a shallow view of the Ohm-law \(A_\parallel\) coefficients.

Returns
Reference-counted Kokkos View sharing the module's spline storage.

◆ icond_efluid()

static void orb5x::EfluidModule::icond_efluid ( )
static

Project the configured analytic electron-density initial condition into spline coefficients.

◆ init_efluid()

static void orb5x::EfluidModule::init_efluid ( )
static

Allocate fluid unknowns and RK4 work arrays on the field B-spline bounds.

◆ ne_rk4()

static void orb5x::EfluidModule::ne_rk4 ( int  i_it)
static

Execute one RK4 stage for electron density.

Parameters
[in]i_itRK4 stage selector expected by update_field().

◆ pe_rk4()

static void orb5x::EfluidModule::pe_rk4 ( int  i_it)
static

Execute one RK4 stage for electron pressure.

Parameters
[in]i_itRK4 stage selector expected by update_field().

◆ push_apar()

static void orb5x::EfluidModule::push_apar ( )
static

Evaluate the generalized-Ohm RHS \(\partial A_\parallel/\partial t\) into RK4 work storage.

◆ push_ne()

static void orb5x::EfluidModule::push_ne ( )
static

Evaluate the electron continuity-equation RHS into RK4 work storage.

◆ push_pe()

static void orb5x::EfluidModule::push_pe ( )
static

Evaluate the electron pressure-closure RHS into RK4 work storage.

◆ restart_fields()

static void orb5x::EfluidModule::restart_fields ( int  flag,
int  datn 
)
static

Read or write pullback and electron-fluid restart fields.

Parameters
[in]flag1 reads and 2 writes a checkpoint.
[in]datnRestart record number used to construct the filename.
Fortran reference efluid.F90:restart_fields.

◆ set_test_operator_hooks()

static void orb5x::EfluidModule::set_test_operator_hooks ( MatmulOperatorHook  matmul_hook,
FieldP2COperatorHook  fieldP2C_hook 
)
static

Install deterministic matrix operators for unit tests.

Null hooks fall back to production FieldsModule operations.

Parameters
[in]matmul_hookOptional replacement for field-matrix multiplication.
[in]fieldP2C_hookOptional replacement for projection-to-coefficient solves.

◆ sol_phi()

static void orb5x::EfluidModule::sol_phi ( )
static

Solve quasineutrality for electrostatic potential using the current electron density.

◆ sol_ue()

static void orb5x::EfluidModule::sol_ue ( )
static

Solve the electron parallel-flow constraint from current/Ampere coupling.

◆ update_field()

static void orb5x::EfluidModule::update_field ( int  i_it,
Kokkos::View< Real *** > &  work0,
Kokkos::View< Real *** > &  work1,
Kokkos::View< Real *** > &  work2 
)
static

Combine one RK4 stage into a fluid field and its accumulators.

Parameters
[in]i_itRK4 stage selector.
[in,out]work0Evolving fluid-field coefficients.
[in,out]work1Current stage derivative/temporary state.
[in,out]work2Weighted RK4 derivative accumulator.

◆ update_work1()

static void orb5x::EfluidModule::update_work1 ( int  iter,
Kokkos::View< Real *** > &  work1 
)
static

Scale or accumulate an RK4 stage derivative in work1.

Parameters
[in]iterZero-based RK4 stage selector.
[in,out]work1Stage derivative array.

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