Aspen-Adsorption-Automation

作者 mohammmadyazdani · 版本 1.0.0 · 更新于 2026-10-19 00:45 ·75.7 KB

通过 Python 调用 Aspen Custom Modeler 的 COM 接口,自动化运行 Aspen Adsorption 变压吸附模拟,可修改进料压力、步骤时长和床层几何等参数,并提取氢气纯度与回收率等性能指标。

AspenAdsorptionPython自动化COM接口变压吸附化工过程模拟

✓已通过基础校验

名称、分类、版本与作者信息完整,安装包与文档齐备。

✓可直接使用

提供 Markdown 文档与配置示例,下载后按文档说明使用即可。

Skill 详情

Aspen Adsorption Automation using Python COM Interface

使用 Python COM 接口实现 Aspen Adsorption 自动化

Author: Mohammad Yazdani
Email: mohamad.yazdani7990@gmail.com
Year: 2026

作者:Mohammad Yazdani
邮箱:mohamad.yazdani7990@gmail.com
年份:2026

Project Overview

项目概述

This repository demonstrates how to automate and extract data from Aspen Adsorption using Python through the Aspen Custom Modeler (ACM) COM interface.

本仓库演示了如何通过 Aspen Custom Modeler(ACM)COM 接口,使用 Python 对 Aspen Adsorption 进行自动化操作和数据提取。

Aspen Adsorption operates within the Aspen Custom Modeler environment, allowing users to access, modify, and control process simulations programmatically.

Aspen Adsorption 运行于 Aspen Custom Modeler 环境之中,允许用户以编程方式访问、修改和控制过程模拟。

The example focuses on a Pressure Swing Adsorption (PSA) process for hydrogen purification, serving as a foundation for automation in other cyclic adsorption processes such as VSA, TVSA, and DAC systems.

本示例聚焦于用于氢气提纯的变压吸附(PSA)过程,为其他循环吸附过程(如 VSA、TVSA 和 DAC 系统)的自动化奠定基础。

This project is intended for master's students, researchers, and engineers in Chemical and Process Engineering who are interested in integrating process modeling with Python-based automation and optimization workflows.

本项目面向化学与过程工程领域的硕士研究生、研究人员和工程师,适合对将过程建模与基于 Python 的自动化和优化工作流相集成感兴趣的人士。

Main Features

主要功能

  • Automate Aspen Adsorption simulations via Python
  • 通过 Python 实现 Aspen Adsorption 模拟的自动化
  • Modify process variables such as feed pressure, step duration, and bed geometry
  • 修改进料压力、步骤持续时间和床层几何结构等过程变量
  • Initialize and execute cyclic adsorption models programmatically
  • 以编程方式初始化并执行循环吸附模型
  • Extract process performance indicators (e.g., hydrogen purity and recovery)
  • 提取过程性能指标(如氢气纯度和回收率)
  • Enable data-driven modeling, process optimization, and surrogate model generation
  • 支持数据驱动建模、过程优化和代理模型生成

File Structure

文件结构

Aspen-Adsorption-Automation/
│
├── H2PSA.ada        (Aspen Adsorption simulation file)
├── H2PSA.py         (Python automation script)
├── *.f              (User-defined Fortran subprocedure files)
└── README.md        (Documentation)

Important Notes

重要说明

All simulation and subroutine files (.ada and .f) must be located in the same directory.

所有模拟文件和子程序文件(.ada 和 .f)必须位于同一目录中。

This ensures that Aspen Adsorption can properly locate and compile user-defined subroutines during model execution.

这确保 Aspen Adsorption 在模型执行期间能够正确找到并编译用户自定义子程序。

Requirements

环境要求

  • Aspen Adsorption v14.0 or newer (recommended)
  • Aspen Adsorption v14.0 或更新版本(推荐)
  • Python 3.8 or newer
  • Python 3.8 或更新版本
  • comtypes Python package
  • comtypes Python 包
  • Windows OS (COM interface required)
  • Windows 操作系统(需要 COM 接口)

Compatibility Note

兼容性说明

This script can also work with older Aspen Adsorption versions (v9–v13).

本脚本也可用于较旧的 Aspen Adsorption 版本(v9–v13)。

For older versions, ensure that the Aspen Custom Modeler COM server is properly registered.

对于较旧版本,请确保 Aspen Custom Modeler COM 服务器已正确注册。

You can do this by running the following command in an Administrator Command Prompt (adjusting for your version path):

您可以在管理员命令提示符中运行以下命令来完成注册(请根据您的版本路径进行调整):

"C:\Program Files\AspenTech\AMSystem V10.0\Bin\AspenModeler.exe" /regserver

To install the required Python dependency:

安装所需的 Python 依赖项:

pip install comtypes

Usage Instructions

使用说明

  1. Clone the repository:
    克隆仓库:
git clone https://github.com/mohammadyazdani/Aspen-Adsorption-Automation.git
cd Aspen-Adsorption-Automation
  1. Update your local Aspen paths inside the Python script:
    在 Python 脚本中更新您本地的 Aspen 路径:
ASPEN_PATH = r"C:\Program Files\AspenTech\AMSystem V14.0\Bin\AspenModeler.exe"
ADA_FILE   = r"C:\Path\To\Your\Simulation\H2PSA.ada"
  1. Run the script:
    运行脚本:
python H2PSA.py
  1. The Aspen Adsorption GUI will appear automatically on screen once the connection is established.
    连接建立后,Aspen Adsorption 图形界面将自动显示在屏幕上。

Applications

应用场景

  • Automated data generation for process design and optimization
  • 为过程设计和优化自动生成数据
  • Development of machine learning surrogate models
  • 开发机器学习代理模型
  • Process parameter sensitivity and feasibility studies
  • 过程参数敏感性分析与可行性研究
  • Integration of Aspen models into Python-based workflows for research and education
  • 将 Aspen 模型集成到基于 Python 的工作流中,用于研究和教学

Author

作者

Mohammad Yazdani
MSc Candidate in Chemical Engineering
Process Systems Engineering Enthusiast
Email: mohamad.yazdani7990@gmail.com

Mohammad Yazdani
化学工程硕士研究生
过程系统工程爱好者
邮箱:mohamad.yazdani7990@gmail.com

License

许可证

Released for academic and research purposes.

面向学术和研究目的发布。

Please credit the author when using or adapting this work.

使用或改编本作品时,请注明作者。

© 2026 Mohammad Yazdani. All rights reserved.

© 2026 Mohammad Yazdani。保留所有权利。

下载后解压即可使用
梦马论坛-以梦为马,不负韶华

化工人的交流乐园

联系我们

  • 投诉建议 相关侵权、举报、投诉及建议等,请发 E-mail:admin@meng.horse
返回顶部