How to Write Models in ASCEND
Read the HOWTO's - this is a barebones guide.
This is a step by step description of how you would
develop models in ASCEND. We have created models for solving
a few of the equations of state including the
ideal gas, van der Waals,
truncated virial, Redlich Kwong, Soave Redlich Kwong
and the Peng Robinson equations of state.
We have also written models to solve Bubble and Dew Point
temperature and pressures and flash for both ideal gas,
ideal liquid and for non ideal liquid mixtures.
The equations as you
may see them in a textbook are presented and the way they will
look in an ASCEND models are also here. In part A, all of the equations
and constants and parameters and methods are within one file.
In part B, we show how you can parametrize these models so they can
be easily reused. We have used
several example problems from Smith and Van Ness's
7th Edition.
The complete, working models and scripts are also
given at the end.
The procedure can be described as follows:
-
Assemble the Equations you need
- Decide the kinds of variables and constants you will need
- Translate the equations into an ASCEND format
- Add methods that will properly pose your model
- Test the model and Methods
-
Ideal Gas
-
-
Assemble the Equations you need
- Decide the kinds of variables and constants you will need
You have P which is pressure, T which is temperature,
V is molar_volume and of course R which is the
universal gas constant.
- Translate the equations into an ASCEND format
- Add methods that will properly pose your model
- Test the model and Methods
- The Truncated Virial equation of State
-
|
Z = |
|
= 1 + |
|
= 1 + |
|
= 1 + |
|
(2) |
where B is BPc/RTc
B can be calculated using the correlation
proposed by Pitzer and coworkers B = B0 + ω B1
and so we can rewrite Z as
Z = 1 + B0Pr/Tr + ω B1 Pr/Tr
and expressing Z = Z0 + ω Z1 we can write
Z0 = 1 + B0Pr/Tr
and Z1 = B1Pr/Tr
Second virial coefficients are functions of temperature
only and so B0 and B1 can be represented by
B0 0.083 − 0.422/Tr1.6 and
B1 = 0.139 − 0.172/Tr4.2
- Redlich Kwong
-
- Soave Redlick Kwong
-
- Peng Robinson
-
This document was translated from LATEX by
HEVEA.