Framework for computational fluid dynamics simulations using Python. Use when running fluid dynamics simulations including Navier-Stokes equations (2D/3D), shallow water equations, stratified flows, or when analyzing turbulence, vortex dynamics, or geophysical flows. Provides pseudospectral methods with FFT, HPC support, and comprehensive output analysis.
SKILL.md
FluidSim
Use FluidSim 0.9.0 as a framework for Python-defined numerical solvers, especially
periodic Cartesian pseudospectral CFD. Upstream FluidSim is CeCILL-2.1; the MIT
frontmatter license applies only to this skill.
This skill does not treat a completed run, a stable time step, a smooth plot,
or a closed program exit as evidence of numerical convergence or physical
validity.
Required workflow
State equations, units or nondimensionalization, geometry, boundaries,
initial conditions, forcing, observables, and acceptance criteria.
Select a verified solver and inspect its generated default parameters.
Create a strict JSON plan with explicit CPU, RAM, disk, wall-time, output-file,
timestep, CFL, resolution, and dealiasing bounds.
Run the bundled validator and resource estimator.
Generate and review a dry-run script. It does nothing unless executed with an
explicit config-ID acknowledgement.
Run one tiny serial pilot. Inspect budgets, divergence/constraints, spectral
tails, CFL/time-step history, and output growth.
Refine grid and time step independently. Check conservation/budget residuals
and observable sensitivity.
Only then prepare a site-specific MPI job. Never submit or launch MPI
automatically.
Package metadata requires Python >=3.11 and lists Python 3.11–3.14.
Pseudospectral parameter creation needs FluidFFT; bare fluidsim imported in
the smoke test, but ns2d.create_default_params() failed until the fft extra
was installed.
Current companion versions tested here: fluidfft==0.4.5 and
pyFFTW==0.15.1.
The project lock is the reproducibility record; direct pins alone do not freeze
all transitive artifacts. Do not reuse a lock across incompatible platforms or
MPI ABIs.
FluidFFT also declares PFFT and P3DFFT extras; audit and pin their native
stacks for the target cluster.
FluidFFT documents cuFFT historically, but FluidFFT 0.4.5 declares no CUDA extra
or installed GPU plugin in its package metadata, and its CUDA installation page
is unfinished. Do not claim GPU acceleration or install an unrelated CUDA wheel
as a FluidSim backend. Treat GPU work as source-level experimental integration
requiring separate validation.
See installation for system dependencies, MPI ABI,
HDF5-MPI, backend discovery, and verification.
CFL field: params.time_stepping.cfl_coef, not CFL.
Time-correlated forcing:
params.forcing.tcrandom.time_correlation, not a flat
tcrandom_time_correlation.
NS2D default initial types include constant, noise, jet, dipole,
from_file, from_simul, and in_script; do not invent a universal list for
every solver.
Output state files default to state_phys_t*.nc; spectra use
spectra1D.h5/spectra2D.h5; scalar means are solver-dependent
spatial_means.txt or JSON-lines.
params.output.sub_directory is relative under FLUIDSIM_PATH.
ParamContainer rejects undeclared attributes. Always generate defaults from the
selected Simul class and inspect them before changing values. See
parameters.
Solvers
Primary Cartesian CFD keys and imports:
from fluidsim.solvers.ns2d.solver import Simul # ns2d
from fluidsim.solvers.ns2d.bouss.solver import Simul # ns2d.bouss
from fluidsim.solvers.ns2d.strat.solver import Simul # ns2d.strat
from fluidsim.solvers.ns3d.solver import Simul # ns3d
from fluidsim.solvers.ns3d.bouss.solver import Simul # ns3d.bouss
from fluidsim.solvers.ns3d.strat.solver import Simul # ns3d.strat
The 0.9 registry also includes plate2d, sw1l variants, waves2d, 1D models,
0D models, spherical solvers, and framework adapters. Availability in the
registry does not make a solver appropriate for a scientific question. Verify
equations, variables, geometry, boundaries, and diagnostics in the solver
source. See solvers.
Forcing and time advancement
Forcing is solver-specific. A current normalized random example is:
Record the forced variable, normalization definition, wave-number band, random
seed/state, injection target, and measured injection. FluidSim 0.9 saves state
parameters for restart; 0.8.6 fixed time-correlated forcing restart behavior.
Available pseudospectral schemes include Euler/RK2 phase-shift variants,
RK2_trapezoid, and RK4. A named order does not establish accuracy. Check CFL,
fast-wave/diffusive limits, deltat_max, and time-step refinement. See
advanced features.
load_sim_for_plot uses a coarse operator and disables saving/online plotting.
For a state-bearing object:
from fluidsim import load_state_phys_file
sim = load_state_phys_file("run-directory", t_approx="last")
For a controlled restart, prefer load_for_restart or first run
fluidsim-restart --only-check. Do not use --modify-params with untrusted text:
the upstream CLI executes Python code supplied to that option. This skill's
generator never emits it. Verify solver, grid/domain, state variables, versions,
forcing state, checksum, target time, output destination, and resource bounds.
Resolution changes require the dedicated reviewed workflow, not a silent grid
edit. See simulation workflow and
output analysis.
Scientific acceptance gate
Before interpreting results, require:
Explicit dimensional units or a complete nondimensionalization map.
Correct equations, periodic geometry/boundaries, initial state, forcing, and
diagnostic definitions.
Resolution and dealiasing evidence: spectra/tails, resolved gradients, and
solver-appropriate small-scale criteria.
Timestep evidence: CFL history, fastest-wave and dissipative limits, and
smaller-step comparison.
Conservation and budget checks including forcing, dissipation, transfers, and
residuals.
Grid/time refinement with uncertainty or sensitivity for reported
observables.
Comparison to an analytical solution, manufactured solution, benchmark, or
independently reproduced result where appropriate.
Complete provenance and restart lineage.
Never label a run “DNS,” “converged,” “validated,” “steady,” or “physically
correct” from parameter values or plots alone.
Bundled local tools
All tools emit strict JSON, reject URLs/traversal/symlinks, enforce hard bounds,
use no network or subprocess, and never launch a simulation: