gPROMS / PML Dynamic Process Modeling (.gproms, .pml)
@modelscript/gproms (languages/gproms) provides native WebAssembly GLR parsing, Method-of-Lines (MOL) spatial finite-difference discretization for distributed-parameter partial differential-algebraic equations (PDAEs), 4th-order Runge-Kutta dynamic simulation, DAEBuilder lowering, and Modelica 3.x projection for gPROMS Process Modeling Language (PML) chemical, pharmaceutical, and crystallization process models.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.gproms | gPROMS Model File | Equation-oriented process model defining PARAMETER, DISTRIBUTION_DOMAIN, VARIABLE, EQUATION, and PROCESS entities |
.pml | Process Modeling Language | Modular PML entity and flowsheet specification |
Key Capabilities
1. Equation-Oriented & Distributed-Parameter Modeling (PDAE)
- Parses
MODELandPROCESSblocks including:DISTRIBUTION_DOMAIN: Axial, radial, or particle-size spatial domains (e.g.,Axial AS [0 : L]) for tubular reactors, packed adsorption columns, and crystallizers.PARTIAL(u, z)&INTEGRAL: First- and second-order spatial derivativesand alongside time derivatives $C(). BOUNDARY&EQUATION: Danckwerts inlet/outlet boundary conditions and non-linear reaction/mass-transfer equations.ASSIGN,INITIAL, &SCHEDULE: Degrees-of-freedom specifications, initial conditions, and sequential operating procedures (CONTINUE FOR,SWITCH,RESET).
2. Method-of-Lines (MOL) Discretization & Dynamic Solver
- Automatically discretizes
DISTRIBUTION_DOMAINspatial grids into coupled ODE/DAE node equations using upwind and central finite-difference stencils. - Integrates transient startup, changeover, and reaction trajectories and lowers the resulting equation system into
@modelscript/runtime'sDAEBuilderlinear memory arena.
3. Bidirectional Modelica 3.x Projection
- Projects gPROMS
MODELandPROCESSdefinitions into equation-based Modelica 3.x models (gpromsToModelica) with explicitder(...)equations and parameter bindings.
Pre-Flight Diagnostics
10 rules8 error2 warning
| Code | Rule | Severity | Message |
|---|---|---|---|
M9451 | undeclared-variable-type | error | Variable '<varName>' in model '<modelName>' references undeclared DECLARE TYPE '<typeName>'. |
M9452 | invalid-variable-bounds | error | Variable type '<typeName>' specifies invalid bounds or default value (default=<defaultVal>, lower=<lower>, upper=<upper>); requires lower < upper and lower <= default <= upper. |
M9453 | invalid-distribution-domain | error | Distribution domain '<domainName>' in model '<modelName>' specifies invalid domain [<lower> : <upper>] or grid points (<gridPoints>); requires lower < upper and gridPoints >= 2. |
M9454 | undeclared-equation-identifier | error | Equation in model '<modelName>' references undeclared identifier '<identifier>'. |
M9455 | structural-dof-mismatch | warning | Model '<modelName>' has a structural degrees-of-freedom mismatch: <eqCount> equations + <assignCount> ASSIGNed variables != <varCount> unknown variables. |
M9456 | uninitialized-differential-state | warning | Differential state variable '$<varName>' lacks an INITIAL condition in PROCESS '<processName>'. |
M9457 | partial-on-non-distributed-variable | error | Spatial derivative 'PARTIAL(<varName>, <domainName>)' in model '<modelName>' is applied to variable '<varName>' which is not distributed over domain '<domainName>'. |
M9458 | overassigned-parameter-or-variable | error | Entity '<entityName>' in PROCESS '<processName>' is overassigned or misused: <detail>. |
M9459 | empty-gproms-model | error | gPROMS model '<modelName>' is empty and defines no variables or equations. |
M9460 | duplicate-entity-declaration | error | Duplicate <kind> declaration '<name>' in '<scope>'. |
Generated from languages/gproms/src/errors.ts. All languages →
CLI Usage
bash
# Run pre-flight linting on a gPROMS / PML model
msx lint TubularReactor.gproms
# Parse and inspect the CST / symbol table
msx parse TubularReactor.gproms
# Dispatch domain inspection or simulation via the polyglot router
msx domain gproms inspect TubularReactor.gproms
