File contents COMSOL 材料系统要点
材料创建流程
model.materials().create("mat1") — 创建材料节点
model.materials("mat1").label("Copper") — 设置显示名
设置属性或从内置库加载
model.materials("mat1").selection().all() — 分配到所有域,或用 .set(new int[]{1,2}) 分配到指定域
内置材料库
COMSOL 提供丰富的内置材料,可直接引用:
Copper — 铜
Steel AISI 4340 — 合金钢
Aluminum — 铝
Glass (quartz) — 石英玻璃
Silicon — 硅
Gold — 金
Silver — 银
Titanium beta-21S — 钛合金
Air — 空气
Water — 水
使用内置材料时设置 builtin_name,无需手动定义属性。
常用材料属性名 (COMSOL API propertyGroup("Def"))
属性名
说明
常见单位
density
密度
kg/m³
thermalconductivity
导热系数
W/(m·K)
specificheat
比热
J/(kg·K)
youngsmodulus
杨氏模量
Pa
poissonsratio
泊松比
—
electricconductivity
电导率
S/m
relpermittivity
相对介电常数
—
relpermeability
相对磁导率
—
dynamicviscosity
动力粘度
Pa·s
材料分配规则
单材料模型 :用 selection().all() 分配到所有域。
多材料模型 :为每个材料指定 domain_ids,如 selection().set(new int[]{1}) 将材料分配到域 1。
域 ID 从 1 开始,由几何构建顺序决定。
材料必须在物理场之前设置(部分物理场属性依赖材料参数)。
建模流程中的位置
正确顺序:几何 → 材料 → 物理场 → 网格 → 研究 → 求解
材料设置在几何之后、物理场之前,因为:
需要几何域存在才能分配材料
物理场边界条件可能依赖材料属性(如传热依赖导热系数)
常见场景
传热分析 :需设置 density、thermalconductivity、specificheat
结构分析 :需设置 density、youngsmodulus、poissonsratio
流体分析 :需设置 density、dynamicviscosity
电磁分析 :需设置 electricconductivity、relpermittivity、relpermeability
1 --- 2 name: comsol-materials 3 description: COMSOL 材料系统使用要点与经验 4 --- 5 6 ## COMSOL 材料系统要点 7 8 ### 材料创建流程 9 10 1. `model.materials().create("mat1")` — 创建材料节点 11 2. `model.materials("mat1").label("Copper")` — 设置显示名 12 3. 设置属性或从内置库加载 13 4. `model.materials("mat1").selection().all()` — 分配到所有域,或用 `.set(new int[]{1,2})` 分配到指定域 14 15 ### 内置材料库 16 17 COMSOL 提供丰富的内置材料,可直接引用: 18 - **Copper** — 铜 19 - **Steel AISI 4340** — 合金钢 20 - **Aluminum** — 铝 21 - **Glass (quartz)** — 石英玻璃 22 - **Silicon** — 硅 23 - **Gold** — 金 24 - **Silver** — 银 25 - **Titanium beta-21S** — 钛合金 26 - **Air** — 空气 27 - **Water** — 水 28 29 使用内置材料时设置 `builtin_name`,无需手动定义属性。 30 31 ### 常用材料属性名 (COMSOL API propertyGroup("Def")) 32 33 | 属性名 | 说明 | 常见单位 | 34 |--------|------|---------| 35 | density | 密度 | kg/m³ | 36 | thermalconductivity | 导热系数 | W/(m·K) | 37 | specificheat | 比热 | J/(kg·K) | 38 | youngsmodulus | 杨氏模量 | Pa | 39 | poissonsratio | 泊松比 | — | 40 | electricconductivity | 电导率 | S/m | 41 | relpermittivity | 相对介电常数 | — | 42 | relpermeability | 相对磁导率 | — | 43 | dynamicviscosity | 动力粘度 | Pa·s | 44 45 ### 材料分配规则 46 47 - **单材料模型**:用 `selection().all()` 分配到所有域。 48 - **多材料模型**:为每个材料指定 `domain_ids`,如 `selection().set(new int[]{1})` 将材料分配到域 1。 49 - 域 ID 从 1 开始,由几何构建顺序决定。 50 - 材料必须在物理场之前设置(部分物理场属性依赖材料参数)。 51 52 ### 建模流程中的位置 53 54 正确顺序:**几何 → 材料 → 物理场 → 网格 → 研究 → 求解** 55 56 材料设置在几何之后、物理场之前,因为: 57 - 需要几何域存在才能分配材料 58 - 物理场边界条件可能依赖材料属性(如传热依赖导热系数) 59 60 ### 常见场景 61 62 - **传热分析**:需设置 density、thermalconductivity、specificheat 63 - **结构分析**:需设置 density、youngsmodulus、poissonsratio 64 - **流体分析**:需设置 density、dynamicviscosity 65 - **电磁分析**:需设置 electricconductivity、relpermittivity、relpermeability
iammm0/mph-agent/tree/main/agent/skills/library/comsol-materials commit ad1f7b0bff
Frequently asked questions How do I install the Comsol Materials skill? Run npx skillmds@latest add iammm0/comsol-materials in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Comsol Materials skill do? COMSOL 材料系统使用要点与经验 It is listed under AI & ML on SkillMD.
Is Comsol Materials safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Comsol Materials? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Comsol Materials free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Comsol Materials? iammm0 (@iammm0) published this skill. Their other Agent Skills are listed on their SkillMD profile.