Objects
Pre-build objects are available in the APMonitor language to facilitate flowsheets of chemical processing equipment. Objects are defined in the Objects ... End Objects section of the model file. New instances of an object are defined by declaring a new object name equal to the parent object type.
new_child = parent_object
Object Library
The object library consists of chemical processing equipment such as feed streams, reactors, pumps, mixers, flash columns, vessels, and distillation stages. It also includes other elements that support distributed control system emulation such as a LAG and a PID controller.
- Abs - Absolute value (MPEC)
- Feed - Feed stream
- Feedback - Internal feedback
- Flash - Flash
- Flash_column - Flash column
- Info - Info file for variable classification
- Info_FV - Fixed Variable
- Info_MV - Manipulated Variable
- Info_SV - State Variable
- Info_CV - Controlled Variable
- Lag - First order lag
- Lookup - Lookup table
- LTI - Linear time-invariant, discrete or continuous
- Mass - Mass of a reserve
- Massflow - Massflow of a stream
- Massflows - Massflows of a stream
- Max - Maximum value (MPEC)
- Min - Minimum value (MPEC)
- Mixer - Mixer of 2 or more streams
- PID - Proportional Integral Derivative Controller
- Poly_reactor - Polymerization reactor
- Pump - Pump for changes in pressure
- PWL - Piece-wise Linear
- Reactor - Vessel with reaction of individual species
- Recovery - Separation by recovery
- Sign - Number Sign (-1 or 1)
- Splitter - Split of one stream into 2 or more streams
- Stage_1 - Distillation stage (type 1)
- Stage_2 - Distillation stage (type 2)
- Stream_lag - First order lag of streams
- Thermo_* - Thermodynamic properties (* see below for specific properties)
- Vessel - Molar reserve with multiple inlet streams
- Vesselm - Mass reserve with multiple inlet streams
Thermo objects
Thermo objects access data from the underlying thermodynamic database. There are over 1700 compounds accessible in the database. To reduce the size of the APMonitor executable, only some of the more common compounds are currently incorporated. Additional compounds can be easily added but require a rebuild of the executable.
Temperature Independent Property Data
Temperature independent property data do not vary with temperature. They are defined as constants for each of the species declared in the Compounds ... End Compounds section of the model. If the Compounds ... End Compounds section is missing, all available compounds are included in the model.
| thermo_mw | Molecular Weight | kg/kmol |
| thermo_tc | Critical Temperature | K |
| thermo_pc | Critical Pressure | Pa |
| thermo_vc | Critical Volume | m^3/kmol |
| thermo_ccf | Crit Compress Factor | unitless |
| thermo_mp | Melting Point | K |
| thermo_tpt | Triple Pt Temperature | K |
| thermo_tpp | Triple Pt Pressure | Pa |
| thermo_nbp | Normal Boiling Point | K |
| thermo_lmv | Liq Molar Volume | m^3/kmol |
| thermo_ighf | IG Heat of Formation | J/kmol |
| thermo_iggf | IG Gibbs of Formation | J/kmol |
| thermo_igae | IG Absolute Entropy | J/kmol*K |
| thermo_shf | Std Heat of Formation | J/kmol |
| thermo_sgf | Std Gibbs of Formation | J/kmol |
| thermo_sae | Std Absolute Entropy | J/kmol*K |
| thermo_hfmp | Heat Fusion at Melt Pt | J/kmol |
| thermo_snhc | Std Net Heat of Comb | J/kmol |
| thermo_af | Acentric Factor | unitless |
| thermo_rg | Radius of Gyration | m |
| thermo_sp | Solubility Parameter | (J/m^3)^0.5 |
| thermo_dm | Dipole Moment | c*m |
| thermo_r | van der Waals Volume | m^3/kmol |
| thermo_q | van der Waals Area | m^2 |
| thermo_ri | Refractive Index | unitless |
| thermo_fp | Flash Point | K |
| thermo_lfl | Lower Flammability Limit | K |
| thermo_ufl | Upper Flammability Limit | K |
| thermo_lflt | Lower Flamm Limit Temp | K |
| thermo_uflt | Upper Flamm Limit Temp | K |
| thermo_ait | Auto Ignition Temp | K |
Temperature Dependent Property Data
The temperature dependent thermo objects produce values based on a specified temperature. When a temperature dependent property object is declared, a new temperature variable will be created. This variable can be adjusted or linked to an existing temperature of interest.
| thermo_sd | Solid Density | kmol/m^3 |
| thermo_ld | Liquid Density | kmol/m^3 |
| thermo_svp | Solid Vapor Pressure | Pa |
| thermo_lvp | Liquid Vapor Pressure | Pa |
| thermo_hvap | Heat of Vaporization | J/kmol |
| thermo_scp | Solid Heat Capacity | J/kmol*K |
| thermo_lcp | Liquid Heat Capacity | J/kmol*K |
| thermo_igcp | Ideal Gas Heat Capacity | J/kmol*K |
| thermo_svc | Second Virial Coefficient | m^3/kmol |
| thermo_lv | Liquid Viscosity | Pa*s |
| thermo_vv | Vapor Viscosity | Pa*s |
| thermo_sk | Solid Thermal Conductivity | W/m*K |
| thermo_lk | Liq Thermal Conductivity | W/m*K |
| thermo_vk | Vap Thermal Conductivity | W/m*K |
| thermo_st | Surface Tension | N/m |
Example - MIN Function
Example - Distillation Column
Model distill Compounds
propylene
propane
hydrogen
nitrogen
End Compounds
Objects
! feed stream
feed = Feed
feed_lag = Stream_Lag
feed_cooler = Vessel
feed_flash = Flash
liq_mixer = Mixer
vap_mixer = Mixer
! condenser and reflux
condenser = Vessel
drum = Flash
reflux = Splitter
! column stages
stage[1:8] = Stage_1
! reboiler
sump = Vessel
reboiler = Vessel
reboiler_flash = Flash
! mass and massflows
sump_mass = Mass
feed_massflow = Massflow
cleu_massflow = Massflow
btms_massflow = Massflow
End Objects
Connections
! feed streams
feed.* = feed_lag.inlet.*
feed_lag.outlet.* = feed_cooler.inlet.*
feed_cooler.outlet.* = feed_flash.inlet.*
feed_flash.outlet_vap.* = vap_mixer.inlet[1].*
feed_flash.outlet_liq.* = liq_mixer.inlet[1].*
! liquid down the column
liq_mixer.inlet[2].* = stage[1].l_out.*
liq_mixer.outlet.* = stage[2].l_in.*
stage[2:7].l_out.* = stage[3:8].l_in.*
stage[8].l_out.* = sump.inlet.*
! reboiler
sump.outlet.* = reboiler.inlet.*
reboiler.outlet.* = reboiler_flash.inlet.*
! vapor up the column
reboiler_flash.outlet_vap.* = stage[8].v_in.*
stage[3:8].v_out.* = stage[2:7].v_in.*
vap_mixer.inlet[2].* = stage[2].v_out.*
vap_mixer.outlet.* = stage[1].v_in.*
! condenser
stage[1].v_out.* = condenser.inlet.*
condenser.outlet.* = drum.inlet.*
drum.outlet_liq.* = reflux.inlet.*
reflux.outlet[2].* = stage[1].l_in.*
! mass and massflow meters
sump.reserve.* = sump_mass.acc.*
feed.* = feed_massflow.stream.*
drum.outlet_vap.* = cleu_massflow.stream.*
reboiler_flash.outlet_liq.* = btms_massflow.stream.*
! stream pressures
strm_p = stage[1].v_out.p
strm_p = stage[2:8].l_out.p
strm_p = stage[3:8].v_out.p
! feed and stage pressures
fd_p = stage[1:8].l_res.p
End Connections
Model custom
Parameters
fd_t = 370.0 ! K
fd_p = 3.11e6 ! Pa
fd_c2h4 = 0.28 ! mol%
fd_c3h6 = 0.6184 ! mol%
fd_c3h8 = 0.0916 ! mol%
fd_h2 = 0.01 ! mol%
strm_p = fd_p ! Pa
fd_ndot = 1.0
End Parameters
Variables
fd_mdot = 0.395 ! kg/sec
End Variables
Connections
fd_t = feed.t
fd_p = feed.p
fd_c2h4 = feed.x[1]
fd_c3h6 = feed.x[2]
fd_c3h8 = feed.x[3]
fd_h2 = feed.x[4]
fd_mdot = feed_massflow.mdot
fd_ndot = feed.ndot
End Connections
Intermediates
End Intermediates
Equations
End Equations
End Model
|










QR Code