idaes-process-modeler 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. idaes_process_modeler-0.1.0/LICENSE +21 -0
  2. idaes_process_modeler-0.1.0/PKG-INFO +444 -0
  3. idaes_process_modeler-0.1.0/README.md +401 -0
  4. idaes_process_modeler-0.1.0/pyproject.toml +63 -0
  5. idaes_process_modeler-0.1.0/setup.cfg +4 -0
  6. idaes_process_modeler-0.1.0/src/idaes_process_modeler/__init__.py +8 -0
  7. idaes_process_modeler-0.1.0/src/idaes_process_modeler/calibration.py +113 -0
  8. idaes_process_modeler-0.1.0/src/idaes_process_modeler/cli.py +51 -0
  9. idaes_process_modeler-0.1.0/src/idaes_process_modeler/engine.py +56 -0
  10. idaes_process_modeler-0.1.0/src/idaes_process_modeler/idaes_adapter.py +284 -0
  11. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/__init__.py +15 -0
  12. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/adsorption.py +206 -0
  13. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/fixed_bed.py +291 -0
  14. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/gate_open_psa.py +194 -0
  15. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/membrane.py +314 -0
  16. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/membrane_reactor.py +153 -0
  17. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/psa.py +290 -0
  18. idaes_process_modeler-0.1.0/src/idaes_process_modeler/models/seawater_ro.py +210 -0
  19. idaes_process_modeler-0.1.0/src/idaes_process_modeler/optimization.py +80 -0
  20. idaes_process_modeler-0.1.0/src/idaes_process_modeler/reporting.py +113 -0
  21. idaes_process_modeler-0.1.0/src/idaes_process_modeler/spec.py +109 -0
  22. idaes_process_modeler-0.1.0/src/idaes_process_modeler/units.py +190 -0
  23. idaes_process_modeler-0.1.0/src/idaes_process_modeler/validation.py +323 -0
  24. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/PKG-INFO +444 -0
  25. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/SOURCES.txt +38 -0
  26. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/dependency_links.txt +1 -0
  27. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/entry_points.txt +2 -0
  28. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/requires.txt +19 -0
  29. idaes_process_modeler-0.1.0/src/idaes_process_modeler.egg-info/top_level.txt +1 -0
  30. idaes_process_modeler-0.1.0/tests/test_adsorption.py +14 -0
  31. idaes_process_modeler-0.1.0/tests/test_calibration.py +33 -0
  32. idaes_process_modeler-0.1.0/tests/test_fixed_bed.py +23 -0
  33. idaes_process_modeler-0.1.0/tests/test_gate_open_psa.py +43 -0
  34. idaes_process_modeler-0.1.0/tests/test_idaes_adapter.py +34 -0
  35. idaes_process_modeler-0.1.0/tests/test_membrane.py +15 -0
  36. idaes_process_modeler-0.1.0/tests/test_optimization.py +18 -0
  37. idaes_process_modeler-0.1.0/tests/test_psa.py +15 -0
  38. idaes_process_modeler-0.1.0/tests/test_seawater_ro.py +48 -0
  39. idaes_process_modeler-0.1.0/tests/test_units.py +15 -0
  40. idaes_process_modeler-0.1.0/tests/test_validation.py +28 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IDAES Process Modeler contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,444 @@
1
+ Metadata-Version: 2.4
2
+ Name: idaes-process-modeler
3
+ Version: 0.1.0
4
+ Summary: Auditable IDAES/Pyomo-oriented chemical process modeling workflows.
5
+ Author-email: Xiaoyu Zhang <owenxyzhang@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/owenxyzhang-seseTJ/idaes-process-modeler
8
+ Project-URL: Repository, https://github.com/owenxyzhang-seseTJ/idaes-process-modeler
9
+ Project-URL: Issues, https://github.com/owenxyzhang-seseTJ/idaes-process-modeler/issues
10
+ Project-URL: Changelog, https://github.com/owenxyzhang-seseTJ/idaes-process-modeler/releases
11
+ Keywords: IDAES,Pyomo,process-modeling,adsorption,PSA,VSA,TSA,membrane-separation,parameter-estimation,chemical-engineering
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
22
+ Classifier: Topic :: Scientific/Engineering :: Physics
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: numpy>=1.22
27
+ Requires-Dist: scipy>=1.8
28
+ Requires-Dist: pandas>=1.4
29
+ Requires-Dist: matplotlib>=3.5
30
+ Requires-Dist: pillow>=9.0
31
+ Requires-Dist: pypdf>=3.0
32
+ Requires-Dist: PyYAML>=6.0
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest>=7.0; extra == "test"
35
+ Provides-Extra: idaes
36
+ Requires-Dist: pyomo>=6.7; extra == "idaes"
37
+ Requires-Dist: idaes-pse>=2.8; extra == "idaes"
38
+ Provides-Extra: all
39
+ Requires-Dist: pytest>=7.0; extra == "all"
40
+ Requires-Dist: pyomo>=6.7; extra == "all"
41
+ Requires-Dist: idaes-pse>=2.8; extra == "all"
42
+ Dynamic: license-file
43
+
44
+ # IDAES Process Modeler
45
+
46
+ IDAES Process Modeler is a Codex plugin and Python package for auditable
47
+ chemical-process modeling with IDAES, Pyomo/Pyomo.DAE, and explicit
48
+ reduced-order models. It supports fixed-bed adsorption, PSA/VSA/TSA cycle
49
+ maps, membrane separation, membrane reactors, parameter estimation, sweeps,
50
+ validation reports, and guarded IDAES reference cases.
51
+
52
+ IDAES Process Modeler 是一个面向 Codex 的插件和 Python 工具包,用于建立可审计的
53
+ 化工过程模型。它同时提供 IDAES、Pyomo/Pyomo.DAE 接口和明确标注的 reduced-order
54
+ 模型,覆盖固定床吸附、PSA/VSA/TSA 循环、膜分离、膜反应器、参数估计、参数扫描和
55
+ 数值验证报告。
56
+
57
+ The package keeps a strict evidence boundary. A successful numerical solve is a
58
+ solver result; CSS convergence is a numerical criterion; a reduced-order case
59
+ is a scenario study. None of these is experimental or industrial validation
60
+ without matching measurements or a benchmark.
61
+
62
+ 本项目严格区分证据等级。求解器成功只说明数值问题完成;CSS 收敛只说明循环状态满足
63
+ 数值判据;reduced-order 结果只是情景模拟。没有匹配实验或基准时,不把这些结果称为
64
+ 实验验证或工业验证。
65
+
66
+ ## Installation and first check / 安装与首次检查
67
+
68
+ Install the package from PyPI:
69
+
70
+ 从 PyPI 安装:
71
+
72
+ ```bash
73
+ python -m pip install idaes-process-modeler
74
+ idaes-model --help
75
+ ```
76
+
77
+ The default install covers the reduced-order models and reporting helpers. Add
78
+ the `[idaes]` extra to pull in Pyomo and IDAES itself:
79
+
80
+ 默认安装包含 reduced-order 模型和报告工具;需要 Pyomo、IDAES 本体时加装 `[idaes]` extra:
81
+
82
+ ```bash
83
+ python -m pip install "idaes-process-modeler[idaes]"
84
+ ```
85
+
86
+ To work from the repository instead, clone it and install in editable mode:
87
+
88
+ 要在仓库中开发,克隆后以 editable 方式安装:
89
+
90
+ ```bash
91
+ git clone https://github.com/owenxyzhang-seseTJ/idaes-process-modeler.git
92
+ cd idaes-process-modeler
93
+ python -m pip install -e '.[test]'
94
+ ```
95
+
96
+ The numerical cases need IDAES extensions and a solver. Create the recommended
97
+ Conda environment before constructing a process model:
98
+
99
+ 数值算例需要 IDAES 扩展和求解器。建模前先建立推荐的 Conda 环境:
100
+
101
+ ```bash
102
+ conda env create -f environment.yml
103
+ conda activate idaes-process
104
+ idaes get-extensions
105
+ python scripts/check_environment.py --strict
106
+ python -m pip install -e '.[test]'
107
+ ```
108
+
109
+ The strict check must find IDAES, Pyomo, Pyomo.DAE, and a usable solver. On
110
+ Apple Silicon, the IDAES-managed IPOPT executable is preferred when the Conda
111
+ solver has compatibility problems. The extension path is discovered at runtime;
112
+ no local machine path is stored in result manifests.
113
+
114
+ 严格检查必须找到 IDAES、Pyomo、Pyomo.DAE 和可用求解器。在 Apple Silicon 上,如果
115
+ Conda 中的 IPOPT 存在兼容性问题,优先使用 IDAES 管理的求解器。运行时动态查找扩展
116
+ 路径,结果 manifest 不保存本机绝对路径。
117
+
118
+ ## Quick start / 快速开始
119
+
120
+ Run the original deterministic demonstrations:
121
+
122
+ 运行原有的确定性 demo:
123
+
124
+ ```bash
125
+ python demos/demo_fixed_bed.py --output-dir demo_results/fixed_bed
126
+ python demos/demo_psa.py --output-dir demo_results/psa
127
+ python demos/demo_membrane.py --output-dir demo_results/membrane
128
+ python demos/demo_membrane_reactor.py --output-dir demo_results/membrane_reactor
129
+ python scripts/plot_demo_results.py
130
+ python -m pytest -q
131
+ ```
132
+
133
+ Run the flexible gate-open MOF PSA demonstration:
134
+
135
+ 运行柔性 gate-open MOF PSA demo:
136
+
137
+ ```bash
138
+ python scripts/run_gate_open_demo.py
139
+ ```
140
+
141
+ The command creates baseline, solver-refined, long-contact, fixed-geometry,
142
+ and fixed-gate-temperature cases under
143
+ `demo_results/gate_open_thermal_psa/`. It writes YAML inputs, machine-readable
144
+ CSV/JSON result bundles, PNG/SVG/PDF figures, and a bilingual technical report.
145
+
146
+ 该命令在 `demo_results/gate_open_thermal_psa/` 下生成 baseline、求解器加密、长接触时间、
147
+ 固定几何和固定门控温度五个工况,并保存 YAML 输入、CSV/JSON 结果、PNG/SVG/PDF 图和
148
+ 中英文技术报告。
149
+
150
+ ## Repository map / 目录结构
151
+
152
+ | Path | English | 中文 |
153
+ |---|---|---|
154
+ | `.codex-plugin/` | Codex plugin metadata | Codex 插件元数据 |
155
+ | `skills/idaes-process-modeler/` | Skill instructions and references | Skill 说明与建模参考 |
156
+ | `src/idaes_process_modeler/` | Reusable Python package | 可复用 Python 包 |
157
+ | `assets/templates/` | YAML/JSON model specifications | YAML/JSON 模型输入模板 |
158
+ | `demos/` | Small runnable demo entry points | 可直接运行的 demo 入口 |
159
+ | `scripts/` | Validation, plotting, report and sweep tools | 校验、绘图、报告和扫描脚本 |
160
+ | `tests/` | Regression and physics-contract tests | 回归测试和物理契约测试 |
161
+ | `demo_results/` | Reproducible result snapshots and rendered reports | 可追溯结果快照与渲染报告 |
162
+ | `runs/` | Local runtime output and sweeps | 本地运行输出和参数扫描目录 |
163
+
164
+ Each standard result bundle contains `summary.json`, `streams.csv`,
165
+ `profiles.csv`, `metrics.csv`, `convergence.json`, `model_spec.yaml`, and a
166
+ `figures/` directory. Paths in reports are relative so a checkout can be moved
167
+ to another machine.
168
+
169
+ 标准结果包包含 `summary.json`、`streams.csv`、`profiles.csv`、`metrics.csv`、
170
+ `convergence.json`、`model_spec.yaml` 和 `figures/`。报告使用相对路径,因此整个仓库
171
+ 移动到另一台机器后仍可读取。
172
+
173
+ ## Model routing / 模型路由
174
+
175
+ Use `$idaes-process-modeler` when a request involves IDAES/Pyomo process
176
+ models, dynamic simulation, adsorption cycles, membranes, reactors, fitting,
177
+ optimization, or process validation. The Skill requires a structured
178
+ specification before model construction and labels parameters by provenance:
179
+ user input, experiment, literature, fit, or assumption.
180
+
181
+ 当任务涉及 IDAES/Pyomo 过程模型、动态模拟、吸附循环、膜、反应器、拟合、优化或
182
+ 过程验证时,使用 `$idaes-process-modeler`。Skill 要求先形成结构化输入,并明确每个
183
+ 参数来自用户、实验、文献、拟合还是假设。
184
+
185
+ The standard routes are:
186
+
187
+ 标准模型路线如下:
188
+
189
+ - `fixed_bed_adsorption`: 1-D convection/dispersion with adsorption storage,
190
+ LDF kinetics, selectable isotherms, and Ergun diagnostic pressure drop.
191
+ - `psa`, `vsa`, `tsa`: data-driven single-bed cycle maps with CSS diagnostics.
192
+ - `membrane_separation`: ideal-gas co-current membrane material balance.
193
+ - `membrane_reactor`: reduced-order reaction plus selective H2 removal.
194
+ - `gate_open_psa`: binary, nonisothermal flexible-solid tank PSA described below.
195
+ - `bubbling_fluidized_bed`: guarded extension point; local bubble dynamics are
196
+ outside this reduced-order package.
197
+
198
+ - `fixed_bed_adsorption`:一维对流/弥散、吸附储存、LDF 动力学、可选等温线和 Ergun 压降诊断。
199
+ - `psa`、`vsa`、`tsa`:数据驱动的单床循环 map 与 CSS 诊断。
200
+ - `membrane_separation`:理想气体并流膜分离物料衡算。
201
+ - `membrane_reactor`:反应与选择性移除 H₂ 的 reduced-order 模型。
202
+ - `gate_open_psa`:下文介绍的二元、非等温柔性固体罐式 PSA。
203
+ - `bubbling_fluidized_bed`:受保护的扩展点;局部气泡动力学不在当前 reduced-order 包范围内。
204
+
205
+ ## Flexible gate-open MOF PSA / 柔性 gate-open MOF PSA
206
+
207
+ ### User-defined basis / 用户给定基础
208
+
209
+ `assets/templates/gate_open_psa.yaml` is the canonical input template. It uses
210
+ the following interpretation of the request:
211
+
212
+ `assets/templates/gate_open_psa.yaml` 是正式输入模板,当前采用以下参数解释:
213
+
214
+ | Quantity | Value | 说明 |
215
+ |---|---:|---|
216
+ | Solid volume / MOF 实体体积 | 1.0 L | Initial crystal/solid envelope volume |
217
+ | MOF density / MOF 密度 | 1.5 g cm⁻³ | Solid mass = 1.5 kg |
218
+ | Feed / 吸附进料 | 15% CO₂ + 85% N₂ | Total pressure = 1 bar |
219
+ | Gate onset / 开门起点 | CO₂ partial pressure 10 kPa | Gate is expressed in CO₂ partial pressure |
220
+ | Gate width / 陡升区间 | 1 kPa | 10 to 11 kPa partial pressure |
221
+ | High-pressure uptake / 高压吸附量 | 40 cm³(STP) g⁻¹ CO₂ | At 15 kPa CO₂ partial pressure |
222
+ | Low-pressure uptake / 低压吸附量 | 1 cm³(STP) g⁻¹ CO₂ | At 5 kPa CO₂ partial pressure |
223
+ | N₂ uptake / N₂ 吸附量 | 1 cm³(STP) g⁻¹ | Low-capacity assumption |
224
+ | Expansion / 开门膨胀 | 5% volume | Solid volume reaches 1.05 L |
225
+ | Adsorption / 吸附压力 | 1 bar total | CO₂ feed partial pressure = 15 kPa |
226
+ | Evacuation / 抽气解吸 | 5 kPa total target | Feed is closed during evacuation |
227
+
228
+ The cycle is therefore **1 bar adsorption -> closed-feed evacuation to 5 kPa ->
229
+ 1 bar adsorption**. The 5 kPa value is the total evacuation target. The model
230
+ does not force the gas composition to remain 15% CO₂ during evacuation; it
231
+ integrates component inventories and calculates the evolving partial pressures.
232
+
233
+ 因此循环是 **1 bar 吸附 -> 关闭进料并抽气至 5 kPa -> 重新吸附**。5 kPa 是抽气总压
234
+ 目标。模型不会在抽气阶段强行保持 15% CO₂,而是积分各组分气相库存并计算动态分压。
235
+
236
+ ### Equations / 计算方程
237
+
238
+ The demo is a SciPy BDF reduced-order model with gas inventories, adsorbed
239
+ loadings, a structural state `f`, and temperature `T`:
240
+
241
+ 该 demo 使用 SciPy BDF,对气相库存、吸附量、结构状态 `f` 和温度 `T` 进行积分:
242
+
243
+ $$
244
+ f^* = \operatorname{clip}\left(\frac{p_{CO_2}-10\,\mathrm{kPa}}{1\,\mathrm{kPa}},0,1\right),\qquad
245
+ \frac{df}{dt}=k_f(f^*-f).
246
+ $$
247
+
248
+ $$
249
+ V_s=V_{s,0}(1+0.05f),\qquad
250
+ L=L_0(1+0.05f)^{1/3},\qquad
251
+ V_g=V_{vessel}-V_s.
252
+ $$
253
+
254
+ $$
255
+ \frac{dq_i}{dt}=k_i(T,f)(q_i^*-q_i),\qquad
256
+ k_i(T,f)=k_{i,0}\exp\left[-\frac{E_{a,i}}{R}\left(\frac{1}{T}-\frac{1}{T_0}\right)\right](1+0.05f)^{-2/3}.
257
+ $$
258
+
259
+ $$
260
+ p_i=\frac{n_iRT}{V_g},\qquad
261
+ \frac{dn_i}{dt}=F_{in}y_{i,in}-F_{out}y_i-m\frac{dq_i}{dt}.
262
+ $$
263
+
264
+ The 40 kJ mol⁻¹ value is treated as an effective CO₂ adsorption/structural
265
+ heat magnitude. It is not added twice as both adsorption heat and a separate
266
+ phase-transition heat. The energy closure uses solid heat capacity, wall heat
267
+ capacity, gas heat capacity, inlet/outlet sensible heat, and `UA` heat exchange.
268
+
269
+ 40 kJ mol⁻¹ 暂按 CO₂ 吸附与结构变化合并后的有效热量幅值处理,不再把它重复加成
270
+ 吸附热和独立相变热。能量方程包含固体热容、器壁热容、气体热容、进出口显热和 `UA`
271
+ 换热项。
272
+
273
+ ### Crystal-volume and mass-transfer coupling / 晶体体积与传质耦合
274
+
275
+ Expansion changes the solid volume at constant mass. Under an isotropic
276
+ expansion assumption, the characteristic crystal length changes with the cube
277
+ root of volume, and the diffusion-length contribution to the LDF coefficient
278
+ scales as `L⁻²`. The current 5% expansion therefore changes the characteristic
279
+ length by 1.64% and reduces this geometric contribution to `k` by about 3.2%
280
+ when diffusivity is held constant.
281
+
282
+ 膨胀时质量保持不变,实体体积增加。在各向同性膨胀假设下,晶体特征长度按体积立方
283
+ 根变化,LDF 传质系数中的扩散长度项按 `L⁻²` 变化。因此 5% 膨胀使特征长度增加
284
+ 1.64%;若扩散系数不变,仅几何长度效应使 `k` 降低约 3.2%。
285
+
286
+ The model also includes an assumed temperature correction to the gate pressure.
287
+ Because gate hysteresis and a measured temperature-dependent phase boundary
288
+ were not supplied, the report includes a `fixed_gate_temperature` sensitivity
289
+ case. That comparison is an assumption sensitivity, not a material-property
290
+ measurement.
291
+
292
+ 模型还加入了门控压力随温度变化的假设修正。由于没有提供门控滞后和实测温度依赖相边界,
293
+ 报告同时给出 `fixed_gate_temperature` 敏感性工况。这个对照用于识别假设影响,不是材料
294
+ 性质测量。
295
+
296
+ The older `demo_results/gate_open_psa/` directory is retained as a clearly
297
+ labelled historical purge-only trial for auditability. The final user-approved
298
+ configuration is `demo_results/gate_open_thermal_psa/`: closed-feed
299
+ evacuation to 5 kPa with nonisothermal crystal-volume and mass-transfer
300
+ coupling.
301
+
302
+ 旧的 `demo_results/gate_open_psa/` 目录仅作为带混合气吹扫的历史试算快照保留,便于审计;
303
+ 最终采用的用户确认工况是 `demo_results/gate_open_thermal_psa/`:关闭进料、抽气至 5 kPa,
304
+ 并耦合非等温晶体体积变化与传质影响。
305
+
306
+ ## Reports and rendered artifacts / 报告与渲染文件
307
+
308
+ ### Seawater reverse osmosis / 海水反渗透脱盐
309
+
310
+ The aqueous `seawater_ro` demo uses **actual manufacturer nominal test data**
311
+ from the [DuPont SW30HRLE-400 January 2026 data sheet](https://www.dupont.com/content/dam/dupont/amer/us/en/water-solutions/public/documents/en/RO-FilmTec-SW30HRLE-400-PDS-45-D00967-en.pdf):
312
+ 37 m², 32,000 ppm NaCl, 55 bar, 25°C, 8% recovery, 28.4 m³/day permeate,
313
+ and 99.8% stabilized salt rejection. The source is a product specification,
314
+ not a raw experimental dataset. Its URL, revision, page, transcription and
315
+ SHA-256 are recorded with the demo.
316
+
317
+ 水相 `seawater_ro` demo 采用杜邦官方标称测试数据,先标定水与盐的透过系数,再预测
318
+ 六支膜串联的性能。包含溶解扩散、渗透压、浓差极化、轴向浓缩和指定压降。SciPy
319
+ 参考积分与 IDAES FlowsheetBlock 上的自定义 Pyomo/IPOPT 方程求解相互对照。
320
+ 它不调用 WaterTAP 原生单元;拟合标称点也不等于独立实验验证。
321
+
322
+ ```bash
323
+ conda run -n idaes-process python scripts/run_seawater_ro_demo.py
324
+ python scripts/render_reports.py --only seawater_ro_report
325
+ # General CLI: reference integration / 通用命令行参考积分
326
+ idaes-model run assets/templates/seawater_ro.yaml --output-dir runs/seawater_ro
327
+ ```
328
+
329
+ Baseline scenario: 6 × 37 m², 60 bar, 32 g/L NaCl, 25°C, and 14.7917 m³/h
330
+ feed. Predicted product is approximately **146.6 m³/day**, recovery **41.3%**,
331
+ and mixed product NaCl **92.2 mg/L**. RO pressure-work electricity is about
332
+ **4.75 kWh/m³** without energy recovery or **2.14 kWh/m³** with an assumed
333
+ 95%-efficient pressure exchanger and 85%-efficient pump. These estimates
334
+ exclude intake, pretreatment, post-treatment and auxiliary power.
335
+
336
+ 基准预测:产水约 **146.6 m³/天**,回收率 **41.3%**,产水 NaCl 约 **92.2 mg/L**。
337
+ 高压泵能耗估算为无回收 **4.75 kWh/m³**,假设配置压力交换器时 **2.14 kWh/m³**。
338
+ 报告给出压力扫描、传质/渗透压/压降假设敏感性、水盐衡算及 30/60/120 格收敛。
339
+ 浓度按恒密度将 ppm 近似换算为 kg/m³,传质和渗透系数为明确的情景假设。
340
+
341
+ This is NaCl-equivalent seawater, not a multi-ion seawater chemistry model.
342
+ It cannot predict Li/Mg or Na/Mg selectivity, boron removal, scaling, fouling,
343
+ or drinking-water compliance. Those extensions need ion-resolved data and
344
+ thermodynamic/transport models.
345
+
346
+ 本例为等效 NaCl 脱盐,不代表真实海水的全部离子化学;不能据此判断 Li/Mg 选择性、
347
+ 硼去除、结垢、污染或饮水合格。水相离子选择性分离需另建对应传输与热力学模型。
348
+
349
+ - [Input template / 输入模板](assets/templates/seawater_ro.yaml)
350
+ - [Source transcription / 厂商数据转录](demo_results/seawater_ro/manufacturer_data.csv)
351
+ - [Bilingual report / 中英文报告](demo_results/seawater_ro/report.md)
352
+ - [Rendered PDF / 公式排版 PDF](output/pdf/reports/seawater_ro_report.pdf)
353
+ - [Results figure / 结果图](demo_results/seawater_ro/figures/ro_performance.png)
354
+ - [Convergence / 数值验证](demo_results/seawater_ro/convergence.json)
355
+
356
+ ### Report index / 报告索引
357
+
358
+ The main reports are available in both Markdown and rendered PDF form:
359
+
360
+ 主要报告同时提供 Markdown 和渲染后的 PDF:
361
+
362
+ - [Original demos: Markdown](demo_results/technical_report/demo_technical_report.md)
363
+ - [Original demos: rendered PDF](output/pdf/reports/demo_technical_report.pdf)
364
+ - [Flexible MOF PSA: Markdown](demo_results/gate_open_thermal_psa/report.md)
365
+ - [Flexible MOF PSA: rendered PDF](output/pdf/reports/gate_open_thermal_psa_report.pdf)
366
+ - [Flexible MOF PSA: rendered page previews](output/preview/reports/)
367
+ - [Figure and result contact sheet](output/preview/report_contact_sheet.png)
368
+ - [Render manifest (repository-relative paths)](output/preview/report_render_manifest.json)
369
+
370
+ 原有 demo 报告和柔性 MOF PSA 报告均已渲染为 PDF;公式、表格和报告内图像会在 PDF 中
371
+ 按页面排版,不依赖 GitHub 对 Markdown 数学语法的支持。运行
372
+ `python scripts/render_reports.py` 可重新生成 PDF 与 PNG 页面预览。
373
+
374
+ The same render directory also contains the companion PDFs for the English figure plans,
375
+ method-search packets, and QA reports. The current render manifest covers eight Markdown
376
+ sources and 18 PDF pages in total. The temporary XeLaTeX build directory is deleted after
377
+ each run, and the manifest records only checkout-relative paths.
378
+
379
+ 同一渲染目录还包含 English figure plan、method-search packet 和 QA report 的配套 PDF。
380
+ 当前 manifest 覆盖 8 个 Markdown 源文件、共 18 页 PDF。每次运行结束后会删除 XeLaTeX
381
+ 临时构建目录,manifest 只记录相对于仓库的路径,不写入本机绝对路径。
382
+
383
+ The gate-open figure exports are:
384
+
385
+ 柔性 MOF PSA 图文件包括:
386
+
387
+ - `thermal_psa.{png,svg,pdf}`: equilibrium input, pressure, loading,
388
+ temperature, volume, and effective LDF coefficient;
389
+ - `uptake_rate.{png,svg,pdf}`: CO₂ uptake/release rate;
390
+ - `flowsheet.{png,svg,pdf}`: Aspen-like conceptual process diagram.
391
+
392
+ ## Validation and limitations / 验证与限制
393
+
394
+ The package performs preflight validation, state-bound checks, component
395
+ material-balance checks, energy-closure checks for the thermal demo, CSS checks,
396
+ and solver refinement checks. The current flexible-MOF run reached CSS in all
397
+ stored cases. The baseline/refined product and working-capacity changes were
398
+ about `4.5e-9` under the tighter BDF settings.
399
+
400
+ 项目执行输入预检查、状态边界检查、组分物料衡算、热量闭合、CSS 和求解器加密检查。
401
+ 当前柔性 MOF 各工况均达到 CSS;baseline 与 refined 在更严格 BDF 设置下的产品量和工作
402
+ 容量相对变化约为 `4.5e-9`。
403
+
404
+ The current route is intentionally a reduced-order mixed-tank scenario. It
405
+ does not yet resolve axial concentration/temperature fronts, a competitive
406
+ mixture isotherm, a measured gate hysteresis loop, vacuum-pump power, particle
407
+ size distributions, crystal cracking, or an IDAES flexible-unit model. Replace
408
+ the assumed thermal and kinetic parameters with DSC/calorimetry, variable-
409
+ temperature adsorption, in-situ structural, and mass-transfer data before
410
+ using the model for design decisions.
411
+
412
+ 当前路线是明确标注的 reduced-order 全混罐情景模型。它还没有解析轴向浓度/温度前沿、
413
+ 竞争吸附等温线、实测门控滞后、真空泵功耗、粒径分布、晶体开裂或 IDAES 柔性单元。
414
+ 用于工艺设计前,应以 DSC/吸附量热、变温吸附、原位结构和传质实验数据替换假设参数。
415
+
416
+ ## Development and contribution / 开发与贡献
417
+
418
+ Run the full regression suite in the IDAES environment:
419
+
420
+ 在 IDAES 环境中运行完整回归测试:
421
+
422
+ ```bash
423
+ conda run -n idaes-process python -m pytest -q
424
+ python scripts/render_reports.py
425
+ ```
426
+
427
+ When the optional `scientific-figure-team` skill is installed, run its Chinese
428
+ visual-comment validator on `scripts/run_gate_open_demo.py` before changing the
429
+ figure code.
430
+
431
+ Keep user data, fitted parameters, scenario assumptions, numerical evidence,
432
+ and physical validation in separate sections. New figures should preserve raw
433
+ machine-readable data, an English figure plan, a method-search packet, editable
434
+ SVG/PDF text, and a visual QA record.
435
+
436
+ 新增模型或图时,请把用户数据、拟合参数、情景假设、数值证据和物理验证分开记录。新增
437
+ 图应保留机器可读原始数据、英文 figure plan、method-search packet、可编辑 SVG/PDF 文本
438
+ 和视觉 QA 记录。
439
+
440
+ ## License / 许可证
441
+
442
+ MIT License. See [LICENSE](LICENSE).
443
+
444
+ 采用 MIT License,详见 [LICENSE](LICENSE)。