{"id":"fluidsim","name":"fluidsim","summary":"明確な数値妥当性とHPCの安全性チェックを備えた、境界付きのFluidSim計算流体力学シミュレーションを計画、設定、検査、再起動、解析します。","body":"# FluidSim\n\nUse FluidSim 0.9.0 as a framework for Python-defined numerical solvers, especially\nperiodic Cartesian pseudospectral CFD. Upstream FluidSim is CeCILL-2.1; the MIT\nfrontmatter license applies only to this skill.\n\nThis skill does **not** treat a completed run, a stable time step, a smooth plot,\nor a closed program exit as evidence of numerical convergence or physical\nvalidity.\n\n## Required workflow\n\n1. State equations, units or nondimensionalization, geometry, boundaries,\n   initial conditions, forcing, observables, and acceptance criteria.\n2. Select a verified solver and inspect its generated default parameters.\n3. Create a strict JSON plan with explicit CPU, RAM, disk, wall-time, output-file,\n   timestep, CFL, resolution, and dealiasing bounds.\n4. Run the bundled validator and resource estimator.\n5. Generate and review a dry-run script. It does nothing unless executed with an\n   explicit config-ID acknowledgement.\n6. Run one tiny serial pilot. Inspect budgets, divergence/constraints, spectral\n   tails, CFL/time-step history, and output growth.\n7. Refine grid and time step independently. Check conservation/budget residuals\n   and observable sensitivity.\n8. Only then prepare a site-specific MPI job. Never submit or launch MPI\n   automatically.\n9. Preserve config, script, `uv.lock`, package/platform/backend versions, logs,\n   output inventory, checksums, and restart lineage.\n\nStop if physical assumptions, units, boundary conditions, forcing semantics,\nresolution criteria, resource limits, or acceptance criteria are missing.\n\n## Version and installation\n\nAs verified on 2026-07-23:\n\n- Latest stable PyPI release: `fluidsim==0.9.0` (2025-12-04).\n- Package metadata requires Python `>=3.11` and lists Python 3.11–3.14.\n- Pseudospectral parameter creation needs FluidFFT; bare `fluidsim` imported in\n  the smoke test, but `ns2d.create_default_params()` failed until the `fft` extra\n  was installed.\n- Current companion versions tested here: `fluidfft==0.4.5` and\n  `pyFFTW==0.15.1`.\n\nPrefer a project lock:\n\n```bash\nuv init --python 3.11\nuv add \"fluidsim[fft]==0.9.0\" \"fluidfft==0.4.5\" \"pyFFTW==0.15.1\"\nuv lock\nuv sync --frozen\n```\n\nFor an isolated disposable environment:\n\n```bash\nuv venv --python 3.11\nuv pip install \"fluidsim[fft]==0.9.0\" \"fluidfft==0.4.5\" \"pyFFTW==0.15.1\"\n```\n\nThe project lock is the reproducibility record; direct pins alone do not freeze\nall transitive artifacts. Do not reuse a lock across incompatible platforms or\nMPI ABIs.\n\nMPI is optional and native:\n\n```bash\nuv add \"mpi4py==4.1.2\" \"fluidfft-mpi-with-fftw==0.0.1\" \"fluidfft-fftwmpi==0.0.1\"\nuv lock\n```\n\nThose packages still require a compatible MPI runtime and FFTW development\nlibraries. The optional native plugins are:\n\n- `fluidfft-fftw==0.0.1`: sequential\n  `fft2d.with_fftw1d`, `fft2d.with_fftw2d`, `fft3d.with_fftw3d`.\n- `fluidfft-mpi-with-fftw==0.0.1`: MPI\n  `fft2d.mpi_with_fftw1d`, `fft3d.mpi_with_fftw1d`.\n- `fluidfft-fftwmpi==0.0.1`: MPI-enabled FFTW\n  `fft2d.mpi_with_fftwmpi2d`, `fft3d.mpi_with_fftwmpi3d`.\n- `fluidfft-p3dfft==0.0.1`: `fft3d.mpi_with_p3dfft`; requires P3DFFT.\n- FluidFFT also declares PFFT and P3DFFT extras; audit and pin their native\n  stacks for the target cluster.\n\nFluidFFT documents cuFFT historically, but FluidFFT 0.4.5 declares no CUDA extra\nor installed GPU plugin in its package metadata, and its CUDA installation page\nis unfinished. Do not claim GPU acceleration or install an unrelated CUDA wheel\nas a FluidSim backend. Treat GPU work as source-level experimental integration\nrequiring separate validation.\n\nSee [installation](references/installation.md) for system dependencies, MPI ABI,\nHDF5-MPI, backend discovery, and verification.\n\n## API snapshot\n\nUse direct, versioned imports:\n\n```python\nfrom fluidsim.solvers.ns2d.solver import Simul\n\nparams = Simul.create_default_params()\nparams.oper.nx = params.oper.ny = 32\nparams.oper.Lx = params.oper.Ly = 2 * 3.141592653589793\nparams.oper.coef_dealiasing = 2 / 3\nparams.time_stepping.USE_CFL = True\nparams.time_stepping.cfl_coef = 0.5\nparams.time_stepping.deltat0 = 0.001\nparams.time_stepping.deltat_max = 0.01\nparams.time_stepping.t_end = 0.1\nparams.time_stepping.max_elapsed = \"00:05:00\"\nparams.init_fields.type = \"noise\"\nparams.init_fields.noise.velo_max = 0.01\nparams.output.HAS_TO_SAVE = False\nparams.output.ONLINE_PLOT_OK = False\n```\n\nImportant 0.9 corrections:\n\n- CFL field: `params.time_stepping.cfl_coef`, not `CFL`.\n- Time-correlated forcing:\n  `params.forcing.tcrandom.time_correlation`, not a flat\n  `tcrandom_time_correlation`.\n- NS2D default initial types include `constant`, `noise`, `jet`, `dipole`,\n  `from_file`, `from_simul`, and `in_script`; do not invent a universal list for\n  every solver.\n- Output state files default to `state_phys_t*.nc`; spectra use\n  `spectra1D.h5`/`spectra2D.h5`; scalar means are solver-dependent\n  `spatial_means.txt` or JSON-lines.\n- `params.output.sub_directory` is relative under `FLUIDSIM_PATH`.\n\n`ParamContainer` rejects undeclared attributes. Always generate defaults from the\nselected `Simul` class and inspect them before changing values. See\n[parameters](references/parameters.md).\n\n## Solvers\n\nPrimary Cartesian CFD keys and imports:\n\n```python\nfrom fluidsim.solvers.ns2d.solver import Simul       # ns2d\nfrom fluidsim.solvers.ns2d.bouss.solver import Simul # ns2d.bouss\nfrom fluidsim.solvers.ns2d.strat.solver import Simul # ns2d.strat\nfrom fluidsim.solvers.ns3d.solver import Simul       # ns3d\nfrom fluidsim.solvers.ns3d.bouss.solver import Simul # ns3d.bouss\nfrom fluidsim.solvers.ns3d.strat.solver import Simul # ns3d.strat\n```\n\nThe 0.9 registry also includes `plate2d`, `sw1l` variants, `waves2d`, 1D models,\n0D models, spherical solvers, and framework adapters. Availability in the\nregistry does not make a solver appropriate for a scientific question. Verify\nequations, variables, geometry, boundaries, and diagnostics in the solver\nsource. See [solvers](references/solvers.md).\n\n## Forcing and time advancement\n\nForcing is solver-specific. A current normalized random example is:\n\n```python\nparams.forcing.enable = True\nparams.forcing.type = \"tcrandom\"\nparams.forcing.forcing_rate = 1.0\nparams.forcing.nkmin_forcing = 4\nparams.forcing.nkmax_forcing = 5\nparams.forcing.tcrandom.time_correlation = \"based_on_forcing_rate\"\n```\n\nRecord the forced variable, normalization definition, wave-number band, random\nseed/state, injection target, and measured injection. FluidSim 0.9 saves state\nparameters for restart; 0.8.6 fixed time-correlated forcing restart behavior.\n\nAvailable pseudospectral schemes include Euler/RK2 phase-shift variants,\n`RK2_trapezoid`, and `RK4`. A named order does not establish accuracy. Check CFL,\nfast-wave/diffusive limits, `deltat_max`, and time-step refinement. See\n[advanced features](references/advanced_features.md).\n\n## Outputs, loading, and restart\n\nFor read-only analysis:\n\n```python\nfrom fluidsim import load_sim_for_plot\n\nsim = load_sim_for_plot(\"run-directory\", hide_stdout=True)\nsim.output.spatial_means.plot()\nsim.output.spectra.plot1d()\nsim.output.phys_fields.plot(time=1.0)\n```\n\n`load_sim_for_plot` uses a coarse operator and disables saving/online plotting.\nFor a state-bearing object:\n\n```python\nfrom fluidsim import load_state_phys_file\n\nsim = load_state_phys_file(\"run-directory\", t_approx=\"last\")\n```\n\nFor a controlled restart, prefer `load_for_restart` or first run\n`fluidsim-restart --only-check`. Do not use `--modify-params` with untrusted text:\nthe upstream CLI executes Python code supplied to that option. This skill's\ngenerator never emits it. Verify solver, grid/domain, state variables, versions,\nforcing state, checksum, target time, output destination, and resource bounds.\nResolution changes require the dedicated reviewed workflow, not a silent grid\nedit. See [simulation workflow](references/simulation_workflow.md) and\n[output analysis](references/output_analysis.md).\n\n## Scientific acceptance gate\n\nBefore interpreting results, require:\n\n- Explicit dimensional units or a complete nondimensionalization map.\n- Correct equations, periodic geometry/boundaries, initial state, forcing, and\n  diagnostic definitions.\n- Resolution and dealiasing evidence: spectra/tails, resolved gradients, and\n  solver-appropriate small-scale criteria.\n- Timestep evidence: CFL history, fastest-wave and dissipative limits, and\n  smaller-step comparison.\n- Conservation and budget checks including forcing, dissipation, transfers, and\n  residuals.\n- Grid/time refinement with uncertainty or sensitivity for reported\n  observables.\n- Comparison to an analytical solution, manufactured solution, benchmark, or\n  independently reproduced result where appropriate.\n- Complete provenance and restart lineage.\n\nNever label a run “DNS,” “converged,” “validated,” “steady,” or “physically\ncorrect” from parameter values or plots alone.\n\n## Bundled local tools\n\nAll tools emit strict JSON, reject URLs/traversal/symlinks, enforce hard bounds,\nuse no network or subprocess, and never launch a simulation:\n\n```bash\npython3 scripts/solver_config_validator.py --example\npython3 scripts/solver_config_validator.py --config config.json\npython3 scripts/grid_resource_estimator.py --config config.json\npython3 scripts/simulation_dry_run.py --config config.json --output run.py\npython3 scripts/output_inventory.py --path run-directory\npython3 scripts/budget_summary.py --path run-directory\npython3 scripts/restart_compatibility.py --source state.nc --target-config config.json\n```\n\nThe HDF5 tools lazily require `h5py`, inspect bounded metadata/hyperslabs, and\nnever follow external links or load full field arrays.\n\n## References\n\n- [Installation and FFT/MPI backends](references/installation.md)\n- [Solver registry and selection](references/solvers.md)\n- [Simulation, pilot, and restart workflow](references/simulation_workflow.md)\n- [Verified parameter surface](references/parameters.md)\n- [Output, plotting, and budget analysis](references/output_analysis.md)\n- [Forcing, operators, MPI, and migrations](references/advanced_features.md)\n\n## Dated upstream basis\n\nVerified 2026-07-23 against\n[PyPI 0.9.0](https://pypi.org/project/fluidsim/),\n[FluidSim 0.9 docs](https://fluidsim.readthedocs.io/en/latest/),\n[release notes](https://fluidsim.readthedocs.io/en/latest/changes.html),\n[official source mirror](https://github.com/fluiddyn/fluidsim),\n[FluidFFT 0.4.5 docs](https://fluidfft.readthedocs.io/en/latest/), and the\nprimary FluidSim ([DOI 10.5334/jors.239](https://doi.org/10.5334/jors.239))\nand FluidFFT ([DOI 10.5334/jors.238](https://doi.org/10.5334/jors.238))\npapers. API claims use official docs/source; method/performance claims in the\nreferences are scoped to the cited primary papers and their benchmark setups.","author":"@K-Dense-AI","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/fluidsim","license":"MIT","category":"coding","lang":"en","tokens":2785,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/advanced_features.md","size":11654,"sha256":"31301c75c39b622f1bbd7f06ed9d80d79b65bdeb90287130042d0123e044a84a"},{"path":"references/installation.md","size":9745,"sha256":"3c5a5d8462cb8dc7584d767057a9be1ff01e3e013213c3f09776d5a8005df7b9"},{"path":"references/output_analysis.md","size":10126,"sha256":"2725ed5f7e6bead7fe1cb3d859ba9a8a7327cca1c5e2f4e06d4cb3fe05fd85ae"},{"path":"references/parameters.md","size":10195,"sha256":"f464352a4832b85d0185ae3403aaab5709843448fa83fc72aa60d650c13431ff"},{"path":"references/simulation_workflow.md","size":10893,"sha256":"028e565f3a17f082bf759961dbe569e67743077a411689e74ceb9777a8046ffa"},{"path":"references/solvers.md","size":7952,"sha256":"36c9699b6d4f14c561223e063c72de2df11ac5d2e8534f17777dbf02568e4e15"},{"path":"scripts/budget_summary.py","size":13373,"sha256":"06c2761406a6d6907002ce6db77958af32e3bf2d7e88dc524ec3410323496d83"},{"path":"scripts/_common.py","size":15595,"sha256":"a256d979afd2eb376fe7a907e717a5f356d02daba6c9772208c0b295d58dff64"},{"path":"scripts/grid_resource_estimator.py","size":9047,"sha256":"8164f8b24616c7aa606570a2cb54e6316178a31a841e3aabe73f9f1125bd7322"},{"path":"scripts/__init__.py","size":74,"sha256":"93b33cb86288cb882ac5876c2cc1db9bae72fc96296abc75c7ecfab97a052989"},{"path":"scripts/output_inventory.py","size":11198,"sha256":"b57238d1a3d02c0a440676642b562f79a8e9338559b228d14d7f40b5d7517194"},{"path":"scripts/restart_compatibility.py","size":15757,"sha256":"19b25f93906a2bd3bfd15f3da61f11da887b9fc979d295baa2ff91654f717aa1"},{"path":"scripts/_schema.py","size":28807,"sha256":"f59c034ff6dee3677b19759c04ee5472d38aa7f03406ea1c31c68d1c32e83d18"},{"path":"scripts/simulation_dry_run.py","size":7813,"sha256":"9345635846c484a74921d44af0aed3f52e5251edaf611f9e02ab803f8be06f7a"},{"path":"scripts/solver_config_validator.py","size":2107,"sha256":"afd7f5d9581fee0229bfb3ad167e57fe6fe407b16fe404ab60bef4aed51cec4b"}],"requires":{"mcp":[],"tools":["Read Write Bash Glob Python"]},"safety":{"flags":[{"code":"injection.bypass","kind":"injection","where":"references/installation.md:241","excerpt":"without approval","message":"instructs the agent to bypass the human","severity":"warn"},{"code":"net.endpoints","kind":"exfiltration","excerpt":"doi.org, fluidfft.readthedocs.io, fluidsim.readthedocs.io","message":"bundled scripts reach 3 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["doi.org","fluidfft.readthedocs.io","fluidsim.readthedocs.io"]}}