Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính51k · #3435

cantera

Skill này làm gì

Công cụ này tính thời gian để một hỗn hợp khí bắt cháy (bắt đầu cháy) trong những điều kiện cụ thể. Nó dùng các mô hình phản ứng hóa học để dự đoán thời gian này.

Khi nào nên dùng

  • ✓Khi bạn muốn hiểu các hỗn hợp khí khác nhau phản ứng với nhiệt và áp suất như thế nào.
  • ✓Khi bạn muốn so sánh tốc độ bắt cháy của các loại nhiên liệu khác nhau.
  • ✓Khi bạn kiểm tra xem một mô hình phản ứng hóa học có chính xác khi mô phỏng quá trình bắt cháy hay không.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/cantera/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/cantera/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tính thời gian trễ bắt cháy của hỗn hợp hydro, oxy và argon ở 1000 Kelvin và 1 atmosphere.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cung cấp các loại khí, lượng của từng khí, nhiệt độ và áp suất. Công cụ dùng một mô hình phản ứng hóa học để mô phỏng quá trình và tính thời gian chính xác đến lúc bắt cháy.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 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.
  2. 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.
  3. Copy 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.
  4. 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.
  5. 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.
  6. 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:

Run Change from configured conditions
baseline Original settings
finer_output Half output spacing, same horizon and solver controls
tighter_solver Both solver tolerances divided by ten; maximum internal time step halved
longer_horizon Twice the horizon with the original output spacing

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

…

Câu hỏi thường gặp

“Cơ chế” (mechanism) là gì?

Đó là tập hợp các quy tắc và phản ứng hóa học mô tả cách một hỗn hợp khí hoạt động.

“Bắt cháy” ở đây nghĩa là gì?

Đó là thời điểm hỗn hợp khí bắt đầu phản ứng nhanh chóng, giải phóng năng lượng và làm nhiệt độ tăng lên.

Công cụ này có dự đoán được vụ nổ không?

Không. Công cụ tập trung vào thời gian bắt cháy ban đầu, không tính đến sự lan truyền của vụ nổ hay ngọn lửa.

Chi tiết

Mô tả gốc của tác giả

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.

repo: K-Dense-AI/scientific-agent-skills

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3435
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự