3.3.0 Intro

We will consider fluids that are ideal in the sense that the
energy associated with a fluid mixture is identical to the energy of
the same compounds flowing in separate streams. In essence we will
neglect any energy effects associated with mixing of compounds. The
molar flow rate of a fluid mixture made up of C compounds is:

where Nk is the molar flow rate of compound k.

We will assume that the total enthalpy content of the mixture is
simply:

where
is the molar specific enthalpy of the mixture
and k is the molar specific enthalpy of compound k at the
conditions in the stream.

Changes in enthalpy of a pure compound are due to:

a) changes in temperature
b) changes in state
c) changes in pressure.

We will consider only the first two of these changes in
enthalpy.

The following functions in ~ceng301/matlab/mods will
be discussed in this chapter:

Display the flow rates and energy content of each stream
in or out of a module.

Prior to use of most of these modules, you must use
start301 to specify compounds and retrieve property
data for them. The functions enth1,
enth2 and enth3 all determine the
enthalpy change associated with temperature changes in pure
compounds.

The functions enth1 and
enth2

The functions enth1 and enth2
calculate the change in enthalpy for a substance undergoing a
temperature change at constant pressure. Each uses a polynomial
approximation for the heat capacity:

cp = a + (b * T) + (c * T2) + ...

to determine the enthalpy change associated with a change in
temperature from Ti to Tf. Integration of this polynomial gives the
enthalpy change at constant state and pressure:

Note that many different kinds of polynomial approximations can be
found for different compounds. These may include:

use of the temperature in different units: K, °C,
°F, or R,

giving results in different units such as J, kJ, cal or
BTU,

different ranges for the polynomial powers.

All of the polynomials in the Appendices and our MATLAB Data Bank
require the temperature to be in K and give the enthalpy change in
Joules. All are polynomials with up to fourth powers of the
temperature. You may find many other kinds of polynomial
approximations including ones with negative powers of the
temperature. The two functions: enth1 and
enth2 have the same effect but use different methods
for achieving their results. Enth1 lists as:

Note the "for" loop used to evaluate the polynomial. Our
enth2 uses the MATLAB polyval function with the
specific heat coefficients for the integral of cp to do the same
thing. It avoids obvious looping and serves as a check on
enth1.

Both enth1 and enth2 must be given
three arguments. The comments in the functions define each argument.
We will follow the suggestions in the comment about both functions to
set properties for benzene. Here is the session using the FORTRAN
program start301 to set up the test file
with benzene data in it, beginning by selecting (1) New
Session, Energy & Mass Balances, using CENG 301's
database, and Kelvin as the temperature unit:

Input the name of your new file: test
The output file name is: test
Input the number of compounds: 1
The number of compounds is: 1
Enter the name of compound # 1: benzene
Enter the number of reactions: 0
Here are your compounds' formulae and names:
No. Formula Name
----------------------------------------
1 C6H6 benzene
Here are your reactions:
----------------------------------------
No reactions given
Enter the number of streams: 0
The variables for your compounds have now been created,
you may continue, or come back later and reload the same data.

The variable cpv has the specific heat coefficients for
vapor benzene:

>> cpv
cpv =
18.5800 -0.0117 0.0013 -0.0000 0.0000

The last two coefficients appear to be zeros, but we can see that
they are not by:

The function enth1 finds the enthalpy change
associated with any temperature change over which the specific heat
approximation is valid. For example the change associated with
heating one mol of benzene vapor from 300K to 400K could be found
by:

>> enth1(300,400,cpv)
ans =
9.7166e+03

The change associated with heating one mole of liquid from 300 to 400
K could be found by using the data stored in cpl:

To use the second enthalpy change function, we need to have our
coefficients ordered in descending powers of temperature and to be
divided by the power. This is the way data is stored in the variables
that start with "icp". In a previous version of start301, the
variables starting with "icp" were created and saved. However, since
they are created from other variables and not needed for energy
balances themselves, they were not created in the current version of
start301. To demonstrate the use of the enthalpy functions, the
intcp and intcp2 functions were created to give us
the "icp" variables after running start301. If we set benzene and
water as our compounds we will find after executing
start301:

The function intcp2 may also be used as shown in the help for
enth2 to make the "icp" arrays without storing them. In the
previous session with benzene as the only compound, cps was
not defined. This time there is data for solid water (ice), but the
missing data for the specific heat of solid benzene produces a string
of NaN's. The function enth2 works only for a single
compound, so we use it for benzene vapor as:

>> enth2(300,400,icpv(1,:))
ans =
9.7166e+03

The answer is always in J/mol for the data stored in the compound
files. Note the difference between liquid and vapor enthalpy
differences. If you use cp data in other units (such as AE units in
some of the Tables in the Appendix of Reklaitis) the answer would be
in other units (such as Btu/lb mol.)

The Function: enth3

The main problem with the functions enth1 and
enth2 is that the enthalpy change for only a single
compound can be found. Frequently we will want the enthalpy change
for all the compounds in a flowing mixture. That is the purpose of
enth3. It is assumed in enth3 that
the compounds have been identified by execution of the
start301 program. Furthermore, all of the
compounds must be in the same state. The three arguments
required by enth3 give the initial and final
temperatures and the state of the compounds. Here is what help
shows:

>> help enth3
enth3 finds the sensible enthalpy change (J/mol)for compounds
designated in the vector j or all of them if 4th argument
is omitted.
All the designated cmpds MUST be in the same state and
must be set with start301 before execution of enth3
function ents=enth3(ti,tf,s,j)
Arguments:
ti the initial temperature in K.
tf the final temperature in K.
s the state of the compounds:
'v' for vapor or
'l' for liquid or
's' for solid.
j compounds designated in cnms
See also ENTH1 and ENTH2
Example: After executing start301.
with the compounds: benzene(1), water(2) carbon(3)
>>enth3(300,400,'v',1:2);
OKB, revised help by TYLC, SHD & MAH

We can see how to use enth3 by the following
session following execution of start301 to specify
benzene and water as the compounds:

Note that the absence of data for solid benzene this time is
indicated by the value of NaN found the for the enthalpy change.

The Functions: HinkJ and mHinkJ

The function HinkJ uses data extracted by the
start301 program to calculate the enthalpy of
compounds with given names or formula stored in cnms at one
specific temperature relative to the elements in their normal states
at 25°C. In contrast to the enth functions, the
enthalpies calculated by HinkJ are given in kJ/mol.
The arguments of the function are:

the temperature in Tdeg,

the state of the compounds: v, l, or s,

the indices of the compounds in cnms that will be
found.

If the third argument is omitted, the enthalpies of all the
compounds will be found. The data used by the function are polynomial
coefficients stored in the arrays: hcpv, hcpl and
hcps when setname is executed. Here are the
comments from HinkJ:

>> help HinkJ
HinkJ - Finds enthalpies for compounds relative to elements
function h=HinkJ(t,s,j)
HinkJ calculates the enthalpy of cmpds (all in the same state)
relative to their elements in their normal states at 25 degrees C
Returns the enthalpy in KJ/mol
Must execute the start301 programs first
See also mHinkJ
Argument Gives
t temperature in units of Tdeg.
s State: 'v', 'l' or 's'.
j Indices of compounds in cnms
that are to be found. If the
3rd argument is omitted, all are found.
Example: After executing start301 with the cmpds in this order:
benzene, water, carbon, bromine and no streams
>>HinkJ(300,'v'); this will find enthalpy for all cmpds
>>HinkJ(300,'l',[1 2 4]); this will find enthalpy for cmpds 1,2,4
OKB, revised help by TYLC

An auxiliary function: at allows the
user to specify temperatures in any of the common units: Celsius,
Fahrenheit, or Rankine in addition to Kelvin. The global variable
Tdeg must be set as 'C', 'F', 'R' or 'K'. Then any temperature given
in one of those 4 units will be converted to Kelvin as required in
the argument right of the two enthalpy functions. It lists as:

Its use is shown by:

>> Tdeg='K';<--- Working in Kelvin,
>> at(300)<--- at gives back its argument
ans =
300
>> Tdeg='C';<--- Working in Celsius,
>> at(25)<--- at adds 273.15 to its argument
ans =
298.1500

The at function is used in HinkJ and many of the vapor-liquid equilibrium functions. When you have Tdeg = 'C', any temperature inputs in the argument of the (module) programs will be interpreted as being in °C and will then be converted automatically to Kelvin.>> Tdeg='F';<--- Working in Fahrenheit,
>> at(212) <--- at adds 459.67 and divides the result by 1.8
ans =
373.1500 <--- The boiling point of water is 212°F or 373.15K
>> Tdeg='K';<--- Let's go back to using K.

Now let's see how to find the enthalpy of various compounds with
temperature in K. Using start301:

Obviously, there is no data for carbon as a gas. If we want only
those compounds that we have data for, then we must specify the ones
that we want in the third argument:

>> HinkJ(300,'v',[1 2 4])
ans =
83.0815 -241.7679 30.6494

Here is what we find for a liquid stream:

>> HinkJ(300,'l')
ans =
49.9513 -285.4883 NaN 0.1313

Finally, here is what we get for the solids:

>> HinkJ(300,'s')
ans =
NaN -292.4029 0.0172 NaN

This time, we only have data for water and carbon. An extension that
allows the user to give multiple temperatures and get a matrix of
enthalpies for each temperature as well as each compound is called:
mHinkJ. The help on mHinkJ explains
how to use it.

>> help mHinkJ
mHinkJ - Finds enthalpies for compounds, allows multiple temperatures
function hs=mHinkJ(ts,s,j)
Matrix version of HinkJ. The temperatures may be a vector.
Other arguments are the same as in HinkJ and all cmpds must be in same
state with temperature designated by Tdeg
Argument Gives
s the physical state: 'v' for vapor, 'l' for liquid
or 's' for solid.
j the indices of the compounds in cnms that are
to be included. If the third argument is omitted,
all compounds are included.
hs returns the enthalpies for each temperature in a row and
each compound in a column.
Example: For cnms set with the start301 programs and only water in it:
mHinkJ([200 300],'v')
will give the enthalpy of vapor water at 200K and 300K
as a column vector.

Here is the result returned by mHinkJ for the same
session shown before with the four compounds benzene, water, carbon
and bromine. We can find the enthalpies of all the compounds at
various states at the temperatures 25°C and 100°C by:

The steam and thermprop programs were used to find
the enthalpies of water and carbon dioxide at a variety of pressures
and temperatures. These values are compared to those given by
HinkJ in the next session to show how this requires a
conversion of units and adjustment for different reference states.
The values from both sources were then used to work example The next
table shows the enthalpies found with the FORTRAN programs.