Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Bonus Assignment

Name: Sanjay Dubey


Student Number: 201793286

Question 1. Use steam table to determine ‘a’ and ‘b’ for Water at some temperature.
To evaluate minimum objective function for set of experimental data.

Experimental data:
I have use the data from the superheated steam table. Steam Table is enclosed with the Email.
Pressure: [P1 P2 P3 P4 P5…Pn]
Volume: [V1 V2 V3 V4 V5 …Vn]
Temperature: [T1 T2 T3 T4 T5…Tn]

Tool Used: MATLAB Code and Excel Sheet. Both can be used to evaluate the Minimum Objective Function

Theory:
Where P is Pressure and R, T is Molar Gas Constant and Temperature respectively. Generally, all the gases in
nature behave non-ideal since they occupy some molecular volume and interact with each other. This additional
factor was considered in the Van der Waals equation [1].

𝑎
Van Der Waals gas: (𝑝 + 𝑉 2 ) (𝑉 − 𝑏) = 𝑅𝑇

Where Tc= Ω1 (R2Tc2/Pc) and Pc=Ω2(R Tc/Pc)


Tc= critical temperature and Pc = Pressure; Ω1= (27/64) & Ω2 (1/8)
a= average attraction between particles and b= volume excluded by a mole of particle [3]

To calculate Volume:
To evaluate the volume of a real gas, V in term n2a/V2 can be approximated as: nR/TP
as ideal gas.
V = nR3T3/(PR2T2+aP2) + nb
To calculate Pressure:
P = nRT/(V - nb) - n2a/V2

Theoretical Value of a and b from Literature

Tc = 647.096 K and Pc= 220.639Bar from the Saturated Steam Table [2]:
a and b are computed from the above equation:
Check the units
a = (0.4) *(8.3142)2*(647.096)2/ (22063912.8)
= 0.524741 J·m3/mol2 = 0.524741 J·m3/mol2 *10=5.247414571 L2·bar/mol2
b = (0.125) *(8.3142) *(647.096)/ (22063912.8)
= 3.04801E-05 m3/mol = 3.04801E-05 *1000 =0.03048(L/mol) (Since m3/mol=1000Lit/mol)
Minimum Objective function: In order to simulate the Phase behavior simulation for reservoir hydrocarbon
using the available EOS results in erroneous answer. Especially for the fluid near the critical region, reservoir
hydrocarbon consists of multicomponent. Various compositional analysis does not provide trusted value for the
calculation. Industry encounter this problem with tuning the some of the variable. Thumb rule set as to minimise
the difference between the predicted and Measure value.

Goal of this assignment is to minimise the objective function, defined as the sum of weighted square deviation.
Formula detail can also be refer from the Ali Danesh book (Eq.9.20)

wj is the weighted difference its value is selected base on the number of data point, reliability and importance of
the variable in the model.
wj=1.0

Δ=∑𝑛𝑖=1{(Pexp − Pred)/Pexp}2

Objective function in the below code is given “Rsum” and Tuning variable is “a” and “b” in the assignment.

I had used the simple approach to demonstrate the use of MATLAB code to evaluate the Minimum objective
function for just 6 data point with different value of a and b. Later on the code has been extended for the n number
of data point and various value of a and b. Including its combination.

A. Simple Approach:
pe=[10 50 100 200 300 400] %Experimental Pressure from the steam table database
pe=1000.*pe %Pressure in Pascals
t=[50 100 150 200 250 250] %Experimental Temperature from the steam table database
t=t+273.15
v=[14.674 3.418 1.9364 1.08034 0.79636 0.59512 ] %Volume For the 1kg of water
r=8.314 %SI Units Gas Constant
n=55.5 %Number of moles of water for 1.0kgof water

Plot PV diagram for Predicted and Experiment value diagram:

Fig 1: a =0.1 and b=0.1; Rsum=13.8050 Fig 2: a=0.001 and b=0.004; Rsum=0.6241
Fig 3: a=0.0001 and b=0.0001; Rsum= 0.0016 Fig4: a=0.55 & b=3.04801e-05; Rsum= 3.6550e-04

Observation:
• Rsum value get more lower for the value coming closer to the theoretical value.
• With the increase of the following data point like from 6 to 9 Rsum value was reduced.
Rsum:3.6550e-04 from fig 4 to Rsum= 3.4878e-04

t=[50 100 150 200 250 250 300 350 400]


t=t+273.15
v=[14.674 3.418 1.9364 1.08034 0.79636 0.59512 0.52256 0.47424 0.38426] %For
the 1kg of water
r=8.314 %SI Units
n=55.5 %no.of mole of water for 1kgof water
a=0.55 %Theory value of a with more PVT datapoints
b=3.04801e-05 %Theory value of b
• Simple approach Matlab code can be used for the various value of a and b to compute the minamum
objective function and it can show the deviation of the predicted value and experiment value.
• Value of a and b need to be manual in the code. General approach used the array value of a and b to
compute the Minimum Objective function

B. General Approach

In this approach we input the various of value of a and b and try with the various combination of the a and b
to compute the Rsum. Each combination a and b will generate the one Rsum. So for the 3 set of a and b
possible combination will give 9 Rsum value in matrix order. We have taken 36 PVT data point from the
steam table also MATLAB file is enclosed with this assignment.

36-PVT Datapoints have been selected:


I have chosen 36value from the steam table and their corresponding value of V at constant Temperature that is
400+273.15=673.15K. We choose for different temperature too. Its not the problem.
pe=[10000 50000 100000 200000 300000 400000 500000 600000 800000 1000000
1200000 1400000 1600000 1800000 2000000 2500000 3000000 3500000 4000000 4500000 5000000
6000000 7000000 8000000 9000000 10000000 12500000 15000000 17500000 20000000
25000000 30000000 35000000 40000000 50000000 60000000];

v=[31.063 6.209 3.1026 1.5493 1.03151 0.77262 0.61728 0.51372 0.38426 0.30659
0.2548 0.2178 0.19005 0.16847 0.1512 0.1201 0.09936 0.08453 0.07341 0.06475 0.05781
0.04739 0.03993 0.03432 0.02993 0.02641 0.02 0.015649 0.0124477 0.0099423
0.006004 0.00279 0.0021 0.0019017 0.0017309 0.0016335];

t=[673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15
673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15
673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15 673.15
673.15 673.15 673.15 673.15];

r=8.314 %SI Units


n=55.5 %no.of mole of water for 1kgof water

Important step: Here a and b can be input according to various range and different number of interval. We can
also use random number input. I prefer to use linspace syntax to carry out my operation.
lower_a=0.1;
upper_a=1;
lower_b=2.5e-5;
upper_b=3.5e-5;
n_a=50;
n_b=50;
a_set=linspace(lower_a,upper_a,n_a);
b_set=linspace(lower_b,upper_b,n_b);

Part A: Datapoints used :6-PVT datapoints for a=0.1 to 1 and b= 2.5e-5 to 3.5e-5 for 50 subintervals. The
minimum value is at (a,b)=(0.54082,2.7449e-05) and the value is = 6.7311e-08. Value of “a” value is quite like
mention in literature and b value is not so similar

Simulated Value:

a=0.54082,

b=2.7449e-05
Theoretical Value:
a= 0.524741
b=3.04801E-05

Fig 5 : Surface plot for the Objective Function.( Rsum=f(a,b))


Part B: Part A: Datapoints used :6-PVT datapoints for a=0.4 to 0.6 and b= 2.9e-5 to 3.2e-5 for 100
subintervals. The minimum value is at (a,b)=(0.54949,2.9091e-05) and the value is = 6.727e-08. Simulation
value of a and b is quite like mention in literature for a and b value. Simulation took 15min approx for 6 data
point for 36 it will take more time.

Simulated Value:

a=0.54949,

b=2.9091e-05
Theoretical Value:
a= 0.524741
b=3.04801E-05

Fig 6 : Surface plot for the Objective Function.( Rsum=f(a,b))

Part C: Datapoints used :36-PVT datapoints for a=0.1 to 1 and b= 2.5e-5 to 3.5e-5 for 50 subintervals. The
minimum value is at (a,b)=(0.43061,2e-05) and the value is = 1.2108. Value of “a” is quite like mention in
literature and b value is not so similar. Rsum=f(a,b), It seem from simulation that f isn’t monotonic
function and hence there could me multiple extrema i.e. minima or maxima.

Simulated Value:

a=0.43061,

b=2.0000e-05
Theoretical Value:
a= 0.524741
b=3.04801E-05

Fig 7: Surface plot for the Objective Function.( Rsum=f(a,b))


Observation:
• As the number of interval for the a and b is increase and data point for PVT is increased simulation
consume a lot of time for running. Parfor can be use to run the loops in parallel consuming less time. I
didn’t include that in my simulation.
• As number of interval for the a an b increase the value get more closer to the theoretical and Rsum is
also reduce to certain extent.

References:
1. Smith, J. M. (1950). Introduction to chemical engineering thermodynamics.
2. ASME Steam Table Web link: http://www.steamshed.com/pdf/034SteamTablesAsme.pdf
3. Chang, Raymond (2014). Physical Chemistry for the Chemical Sciences. University Science Books. p. 14. ISBN 978-1-
891389-69-6.
4. David R. Lide, Editor-in-Chief, CRC Handbook of Chemistry and Physics 86th Edition (Boca Raton, FL:
Taylor&Francis Group, 2005), p. 6-33

You might also like