Skip to content

Physical models ​

PRISM solves Maxwell's equations in first-order form for the electric displacement D and the magnetic induction B, in vacuum (D=ε0E, B=μ0H), driven by a current density J:

∂D∂t=∇×Bμ0−J,∂B∂t=−∇×Dε0,∇⋅D=ρ,∇⋅B=0.

In conservation form ∂tq+∑d∂xdFd(q)=S, with the fluxes of (D,B)

Fx=(0, Bzμ0, −Byμ0, 0, −Dzε0, Dyε0),

and Fy, Fz by cyclic permutation; the source is −J on D. The characteristic speeds are ±c0, c0=1/ε0μ0, and two zero speeds. J has no flux: it is set at every stage by the coils and, under PIC, deposited by the particles.

Models ​

[physics] physical_model selects one of four models (input; an unknown value is fatal):

Modelphysical_modelCurrent and chargeUnits
ElectromagneticEM (and aliases)J from the coilsSI
Non-dimensional electromagneticAdimEMas EML0, B0 (below)
Particle-in-cellPICJ from the coils and the particles; ρ from the particles, carried in the stateSI
Non-dimensional PICAdimPICas PICL0, B0

The particles, their deposition and their push are on the particle-in-cell page.

State vector ​

The state width nv follows from the model and the divergence correction, with one source for both the width and the variable names (physics%var_phi, physics%var_psi, var_Jx; #61):

SlotVariablePresent
1–3Dx,Dy,Dzalways
4–6Bx,By,Bzalways
7φ (GLM scalar of D) or ψ (of B)hyperbolic with D or B
7, 8φ, ψhyperbolic with DB
next 3Jx,Jy,Jzalways
lastρPIC models

So nv = 9 (EM), 10 (one GLM scalar, or PIC), 11 (DB, or PIC with one scalar) and 12 (PIC with DB), the maximum NV_MAX = 12; a larger nv is fatal at initialization.

Physical constants ​

adam_prism_parameters:

ConstantValue
μ01.256637e-6 H/m
ε08.854187e-12 F/m
c01/μ0ε0
electron charge-1.6e-19 C
electron mass9.11e-31 kg
ion mass (H⁺)1.67262192595e-27 kg
neutral massion mass + electron mass
kB1.380649e-23 J/K

Non-dimensional form ​

Under AdimEM and AdimPIC the input stays in SI and PRISM scales it by the reference length L0 and field B0 ([physics] L0, B0, both required and positive):

T0=L0c0,D0=B0c0ε0,I0=B0L0μ0,ρ0=D0L0,Q0=ρ0L03.

The equations become ∂tD=∇×B−J, ∂tB=−∇×D, with unit speed of light. Lengths (grid, coil geometry, pulse widths), times, fields and currents are converted at initialization.

Divergence correction ​

The discrete operators keep ∇⋅B at round-off on a uniform grid (numerics), but not across a 2:1 AMR face, a deposit that does not conserve charge, or a source that is not divergence-free. [numerics] divergence_correction = hyperbolic adds the generalized-Lagrange-multiplier (GLM) scalars selected by constrained_transport (D: φ, B: ψ, DB: both):

∂D∂t=∇×Bμ0−∇φ−J,∂φ∂t=−ch2(∇⋅D−ρ)−αφ,∂B∂t=−∇×Dε0−∇ψ,∂ψ∂t=−ch2∇⋅B−αψ,

with ρ present only under PIC. The cleaning speed is ch=χc0 ([physics] chi, required, positive) and α the damping rate ([physics] alpha, default 0; in 1/s under EM and PIC, in units of 1/T0 under the non-dimensional models, where it is not converted; with α>0 the time step is also capped at 1/α). The fastest signal is then max(1,χ)c0, which sets the CFL time step.

  • hyperbolic without D, B or DB is refused at initialization: there would be no scalar to carry.
  • poisson (a projection) is refused: no backend implements it.
  • no ignores constrained_transport with a warning.

The full matrix of constrained_transport × divergence_correction is in the input hazards.