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

pycalphad

Skill này làm gì

Chương trình này tính cách các vật liệu (hợp kim) hoạt động ở các nhiệt độ và áp suất khác nhau. Nó cho biết những thành phần (pha) nào của hợp kim hình thành và với số lượng bao nhiêu.

Khi nào nên dùng

  • ✓Để hiểu tính ổn định pha trong hợp kim kim loại.
  • ✓Để kiểm tra cách các pha thay đổi theo nhiệt độ.
  • ✓Để tính chính xác lượng của từng pha trong một hợp kim.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pycalphad/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/pycalphad/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 các pha và lượng của chúng trong hợp kim đồng-niken ở 1000 Kelvin và áp suất 1 atmosphere, dùng cơ sở dữ liệu Cu-Ni.”

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

Cách hoạt động

Bạn cung cấp cơ sở dữ liệu chứa thông tin về vật liệu và các điều kiện (nhiệt độ, áp suất, thành phần). Chương trình dùng thông tin này để dự đoán những pha nào ổn định và chiếm tỷ lệ bao nhiêu.

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.

pycalphad: TDB equilibrium calculations

When to use

Use for equilibrium phase fractions and compositions at a fixed bulk elemental mole composition, specified pressure, and a list of finite temperatures. The bundled helper executes real pycalphad equilibria, checks mass balance, repeats at greater sampling density, and exports each stable composition set separately.

Equilibrium is constrained by the selected database, components, phases, and conditions. It does not predict precipitation rates, retained metastable microstructures, or properties of phases missing from the database. Successful numerical checks do not establish the database's experimental accuracy.

Workflow

  1. Identify the TDB's source, license, assessment/publication, valid temperature/pressure and composition range, and required elements. Use the user's database for real alloys. The bundled assets/ideal-cu-ni.tdb is an original hypothetical teaching model, not an assessed Cu-Ni database.
  2. Inspect database elements and phases. Select the relevant phases deliberately; record exclusions because they can turn the calculation into a metastable constrained result. Include VA where required by sublattice models. Vacancies are not an independent bulk mole fraction. Keep coupled order/disorder definitions in the TDB, but do not select both partners as separate candidates when the ordered model already includes the disordered contribution; the helper rejects such filtered candidate lists.
  3. Copy assets/equilibrium.json. Specify exactly N-1 elemental mole fractions and one dependent non-vacancy element. The dependent fraction is 1 - sum(independent fractions); fractions are not silently normalized. Set K and Pa. Convert weight percentages or mass fractions before using this helper.
  4. Declare the database temperature interval from its assessment if known, or set database_temperature_range_k to null if unknown. This is user-supplied evidence, not a range automatically inferred from every TDB function. Requests outside a declared interval fail. Check pressure and composition validity separately.
  5. Run the calculation. Check finite Gibbs energies, phase fractions summing to one, reconstructed bulk composition, and stability to doubled pdens (phase-constitution sampling density). Near transitions, refine temperatures and sampling density further.
  6. Deliver phase fractions with their molar basis, phase compositions, database hash, conditions, excluded phases, and any numerical or assessment limitations.

Read references/model-and-validation.md for the analytic example, basis conversion, native Model/Workspace/property/plot contracts, miscibility-gap handling, and convergence limits.

Execute the tested example

From the collection root:

uv run --no-project --python 3.12 --with pycalphad==0.11.2 --with numpy==2.5.3 \
  python skills/pycalphad/scripts/equilibrate.py \
  skills/pycalphad/assets/ideal-cu-ni.tdb \
  skills/pycalphad/assets/equilibrium.json equilibrium-result

Tested on Python 3.12, pycalphad 0.11.2, and NumPy 2.5.3. Use a new output directory. All thermodynamic calculations are local; the script does not upload a TDB.

For the supplied hypothetical model at X(Ni)=0.5 and 101325 Pa:

Temperature Equilibrium result
900 K FCC_A1 only
1100 K 0.5 FCC_A1 + 0.5 LIQUID; X(Ni) approximately 0.527307 and 0.472693 respectively
1300 K LIQUID only

The suite verifies analytic common-tangent compositions, a noncentral lever-rule case, Gibbs energy, mass balance, both single-phase limits, and actual same-phase miscibility gap vertices. These validate the computational workflow, not real Cu-Ni metallurgy.

Outputs and acceptance

  • report.json: settings and versions, TDB/settings SHA-256, excluded database phases, requested, solver-imposed, and reconstructed bulk compositions, per-temperature baseline/refined results, and checks. Experimental validity is not evaluated by the helper.
  • phase-equilibria.csv: one row per stable vertex per temperature and sampling run, including phase name, molar phase fraction, and elemental mole fractions. Its Gibbs energy column is the whole-system molar Gibbs energy, repeated for each vertex; it is not the individual phase energy.

…

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

Cơ sở dữ liệu TDB là gì?

Đó là tệp chứa thông tin nhiệt động học về các nguyên tố và cách chúng tương tác để tạo thành các pha khác nhau ở nhiệt độ và áp suất khác nhau.

“Pha” trong hợp kim là gì?

Pha là các cấu trúc hoặc hợp chất khác nhau có thể hình thành khi trộn vật liệu. Ví dụ, trong hợp kim đồng-niken có thể tồn tại pha rắn hoặc pha lỏng.

Chương trình có dự đoán tốc độ hình thành pha không?

Không. Chương trình chỉ tính trạng thái cân bằng, tức là trạng thái ổn định cuối cùng, không tính quá trình hay tốc độ đạt đến trạng thái đó.

Chi tiết

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

Computes finite-temperature CALPHAD equilibria, phase fractions, and phase compositions from thermodynamic TDB databases using pycalphad. Use for alloy phase stability, equilibrium temperature sweeps, tie lines, lever-rule checks, or reproducible phase-fraction calculations with explicit components and mole-fraction conditions.

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

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3537
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ự