The Taylor–Green vortex starts from a smooth array of counter-rotating vortices in a periodic cube, \([-\pi,\pi]^3\). Their interaction transfers kinetic energy to smaller scales, where viscosity dissipates it. This makes the problem useful both for checking a discretization and for measuring its cost as the mesh is refined. The hydrodynamic case follows the Re=1600 workshop specification. The electromagnetic cases are extensions for checking conservation and coupling; the workshop's reference histories apply only to hydrodynamics.
With reference density and velocity equal to one, the initial velocity is
\[ u=(\sin x\cos y\cos z,-\cos x\sin y\cos z,0). \]
The Reynolds number is 1600. Compressible flow uses a perfect gas with \(\gamma=1.4\), Mach number 0.1 and Prandtl number 0.71. Its initial pressure is
\[ p=p_0+\frac{(\cos 2x+\cos 2y)(\cos 2z+2)}{16}, \qquad p_0=\frac{1}{\gamma(0.1)^2}. \]
Temperature is initially uniform, so density follows from \(\rho=p/p_0\). Incompressible flow instead fixes \(\rho=1\) and obtains pressure from the momentum constraint. Both start with mean kinetic energy \(1/8\).
Each field sector uses its Hamiltonian to obtain the constitutive fields: \(E=\partial H/\partial D\) and \(H_B=\partial H/\partial B\).
| Selection | Field model and coupling |
|---|---|
--hd | Navier–Stokes without electromagnetic fields. |
--ehd | Electric quasistatic limit: solve Gauss's law for the potential, advect charge, and apply the electric force. Magnetic feedback is omitted. |
--mhd | Magnetic quasistatic limit: advance magnetic flux with Faraday's law and an Ohm-law electric field; omit displacement current and apply the magnetic force. |
--fmhd | Full Maxwell evolution of electric displacement and magnetic induction, with charge conservation and the Lorentz force. |
The benchmark uses \(\epsilon=\mu=1\). Electric cases start from \(\phi=0.1\cos x\cos y\cos z\); charge is initialized from discrete Gauss's law. Magnetic cases start from \(B=0.25e_z+\nabla\times(0,0,0.15\sin x\sin y\sin z)\).
--ideal means zero resistivity for MHD, and zero conductivity with advected charge for EHD and FMHD. --resistive adds Ohmic conduction: electrical resistivity is 0.001 for MHD and 10 for EHD and FMHD. The fluid viscosity and heat conduction remain active in both selections. Full Maxwell propagation remains active in ideal FMHD; its wave speed here is one.
--N selects the number of unique periodic nodes in each direction, with spacing \(2\pi/N\). The code stores vorticity and magnetic flux as two-cochains and calls the exterior module for reduction, reconstruction, exterior derivative, codifferential and Hodge Laplacian. Pointwise physics supplies material laws and forces. NavierStokesFourier supplies the centered two-point transport flux; the benchmark reduces its face samples and applies the codifferential. This flux conserves mass and total energy on the periodic grid, but does not enforce positivity. Incompressible velocity comes from the native two-form Hodge solve; its diagnostic Bernoulli pressure uses the scalar Hodge solve. Both use the library matrix-free solver.
Fluid and field models are combined through CoupledFluidElectromagnetism, which composes the sectors and the generated electric and magnetic exchange laws with CombinePhysics. Select electric quasistatics, magnetic quasistatics, or full Maxwell dynamics by supplying the corresponding field model. The assembly accepts one spatially reduced current for force, power, and field updates; it adds no new degrees of freedom. With fluid energy as the state, exchange adds \(J\cdot E\) once. With fluid-plus-field energy, the flux contains Poynting transport instead. The benchmark uses fluid energy and pairs its electric work on the same edges as Ampere's law.
The exterior operators and benchmark selection remain header-only. The final benchmark source instantiates its Laplacian choices directly; no separately compiled Laplacian implementations are linked.
Build with SIMILIE_BUILD_BENCHMARKS=ON, then run the executable from the build directory, for example:
The default is incompressible ideal HD. Select one flag from each model group; resistive HD is invalid. --validate performs the small-grid consistency checks. Google Benchmark controls repetitions and timing. Each timed iteration advances one adaptive step along a trajectory; inspect simulated time as well as timing when comparing cases. Use energy histories, dissipation, Gauss residuals and cochain closure errors to assess accuracy before drawing performance conclusions.