include/pops/numerics/spatial/operators/polar_operator.hpp File ReferenceΒΆ

adc_cpp: include/pops/numerics/spatial/operators/polar_operator.hpp File 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
polar_operator.hpp File Reference

Additive POLAR spatial operator: R = -div_polar F + S on an annular grid (r, theta). More...

+ Include dependency graph for polar_operator.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pops::detail::PolarFaceFluxRKernel< Limiter, NumericalFlux, Model >
 
struct  pops::detail::PolarFaceFluxThetaKernel< Limiter, NumericalFlux, Model >
 PolarFaceFluxThetaKernel: device kernel of the flux at the azimuthal face j. More...
 
struct  pops::detail::PolarAssembleRhsKernel< Model >
 PolarAssembleRhsKernel: device kernel of the polar residual in cell (i,j). More...
 

Namespaces

namespace  pops
 
namespace  pops::detail
 

Concepts

concept  pops::detail::PolarHasSource
 PolarHasSource<M>: internal concept – true if M exposes source(U, aux) -> State.
 
concept  pops::detail::PolarHasGeomSource
 PolarHasGeomSource<M>: internal concept – true if M exposes polar_geom_source(u, r) -> State.
 

Functions

template<class Model >
POPS_HD Model::State pops::detail::polar_source (const Model &m, const typename Model::State &u, const Aux &a)
 polar_source<Model>: returns m.source(u, a) if PolarHasSource<Model>, otherwise the zero state.
 
template<class Model >
POPS_HD Model::State pops::detail::polar_geom_source (const Model &m, const typename Model::State &u, Real r)
 polar_geom_source<Model>: returns m.polar_geom_source(u, r) if PolarHasGeomSource<Model>, otherwise the zero state.
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::assemble_rhs_polar (const Model &model, const MultiFab &U, const MultiFab &aux, const PolarGeometry &geom, MultiFab &R, bool recon_prim=false, bool wall_radial=false, Real pos_floor=Real(0))
 assemble_rhs_polar<Limiter, NumericalFlux>: R = -div_polar F* + S on a PolarGeometry.
 

Detailed Description

Additive POLAR spatial operator: R = -div_polar F + S on an annular grid (r, theta).

"Annular polar grid" work, Phase 1 (TRANSPORT only). This is a SEPARATE assemble_rhs from the Cartesian history (pops/numerics/spatial_operator.hpp): that one stays STRICTLY UNTOUCHED, so a run on a Cartesian mesh is bit-identical. The polar path is PURELY ADDITIVE, opt-in (the caller chooses assemble_rhs_polar with a PolarGeometry).

AXIS CONVENTION (cf. PolarGeometry): index direction 0 = RADIAL (r), index direction 1 = AZIMUTHAL (theta). Domain r in [r_min, r_max] (physical BC in r), theta in [0, 2pi) (periodic).

DIVERGENCE IN POLAR COORDINATES (conservative form, finite volumes): div F = (1/r) d_r(r F_r) + (1/r) d_theta(F_theta) Per-cell discretization (i, j), with r_i = r_cell(i), r_{i+/-1/2} = r_face(i+1)/r_face(i), dr = PolarGeometry::dr(), dtheta = PolarGeometry::dtheta(): -div = -(1/r_i) (r_{i+1/2} Fr_{i+1/2} - r_{i-1/2} Fr_{i-1/2}) / dr -(1/r_i) (Ftheta_{j+1/2} - Ftheta_{j-1/2}) / dtheta Fr, Ftheta are the PHYSICAL numerical fluxes at the faces (the model returns the physical component in the local basis; cf. ExBVelocityPolar). The metric factor r at radial faces (and 1/r in cell) is carried HERE. CONSERVATION: the mass Sum_ij n_ij r_i dr dtheta sees the radial term telescope (the weight r_{i+1/2} of a face is shared by the two neighboring cells) and the azimuthal term telescope exactly (periodic). Only the radial fluxes at the physical boundaries r_min / r_max count: a wall (zero radial flux) conserves mass to machine precision.

NAMED FUNCTORS (not extended lambdas), like spatial_operator.hpp (#64/#97): robust device emission if the Model-template kernel is instantiated cross-TU. The RECONSTRUCTION (weno5z, minmod via reconstruct<>) and the numerical FLUX (RusanovFlux...) are REUSED verbatim from the Cartesian operator: direction-generic (dir 0/1), they apply as-is to the (r, theta) axes.