MagneticLorentzForce Struct ReferenceΒΆ

adc_cpp: pops::MagneticLorentzForce Struct Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends

MAGNETIC Lorentz force q (v x B) on momentum, field B = B_z z_hat out of plane. More...

#include <source.hpp>

+ Collaboration diagram for pops::MagneticLorentzForce:

Public Member Functions

template<class State >
POPS_HD State apply (const State &u, const Aux &a) const
 

Public Attributes

Real qom = 1
 
int c_mx = 1
 
int c_my = 2
 

Static Public Attributes

static constexpr int n_aux = 4
 

Detailed Description

MAGNETIC Lorentz force q (v x B) on momentum, field B = B_z z_hat out of plane.

EXPLICIT regime (moderate omega_c): ALGEBRAIC pointwise term (no derivative), coded once for BOTH geometries because it is INVARIANT under orientation of the local orthonormal frame (x,y) or (e_r, e_theta): (rho v_x, rho v_y) x B_z z_hat = (+B_z rho v_y, -B_z rho v_x) = (+B_z m_y, -B_z m_x) [cartesian] (rho v_r, rho v_th) x B_z z_hat = (+B_z rho v_th, -B_z rho v_r) = (+B_z m_th, -B_z m_r) [polar] So s[1] = +qom*B_z*m[2], s[2] = -qom*B_z*m[1] with m[1]=u[1] (1st momentum component), m[2]=u[2] (2nd). v x B is PERPENDICULAR to v: the work F . v = 0 -> s[3] (energy) stays ZERO even at 4 variables (the magnetic force does not change kinetic energy). qom = q/m (sign included, consistent with PotentialForce); the gyration sense (cyclotron) follows the sign of qom*B_z.

CONTRACT: pointwise SOURCE brick, device-callable (POPS_HD), no global state. Reads B_z from the aux (canonical component 3, as set_magnetic_field populates it) -> declares n_aux = 4 so the aux channel is sized and load_aux fills a.B_z. The STIFF regime (large omega_c) goes through the condensed Schur (ElectrostaticLorentzCondensation), NOT through this explicit brick. PRECONDITION: requires a fluid transport >= 3 variables (momentum on 2 axes); moot on a scalar.

Member Function Documentation

◆ apply()

template<class State >
POPS_HD State pops::MagneticLorentzForce::apply ( const State &  u,
const Aux a 
) const
inline

Member Data Documentation

◆ c_mx

int pops::MagneticLorentzForce::c_mx = 1

◆ c_my

int pops::MagneticLorentzForce::c_my = 2

◆ n_aux

constexpr int pops::MagneticLorentzForce::n_aux = 4
staticconstexpr

◆ qom

Real pops::MagneticLorentzForce::qom = 1

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