Science and numerics — practical limits¶
This page collects honest expectations: OpenPFC is a serious HPC framework, but no numerical method is universal. For code layering, read architecture.md; for spectral vs FD direction, read when_not_to_use_openpfc.md and adr/0002-gradient-operators-fd-vs-spectral.md.
Spectral semi-implicit style (typical shipped models)¶
Linear operators are often treated implicitly in Fourier space; nonlinear terms are evaluated in real space and coupled through FFTs.
Timestep
dtmust respect the explicit pieces of your splitting; blowing up often meansdtis too large for the nonlinear or stabilized explicit stages—not “MPI is broken.”Resolution changes physics: interface widths, defect cores, and nucleation depend on grid spacing; do not compare runs at different resolutions without a convergence mindset.
Aliasing: a degree-p polynomial of a field restricted to integer modes
|m_i| <= K_iproduces frequencies up top*K_i. To obtain the exact retained Galerkin product by sampling and transforming, require(p+1)*K_i < N_ion each axis. Thus quadratic products need3*K_i < N_i, while cubic products need4*K_i < N_i. The input state and every nonlinear stage must respect the intended retained band. Filtering only the product’s high modes cannot remove aliases already folded into low modes.pfc::fft::kspace::fill_two_thirds_masksupplies a two-thirds Nyquist-band cutoff; it does not by itself fully dealias a cubic. A sufficiently padded product grid is another option. No general filter is enabled automatically for arbitrary models.Incompressible velocity:
pfc::field::leray_projectremoves the longitudinal part of a periodic Fourier velocity, \(P = I - kk^{\mathsf T}/|k|^2\). The wavevector is the odd multiplier, so the mean and the even-grid Nyquist mode stay unchanged. The quadratic term is \(P(u\times\omega)\) after a state-level 2/3 truncation (solvers/incompressible/rotational.hpp). That mask is on for this term only. A 3/2 padded product is not used.Nyquist (odd derivatives):
SpectralGradientzerosi kat the even-grid Nyquist mode. The real-to-complex Nyquist coefficient is real; a nonzeroi k_Nis not uniquely defined.2-D vorticity NS (issue #21) and incompressible MHD (issue #23):
examples/ns2d_vorticityreuses the 2/3 mask and odd-\(k\) rule, and projects the state onto the retained band before products. The nonlinear term is IFRK4. MHD adds a magnetic potential \(a\) with Lorentz \(+B\cdot\nabla j\); it is 2-D incompressible MHD, not Strauss reduced MHD. A current-sheet movie is not reconnection.
Finite differences (kernel helpers and examples)¶
FD stencils need halo exchange; in-place vs separated halos interact with FFT layouts (
halo_exchange.md).FD and spectral operators can coexist in principle; user-facing unified switching for gradients/Laplacians is still maturing (see ADR 0002).
What pretty pictures do not prove¶
Visualizations (VTK, PNG) are diagnostics. They do not replace mesh/time convergence, mass/energy checks where applicable, or comparison to reference solutions.
See also¶
science_tungsten_quicklook.md— what the tungsten model encodesscience_cahn_hilliard_vs_allen_cahn.md— example entry points