Skip to content
Preview.gproms@modelscript/gproms 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica, DAE
Live ExampleExothermicCSTR.gproms

gPROMS Non-Isothermal CSTR Process Model

Equation-oriented process model coupling Arrhenius first-order reaction kinetics with jacketed heat transfer.

Playground
Source (12 lines)
1PARAMETER
2  k0   AS REAL DEFAULT 1.2e6 ;
3  Ea_R AS REAL DEFAULT 4500.0 ;
4  V    AS REAL DEFAULT 2.5 ;
5VARIABLE
6  Ca   AS Concentration ;
7  T    AS Temperature ;
8  r_A  AS ReactionRate ;
9EQUATION
10  r_A = k0 * EXP(-Ea_R / T) * Ca ;
11  V * $Ca = 1.2 * (2.0 - Ca) - V * r_A ;
12  V * 4184.0 * $T = 1.2 * 4184.0 * (300.0 - T) + 65000.0 * V * r_A ;
gPROMS Process Flowsheet & DAE Equations
F = 1.2 m3/s lowerToDAE «gproms port» FeedStream «parameters» Cin = 2.0 kmol/m3 Tin = 300.0 K «gproms model» ExothermicCSTR «model» r_A = k0*exp(-Ea/RT)*Ca V = 2.5 m3 «bdf stiff solver» DAE Arena Solver «verification» states = [Ca, T] alg = [r_A]
Drag to pan · Click % to reset

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 ​

ExtensionFormatDescription
.gpromsgPROMS Model FileEquation-oriented process model defining PARAMETER, DISTRIBUTION_DOMAIN, VARIABLE, EQUATION, and PROCESS entities
.pmlProcess Modeling LanguageModular PML entity and flowsheet specification

Key Capabilities ​

1. Equation-Oriented & Distributed-Parameter Modeling (PDAE) ​

  • Parses MODEL and PROCESS blocks 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 derivatives ∂C∂z and ∂2C∂z2 alongside time derivatives $C (dCdt).
    • 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_DOMAIN spatial 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's DAEBuilder linear memory arena.

3. Bidirectional Modelica 3.x Projection ​

  • Projects gPROMS MODEL and PROCESS definitions into equation-based Modelica 3.x models (gpromsToModelica) with explicit der(...) equations and parameter bindings.

Pre-Flight Diagnostics ​

10 rules8 error2 warning

CodeRuleSeverityMessage
M9451undeclared-variable-typeerrorVariable '<varName>' in model '<modelName>' references undeclared DECLARE TYPE '<typeName>'.
M9452invalid-variable-boundserrorVariable type '<typeName>' specifies invalid bounds or default value (default=<defaultVal>, lower=<lower>, upper=<upper>); requires lower < upper and lower <= default <= upper.
M9453invalid-distribution-domainerrorDistribution domain '<domainName>' in model '<modelName>' specifies invalid domain [<lower> : <upper>] or grid points (<gridPoints>); requires lower < upper and gridPoints >= 2.
M9454undeclared-equation-identifiererrorEquation in model '<modelName>' references undeclared identifier '<identifier>'.
M9455structural-dof-mismatchwarningModel '<modelName>' has a structural degrees-of-freedom mismatch: <eqCount> equations + <assignCount> ASSIGNed variables != <varCount> unknown variables.
M9456uninitialized-differential-statewarningDifferential state variable '$<varName>' lacks an INITIAL condition in PROCESS '<processName>'.
M9457partial-on-non-distributed-variableerrorSpatial derivative 'PARTIAL(<varName>, <domainName>)' in model '<modelName>' is applied to variable '<varName>' which is not distributed over domain '<domainName>'.
M9458overassigned-parameter-or-variableerrorEntity '<entityName>' in PROCESS '<processName>' is overassigned or misused: <detail>.
M9459empty-gproms-modelerrorgPROMS model '<modelName>' is empty and defines no variables or equations.
M9460duplicate-entity-declarationerrorDuplicate <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

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