跳到主要内容

cantera 精选

Runs Cantera homogeneous chemical reactors and evaluates ignition delay with mechanism provenance, conservation checks, and numerical refinement. Use for combustion kinetics, closed adiabatic ideal-gas constant-volume or constant-pressure ignition, temperature histories, or mechanism-specific ignition-delay comparisons.

在 GitHub 打开

安装方式

cp -r skills/cantera ~/.claude/skills/cantera

把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/

整仓一次性获取:git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills.git

依赖与权限

  • 无需 API Key
  • 需要联网访问外部服务
  • 依赖外部命令:python uv
  • 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。

SKILL.md 正文

来源 K-Dense-AI/scientific-agent-skills@a1043ef · 许可 MIT · 内容未修改

Cantera: homogeneous ignition calculations

When to use

Use for a closed, adiabatic, homogeneous ideal-gas reactor with a known kinetic mechanism,

initial temperature, pressure, and mole composition. The bundled helper runs both constant

volume and constant pressure cases and reports a precisely defined temperature-based delay.

It is not a flame solver or a general reactor-network builder.

A calculation completing successfully establishes numerical execution, not mechanism

validity for the fuel, pressure, temperature, diluent, or measured ignition observable.

Read [references/interpretation.md](references/interpretation.md) when choosing a mechanism,

comparing experiments, or interpreting unresolved/two-stage ignition.

Workflow

  1. Identify the mechanism and its validated condition range. Preserve its source, version,

citation, and any modifications. Check that its phase is ideal-gas and that every

reactant, diluent, and tracked species exists. For custom YAML with imports, retain the

original dependency files as well as the generated phase snapshot. Custom Python rate

extensions additionally need their original code and environment for replay.

  1. Choose constant volume or constant pressure from the physical experiment. Supply K,

Pa, seconds, and mole amounts explicitly. mole_amounts is normalized to mole fractions;

it is not a mass-fraction mapping. The report includes the normalized initial composition.

  1. Copy [assets/hydrogen-ignition.json](assets/hydrogen-ignition.json) and change its conditions.

The supplied H2/O2/Ar case uses Cantera's bundled h2o2.yaml for an executable numerical

example; it is not a recommendation for every hydrogen experiment.

  1. Set a time horizon long enough to observe the temperature rise and the decline of the

heating-rate peak. Choose output spacing fine enough to locate that peak. Set a minimum

temperature rise to distinguish ignition from negligible heating or numerical noise.

  1. Run the helper and inspect all four histories and the report. Refine again if the delay

changes materially, if the maximum approaches a time boundary, or if conservation fails.

Compare the temperature and tracked-species histories with the actual ignition definition.

  1. Report the condition set, mechanism hash, reactor constraint, delay definition, output

spacing, numerical changes, and scientific limits together with the delay.

Execute the tested example

From the collection root:

uv run --no-project --python 3.12 --with cantera==3.2.0 --with numpy==2.5.3 \
  python skills/cantera/scripts/ignition_delay.py \
  skills/cantera/assets/hydrogen-ignition.json hydrogen-result

Tested on Python 3.12, Cantera 3.2.0, and NumPy 2.5.3. No external solver executable or

credentials are needed. Local relative mechanism paths resolve against the configuration

file directory before Cantera's built-in data search. Use a new output directory each run.

The 1000 K, 101325 Pa, H2:O2:Ar = 2:1:7 constant-volume example gives about 0.313 ms

using the stated max(dT/dt) definition. At 3 ms its temperature is approximately

2920.67 K and agrees with a separate UV equilibrium calculation. These are package

regression values, not experimental validation data.

Exact delay and refinement contract

Delay is the time of the global maximum of numpy.gradient(T, time, edge_order=2) on

a uniform output grid. It is reported only if the maximum temperature rise reaches

minimum_temperature_rise_k and the maximum is at least two sample indices from each

boundary. Otherwise delay_s is null and a status explains why. No delay beyond the

simulation horizon is extrapolated.

The helper explicitly uses Cantera 3.2's clone=True and reads evolving properties from

reactor.phase. The original Solution retains the initial state; do not read it as

the reactor's final state. ReactorNet.advance(t) requests an absolute time, and no

advance limits are configured, so the output grid remains uniform.

It runs four independent fresh reactors:

RunChange from configured conditions
baselineOriginal settings
finer_outputHalf output spacing, same horizon and solver controls
tighter_solverBoth solver tolerances divided by ten; maximum internal time step halved
longer_horizonTwice the horizon with the original output spacing

numerically_resolved requires all runs to yield delays, relative delay changes within

delay_relative_tolerance, and all conservation checks to pass. Agreement on a discrete

grid is not a statistical error bar: also report the output spacing. The baseline samples

must be between 11 and 50000, leaving room for refinement. Runtime grows with mechanism

size, stiffness, and the chosen horizon; integration failures retain Cantera's error text.

Outputs and checks

  • report.json: all input settings, package versions, configuration and mechanism hashes,

normalized starting composition, four delay estimates, numerical changes, conservation,

and mechanism thermodynamic temperature bounds.

  • baseline.csv, finer_output.csv, tighter_solver.csv, longer_horizon.csv: time,

temperature, pressure, volume, mass, total internal energy, total enthalpy, and requested

species mole fractions.

  • mechanism.yaml: a Cantera-written snapshot of the loaded phase, species, and reactions.

The helper requests write_yaml(precision=17) and saves the exact UTF-8 bytes it hashes,

without platform newline conversion. The report also hashes the located original

mechanism file. Imported source dependencies are not separately hashed; the snapshot

captures the loaded model. Its generated header includes a date, so the snapshot hash

identifies the saved artifact and need not match between otherwise identical reruns.

Closed reactors conserve mass and elemental mass fractions. The constant-volume case

checks total internal energy; the constant-pressure case checks total enthalpy. Energy

error is divided by max(abs(initial_energy_J), 1 J). Diagnostic tolerances are mass

relative drift <1e-8, elemental absolute drift <1e-8, energy scaled drift <1e-6, species

mass-fraction sum error <1e-8, and species mass fractions >-1e-10. These checks expose

numerical issues and do not measure kinetic-model uncertainty.

Check within_thermo_temperature_range separately: it checks saved output states, not

every internal integration state. Numerical resolution does not mean species thermodynamic

fits stayed within their temperature bounds. The helper cannot assess pressure-dependent

kinetic validity from these bounds.

Scope and upstream references

The suite covers both reactor constraints, conservation, final-state agreement with

independent Cantera equilibrium, nonigniting conditions, unresolved boundary maxima,

refinement, snapshot replay, and invalid composition/conditions. It does not validate

shock-tube heat loss, real-gas effects, surfaces, flow devices, flames, or multistage

experimental ignition definitions. Build those models only with the necessary physics

and their own checks; do not relabel this helper's result as one of them.

uses a species mass-fraction peak; its delay definition differs from this helper's dT/dt peak.

质量与来源

所属仓库
K-Dense-AI/scientific-agent-skills
仓库星标
4.9 万
最近更新
今天
采集时间
今天
commit
a1043ef544e3
内容指纹
sha256:1dcb22bba51475a
文件路径
skills/cantera/SKILL.md

同仓库其它 Skill

查看全部 49 个
13c-metabolic-flux
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps, mfapy isotope simulation, constrained multistart fitting, and flux-profile diagnostics. Use for 13C-MFA, carbon tracing, mass isotopomer distributions (MDVs/MIDs), positional isotopomers, parallel tracer experiments, and determining whether labeling data constrain a pathway flux. Distinguishes measured-label inference from COBRA flux balance analysis and flags experiments requiring nonstationary MFA.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor
adaptyv
Uses the Adaptyv Bio Foundry API and Python SDK to design protein characterization experiments, estimate costs, submit sequences, monitor laboratory progress, and retrieve results. Applies to Adaptyv Foundry, its target catalog, binding screening and affinity assays, thermostability, expression, fluorescence, epitope binning, and enzyme activity workflows, including code using adaptyv or FoundryClient.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor
aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor
alphagenome
AlphaGenome API key, free for non-commercial use from deepmind.google.com/science/alphagenome. ALPHA_GENOME_API_KEY is accepted as an alternative spelling.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor
analytical-method-validation
Plans, executes, and documents validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include "method validation", "analytical method validation", "AMV", "validation protocol", "acceptance criteria", "linearity", "reportable range", "accuracy and precision", "repeatability", "intermediate precision", "recovery", "LOD", "LOQ", "detection limit", "quantitation limit", "specificity", "robustness", "method transfer", "method comparison", "Deming", "Passing-Bablok", "Bland-Altman", "equivalence testing", "OOS investigation", "ICH Q2", "Q2(R2)", "Q14", "USP 1225", "ICH M10", "incurred sample reanalysis", "ISR", "CLSI EP", and any request to show that an assay works.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor
anndata
Handles annotated matrices in single-cell analysis, .h5ad and Zarr files, and integration with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
精选 K-Dense-AI/scientific-agent-skills 4.9 万 原文
Claude CodeCodex CLICursor

相似 Skill

更多「编码」
access
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the iMessage channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Check iMessage channel setup and review access policy. Use when the user asks to configure iMessage, asks "how do I set this up" or "who can reach me," or wants to know why texts aren't reaching the assistant.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage Telegram channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Telegram channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Telegram channel — save the bot token and review access policy. Use when the user pastes a Telegram bot token, asks to configure Telegram, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端