补充氦气Peng-Robinson物性库
This commit is contained in:
1 parent
056b71fead
commit
cdead78977
5 files changed
+289
-2
No files matched your search
@@ -23,6 +23,7 @@
|
||||
- `PythonModels/systems/test_mql_config.py`
|
||||
- 提供 `TestMqlConfig.from_amesim_specs()`。
|
||||
- 负责把 AMESim 全局参数和组件参数解析成后续可用的 Python 配置对象。
|
||||
- `test_mql` 默认工质已按 AMESim 模型确认设为氦气。
|
||||
- 已支持常量、全局参数引用、四则运算、括号和 AMESim 风格的 `^` 指数表达式。
|
||||
- 非数值文本会保留为 `None`,后续按具体子模型显式处理。
|
||||
|
||||
@@ -34,7 +35,16 @@
|
||||
- 保护组件数、连接数、状态数、全局参数和关键子模型计数。
|
||||
|
||||
- `tests/test_test_mql_config.py`
|
||||
- 保护全局参数解析、AMESim 表达式解析、按子模型分组和典型组件参数解析。
|
||||
- 保护全局参数解析、AMESim 表达式解析、按子模型分组、默认氦气工质和典型组件参数解析。
|
||||
|
||||
- `PythonModels/core/peng_robinson.py`
|
||||
- 提供 Peng-Robinson 状态方程小物性库。
|
||||
- 当前覆盖压缩因子、摩尔体积、密度和由密度反算压力。
|
||||
- 已内置 `HELIUM_PR`,供 `test_mql` 默认使用。
|
||||
|
||||
## 物性约定
|
||||
|
||||
AMESim 模型中 `test_mql` 使用氦气,Python 侧当前通过 `HELIUM_PR` 使用 Peng-Robinson 状态方程计算气体压缩因子和密度。当前物性层先覆盖状态方程相关量,完整焓/内能偏差函数后续在接气室能量方程时再补。
|
||||
|
||||
## 当前提取结果
|
||||
|
||||
@@ -63,10 +73,22 @@
|
||||
- `UD00`: 2
|
||||
- `PNGD00`: 1
|
||||
|
||||
|
||||
## 结果对齐原则
|
||||
|
||||
后续 Python 仿真结果必须以 AMESim 为基准做一一对应校验:
|
||||
|
||||
1. 组件别名优先沿用 AMESim 原名,例如 `pn_brp2_8`、`pn_c1_8`、`pn_orifice_18`。
|
||||
2. 子模型族优先沿用 AMESim 子模型名,例如 `PNRP17`、`PNCH012`、`PNOR001`、`PNVO001`。
|
||||
3. 输出变量命名要能追溯到 AMESim 的 `Data_Path`,避免 Python 侧改名后无法对比。
|
||||
4. Python 每完成一批物理方程,都应拿 AMESim 导出的 CSV 结果做误差对比。
|
||||
5. 当前 `.ame` 包内的 `test_mql_.results` 是 AMESim 二进制结果文件,暂不作为直接解析基准;建议后续从 AMESim 导出 CSV 结果放到本目录下。
|
||||
6. 在没有 AMESim CSV 基准前,不能把 Python 输出描述为“已经和 AMESim 几乎一致”,只能说明完成了结构、参数或某类组件方程。
|
||||
|
||||
## 验证方式
|
||||
|
||||
```bash
|
||||
python3 -m py_compile PythonModels/systems/test_mql.py PythonModels/systems/test_mql_config.py PythonModels/scripts/run_test_mql.py
|
||||
python3 -m py_compile PythonModels/core/peng_robinson.py PythonModels/systems/test_mql.py PythonModels/systems/test_mql_config.py PythonModels/scripts/run_test_mql.py
|
||||
python3 -m PythonModels.scripts.run_test_mql
|
||||
python3 -m unittest discover -s tests -t .
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user