Computational fluid dynamics simulation library for Python.

Install

mkdir -p .claude/skills/fluidsim && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7573" && unzip -o skill.zip -d .claude/skills/fluidsim && rm skill.zip

Installs to .claude/skills/fluidsim

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
357 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Solve 2D and 3D Navier-Stokes equations
  • Model stratified and shallow water flows
  • Perform pseudospectral analysis with FFT
  • Execute parallel simulations using MPI
  • Generate physical field and spectral plots

How it works

It uses an object-oriented Python framework to execute pseudospectral methods for solving fluid equations, use Pythran/Transonic for performance.

Inputs & outputs

You give it
Simulation parameters and physical domain configuration
You get back
Fluid simulation data and visualization plots

When to use fluidsim

  • Simulate stratified flows
  • Analyze vortex dynamics
  • Solve Navier-Stokes equations
  • Model turbulence

About this skill

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

  1. State equations, units or nondimensionalization, geometry, boundaries, initial conditions, forcing, observables, and acceptance criteria.
  2. Select a verified solver and inspect its generated default parameters.
  3. Create a strict JSON plan with explicit CPU, RAM, disk, wall-time, output-file, timestep, CFL, resolution, and dealiasing bounds.
  4. Run the bundled validator and resource estimator.
  5. Generate and review a dry-run script. It does nothing unless executed with an explicit config-ID acknowledgement.
  6. Run one tiny serial pilot. Inspect budgets, divergence/constraints, spectral tails, CFL/time-step history, and output growth.
  7. Refine grid and time step independently. Check conservation/budget residuals and observable sensitivity.
  8. Only then prepare a site-specific MPI job. Never submit or launch MPI automatically.
  9. Preserve config, script, uv.lock, package/platform/backend versions, logs, output inventory, checksums, and restart lineage.

Stop if physical assumptions, units, boundary conditions, forcing semantics, resolution criteria, resource limits, or acceptance criteria are missing.

Version and installation

As verified on 2026-07-23:

  • Latest stable PyPI release: fluidsim==0.9.0 (2025-12-04).
  • 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.

Prefer a project lock:

uv init --python 3.11
uv add "fluidsim[fft]==0.9.0" "fluidfft==0.4.5" "pyFFTW==0.15.1"
uv lock
uv sync --frozen

For an isolated disposable environment:

uv venv --python 3.11
uv pip install "fluidsim[fft]==0.9.0" "fluidfft==0.4.5" "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.

MPI is optional and native:

uv add "mpi4py==4.1.2" "fluidfft-mpi-with-fftw==0.0.1" "fluidfft-fftwmpi==0.0.1"
uv lock

Those packages still require a compatible MPI runtime and FFTW development libraries. The optional native plugins are:

  • fluidfft-fftw==0.0.1: sequential fft2d.with_fftw1d, fft2d.with_fftw2d, fft3d.with_fftw3d.
  • fluidfft-mpi-with-fftw==0.0.1: MPI fft2d.mpi_with_fftw1d, fft3d.mpi_with_fftw1d.
  • fluidfft-fftwmpi==0.0.1: MPI-enabled FFTW fft2d.mpi_with_fftwmpi2d, fft3d.mpi_with_fftwmpi3d.
  • fluidfft-p3dfft==0.0.1: fft3d.mpi_with_p3dfft; requires P3DFFT.
  • 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.

API snapshot

Use direct, versioned imports:

from fluidsim.solvers.ns2d.solver import Simul

params = Simul.create_default_params()
params.oper.nx = params.oper.ny = 32
params.oper.Lx = params.oper.Ly = 2 * 3.141592653589793
params.oper.coef_dealiasing = 2 / 3
params.time_stepping.USE_CFL = True
params.time_stepping.cfl_coef = 0.5
params.time_stepping.deltat0 = 0.001
params.time_stepping.deltat_max = 0.01
params.time_stepping.t_end = 0.1
params.time_stepping.max_elapsed = "00:05:00"
params.init_fields.type = "noise"
params.init_fields.noise.velo_max = 0.01
params.output.HAS_TO_SAVE = False
params.output.ONLINE_PLOT_OK = False

Important 0.9 corrections:

  • 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:

params.forcing.enable = True
params.forcing.type = "tcrandom"
params.forcing.forcing_rate = 1.0
params.forcing.nkmin_forcing = 4
params.forcing.nkmax_forcing = 5
params.forcing.tcrandom.time_correlation = "based_on_forcing_rate"

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.

Outputs, loading, and restart

For read-only analysis:

from fluidsim import load_sim_for_plot

sim = load_sim_for_plot("run-directory", hide_stdout=True)
sim.output.spatial_means.plot()
sim.output.spectra.plot1d()
sim.output.phys_fields.plot(time=1.0)

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:

python3 scripts/solver_config_validator.py --example
python3 scripts/solver_config_validator.py --config config.json
python3 scripts/grid_resource_estimator.py --config config.json
python3 scripts/simulation_dry_run.py --config config.json --output run.py
python3 scripts/output_inventory.py --path run-directory
python3 scripts/budget_summary.py --path run-directory
python3 scripts/restart_compatibility.py --source state.nc --target-config config.json

The HDF5 tools lazily require h5py, inspect bounded metadata/hyperslabs, and never follow external links or load full field arrays.

References


Content truncated.

When not to use it

  • Non-fluid dynamics computational problems
  • Simulations requiring non-periodic boundary conditions

Prerequisites

PythonuvMPI (for parallel)

Limitations

  • Primarily designed for periodic-domain equations
  • Requires specific environment setup for FFT and MPI support

How it compares

It offers high-performance CFD capabilities within a Python environment, bridging the gap between ease of use and Fortran-like execution speed.

Compared to similar skills

fluidsim side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
fluidsim (this skill)12moReviewAdvanced
llava78moReviewAdvanced
cocoindex69moReviewIntermediate
ai-multimodal96moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by K-Dense-AI

View all by K-Dense-AI

literature-review

K-Dense-AI

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).

5591,298

markitdown

K-Dense-AI

Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing. Use when converting documents to markdown, extracting text from PDFs/Office files, transcribing audio, performing OCR on images, extracting YouTube transcripts, or processing batches of files. Supports 20+ formats including DOCX, XLSX, PPTX, PDF, HTML, EPUB, CSV, JSON, images with OCR, and audio with transcription.

177310

scientific-writing

K-Dense-AI

Write scientific manuscripts. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting guidelines (CONSORT/STROBE/PRISMA), abstracts, for research papers and journal submissions.

94309

exploratory-data-analysis

K-Dense-AI

Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically detects file type and generates detailed markdown reports with format-specific analysis, quality metrics, and downstream analysis recommendations. Covers chemistry, bioinformatics, microscopy, spectroscopy, proteomics, metabolomics, and general scientific data formats.

15114

infographics

K-Dense-AI

Create professional infographics using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Integrates research-lookup and web search for accurate data. Supports 10 infographic types, 8 industry styles, and colorblind-safe palettes.

1141

pptx-posters

K-Dense-AI

Create research posters using HTML/CSS that can be exported to PDF or PPTX. Use this skill ONLY when the user explicitly requests PowerPoint/PPTX poster format. For standard research posters, use latex-posters instead. This skill provides modern web-based poster design with responsive layouts and easy visual integration.

911

You might also like

llava

zechenzhangAGI

Large Language and Vision Assistant. Enables visual instruction tuning and image-based conversations. Combines CLIP vision encoder with Vicuna/LLaMA language models. Supports multi-turn image chat, visual question answering, and instruction following. Use for vision-language chatbots or image understanding tasks. Best for conversational image analysis.

7117

cocoindex

cocoindex-io

Comprehensive toolkit for developing with the CocoIndex library. Use when users need to create data transformation pipelines (flows), write custom functions, or operate flows via CLI or API. Covers building ETL workflows for AI data processing, including embedding documents into vector databases, building knowledge graphs, creating search indexes, or processing data streams with incremental updates.

6116

ai-multimodal

mrgoonie

Process and generate multimedia content using Google Gemini API. Capabilities include analyze audio files (transcription with timestamps, summarization, speech understanding, music/sound analysis up to 9.5 hours), understand images (captioning, object detection, OCR, visual Q&A, segmentation), process videos (scene detection, Q&A, temporal analysis, YouTube URLs, up to 6 hours), extract from documents (PDF tables, forms, charts, diagrams, multi-page), generate images (text-to-image, editing, composition, refinement). Use when working with audio/video files, analyzing images or screenshots, processing PDF documents, extracting structured data from media, creating images from text prompts, or implementing multimodal AI features. Supports multiple models (Gemini 2.5/2.0) with context windows up to 2M tokens.

9108

rag-implementation

wshobson

Build Retrieval-Augmented Generation (RAG) systems for LLM applications with vector databases and semantic search. Use when implementing knowledge-grounded AI, building document Q&A systems, or integrating LLMs with external knowledge bases.

10101

rdkit

K-Dense-AI

Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.

856

pyhealth

davila7

Comprehensive healthcare AI toolkit for developing, testing, and deploying machine learning models with clinical data. This skill should be used when working with electronic health records (EHR), clinical prediction tasks (mortality, readmission, drug recommendation), medical coding systems (ICD, NDC, ATC), physiological signals (EEG, ECG), healthcare datasets (MIMIC-III/IV, eICU, OMOP), or implementing deep learning models for healthcare applications (RETAIN, SafeDrug, Transformer, GNN).

351

Search skills

Search the agent skills registry