The equations of carafe.mhd, declared on the code that implements them and checked by the tests.
The HLLD flux through faces between two states.
- speeds
- SL=min(uL,uR)−max(cfL,cfR),SR=max(uL,uR)+max(cfL,cfR),SL∗=SM−ρL∗∣Bn∣,SR∗=SM+ρR∗∣Bn∣
- contact
- SM=(SR−uR)ρR−(SL−uL)ρL(SR−uR)ρRuR−(SL−uL)ρLuL−pTR+pTL
- star
- ρK∗=ρKSK−SMSK−uK,vtK∗=vtK−BnBtKρK(SK−uK)(SK−SM)−Bn2SM−uK,BtK∗=BtKρK(SK−uK)(SK−SM)−Bn2ρK(SK−uK)2−Bn2
- double star
- vt∗∗=ρL∗+ρR∗ρL∗vtL∗+ρR∗vtR∗+(BtR∗−BtL∗)sgnBn
- Assumes
- ideal MHD, a gamma-law gas; the normal field is one value on both sides of the face
- where the star denominator vanishes (B_t = 0 and B_n^2 = rho (S - u)(S - S_M)) the tangential velocity and field keep their values
- References
MHD (2.5D) on the patches of a patchwork hierarchy; see the module docstring.
- mass
- ∂tρ+∇⋅(ρu)=0
- momentum
- ∂t(ρu)+∇⋅(ρuu+pTI−BB)=0,pT=p+21∣B∣2
- energy
- ∂tE+∇⋅((E+pT)u−(u⋅B)B)=0,E=γ−1p+21ρ∣u∣2+21∣B∣2
- field
- Bx=B0x+∂yAz,By=B0y−∂xAz,∂tAz=−Ez=uxBy−uyBx−ηJz,∂tBz+∇⋅(Bzu−uzB)=η∇2Bz
- resistive
- E+=ηJ,J=∇×B,energy flux+=ηJ×B
- conduction
- q=−κ∥b(b⋅∇T)−κ⊥∇T,T=p/ρ,∂yT∣x-face=MC(MC(δi−1+,δi−1−),MC(δi+,δi−))
- gravity
- ∂t(ρu)+=ρg,∂tE+=ρu⋅g
- walls
- mirrored halo, un→−un,Az(w−k)=2Az(w)−Az(w+k),Ez∣w=0
- ct contact
- Ez=41(∑facesEzf)+41(∑4 half-faces(Ezf−Ezc)upwind)
- Order
- 2
- Assumes
- MHD in the plane with three velocity and field components; Heaviside–Lorentz units (μ0=1); uniform resistivity η, explicit
- in-plane field from a nodal Az: zero discrete divergence per cell and on the composite mesh, to round-off
- MUSCL on the primitives, HLLD, CT-contact electric field, Heun (SSP-RK2) at CFL 0.4; refluxing at coarse–fine faces
- Cartesian, uniform levels, one time step for all levels; periodic, outflow or conducting-wall faces; regridding interpolates Az bilinearly
- uniform κ∥, κ⊥ and g; Sharma–Hammett limited transverse gradients; gravity not well balanced
- the order is that of a smooth Alfvén wave with the unlimited reconstruction
- References
- Built from