Skip to content
Preview.bkp@modelscript/aspen 15 diagnostic rules
Parser WASM GLR
Diagnostics 15 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica
Live ExampleMethanolWaterColumn.bkp

Aspen Plus Methanol-Water Pre-Heater, Flash & RadFrac Column

Chemical process flowsheet mixing crude methanol feed with recycle, heating to bubble point, flashing vapor, and fractionating in a RadFrac column.

Playground
Source (17 lines)
1TITLE "Methanol-Water Binary Distillation & Flash Recovery"
2COMPONENTS
3  METHANOL CH4O /
4  WATER H2O
5FLOWSHEET
6  BLOCK B_MIX   IN=CRUDE_FD RECYCLE  OUT=MIX_OUT
7  BLOCK B_HEAT  IN=MIX_OUT           OUT=HOT_FEED
8  BLOCK B_FLASH IN=HOT_FEED          OUT=VAP_TOP LIQ_BOT
9  BLOCK B_COL   IN=LIQ_BOT           OUT=DISTILL BOTTOMS
10BLOCK B_MIX MIXER
11  PARAM PRES=1.20
12BLOCK B_HEAT HEATER
13  PARAM TEMP=76.5 PRES=1.15
14BLOCK B_FLASH FLASH2
15  PARAM TEMP=78.2 PRES=1.05
16BLOCK B_COL RADFRAC
17  PARAM NSTAGE=18 RR=2.4
Aspen Plus Process Flow Diagram (PFD)
Methanol-Water Binary Distillation & Flash Recovery ModelScript Process Flow Diagram (PFD) B_MIX MIXER Unit Op: B_MIX (MIXER) B_HEAT HEATER Unit Op: B_HEAT (HEATER) B_FLASH FLASH2 Unit Op: B_FLASH (FLASH2) B_COL RADFRAC Unit Op: B_COL (RADFRAC) Phases: Vapor Liquid 2-Phase
Drag to pan · Click % to reset

Aspen Plus & HYSYS Chemical Process (.in, .inp, .bkp) ​

@modelscript/aspen (languages/aspen) provides zero-regex parsing, vapor-liquid equilibrium (VLE) flash computation, distillation column MESH equations, DAE lowering, and Modelica 3.x projection for Aspen Plus and Aspen HYSYS chemical flowsheet input decks.


Supported Extensions & Standards ​

ExtensionFormatDescription
.in / .inpAspen Plus Input FileKeyword-sectioned chemical process flowsheet, unit operations, stream thermodynamics
.bkpAspen Backup DeckSerialized ASCII Aspen model topology and stream definitions

Key Capabilities ​

1. Rachford-Rice Vapor-Liquid Equilibrium (VLE) Flash Solver ​

  • Solves isothermal (T-P) and adiabatic (P-H) flash equilibrium via the Rachford-Rice equation:f(ψ)=∑i=1Czi(Ki−1)1+ψ(Ki−1)=0where ψ=V/F is the vapor fraction, zi is the feed mole fraction, and Ki(T,P) is the equilibrium ratio:Ki=yixi=γiPisat(T)ϕiP
  • Uses modified Antoine vapor pressure equations:ln⁡Pisat=Ai−BiT+Ci
  • Implements subcooled liquid (∑ziKi<1) and superheated vapor (∑zi/Ki<1) state identification with monotonic Newton-Raphson bracket solving.

2. Unit Operations & Distillation Columns ​

  • Mixers & Splitters: Rigorous material balance (∑Fin=∑Fout) and energy conservation (∑H˙in=∑H˙out).
  • Heaters & Coolers: Specified duty (Q) or target outlet temperature/vapor fraction.
  • Flash Separators: Multi-component 2-phase and 3-phase phase separation vessels.
  • RadFrac Equilibrium Distillation Columns: Rigorous stage-by-stage MESH equations (Material balance, Equilibrium, Summation, Heat/enthalpy balance).

3. Direct Linear-Memory DAE Lowering ​

  • Compiles flowsheet topology, stream molar balances, and component enthalpies directly into @modelscript/runtime's DAEBuilder struct-of-arrays linear memory arena without intermediary AST allocations.
  • Emits continuous DAE systems with algebraic stream constraints for joint dynamic simulation with pipeline networks (@modelscript/lps) and multiphase transient pipelines (@modelscript/olga).

4. Bidirectional Modelica 3.x Projection ​

  • Translates unit operations into standardized Modelica.Fluid or OpenIPSL thermal-fluid models with acausal fluid ports (m_flow, p, h, Xi).

Pre-Flight Diagnostics ​

The Aspen analyzer inspects flowsheet connectivity, phase equilibria, and thermodynamic consistency:

15 rules12 error3 warning Run with msx aspen lint

CodeRuleSeverityMessage
M8101unconnected-stream-porterrorStream '<streamName>' connected to block '<blockName>' inlet has no producing source block outlet.
M8102tear-stream-unconvergederrorCircular flowsheet loop detected involving block '<blockName>' without designated tear stream.
M8103invalid-eos-parametererrorComponent '<compName>' lacks critical properties for property method '<propertyMethod>'.
M8104negative-component-fractionerrorStream '<streamName>' specifies negative component molar fraction for '<compName>' (<val>).
M8105column-reboiler-heat-deficitwarningColumn '<blockName>' duty results in non-positive reboiler boil-up.
M8106duplicate-block-iderrorDuplicate block ID '<blockId>' declared in flowsheet.
M8107duplicate-component-iderrorDuplicate component ID '<compId>' declared in COMPONENTS.
M8108fractions-sum-invalidwarningComponent mole fractions in stream '<streamName>' sum to <value>, expected 1.0.
M8109feed-stage-out-of-rangeerrorColumn '<blockName>' feed stage <stage> is out of bounds (1..<nStages>).
M8110product-stage-out-of-rangeerrorColumn '<blockName>' product stage <stage> is out of bounds (1..<nStages>).
M8111missing-flowsheet-entrywarningBlock '<blockName>' has parameter declarations but is not connected in FLOWSHEET.
M8112stream-temperature-negativeerrorStream '<streamName>' specifies non-physical absolute temperature <temp> K.
M8113stream-pressure-negativeerrorStream '<streamName>' specifies non-positive pressure <pres> bar.
M8114radfrac-stages-too-fewerrorRadFrac column '<blockName>' has fewer than 2 stages (<nStages>).
M8115reflux-ratio-negativeerrorColumn '<blockName>' reflux ratio (<rr>) must be non-negative.

Generated from languages/aspen/src/errors.ts. All languages →


CLI Usage ​

bash
# Inspect flowsheet components, blocks, and stream properties
msx aspen inspect MethanolWaterPlant.inp

# Run pre-flight semantic diagnostics
msx aspen lint MethanolWaterPlant.inp

# Solve isothermal flash VLE for a feed stream
msx aspen solve-flash MethanolWaterPlant.inp --stream FEED

# Lower flowsheet to ModelScript linear DAE arena
msx aspen to-dae MethanolWaterPlant.inp

# Project into Modelica 3.x acausal fluid stream model
msx aspen to-modelica MethanolWaterPlant.inp -o MethanolPlant.mo

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy