chemical engineering with mathcad
DESCRIPTION
Chemical Engineering With MathcadTRANSCRIPT
����
����
����
����
��������������� ���
������������������������������
������������������������
�
�
�
�
�
�
�
�
����������
�������������������������
Table of Contents
Introduction............................................................................................................................1
2D Linear Interpolation ..........................................................................................................2
Energy Transfer across a Heat Exchanger...............................................................................6
Equilibrium Stages Required to Separate a Propane/Pentane Mixture .....................................8
Fitting Experimental Data to the Antoine Equation...............................................................11
Flowrate between Two Reservoirs ........................................................................................13
Pressure Loss and Liquid Flow through Pipe Networks ........................................................17
Liquid Flow through a Pump ................................................................................................20
Heat Transfer Coefficient for Pool Boiling of Water.............................................................23
Binary Distillation with the McCabe-Thiele Method.............................................................25
Pressure Drop through a Venturi Meter ................................................................................29
Pressure Drop through a Pipe of a Power Law Fluid .............................................................30
Liquid Flow through Pumps in Parallel.................................................................................34
Model of a Single-Component Vaporiser..............................................................................40
Model of a Single-Component Vaporiser under PI Control ...................................................43
Calculating the Specific Enthalpy of Ethanol........................................................................47
Heating an Oil Stream under PID Control.............................................................................48
The Transient Draining of Liquid from One Tank to Another with a Pump...........................51
Pressure Drop through a Pipe of a Two-Phase Fluid .............................................................56
Vapour/Liquid Equilibria of an Acetonitrile/Nitrobenzene Mixture ......................................59
�������������������� ��
Introduction ��������������� ������������������������������������������ delivers a targeted series of Mathcad calculations that both students and professionals will value. This guide offers engineers the opportunity to kick-start the implementation of their own calculations by using the enclosed worksheets as a starting point. Adept Scientific plc also provides dedicated targeted training courses for Chemical & Process Engineers who want to accelerate through the Mathcad learning curve. For sales, support and discussion please visit www.adeptscience.co.uk, or phone 01462 480055
�������������������� �
2D Linear Interpolation
1. Introduction
Linear interpolation is a common scientific and engineering concept - it's the process of estimating intermediate values from a series of X-Y points by connecting adjacent points with a straight line. This is a relatively straightforward process for 1-D data (i.e. a series of corresponding X and Y points), using Mathcad's linterp function. However, many physical systems have higher order characteristics (i.e. the pressure-temperature-specific volume relationship of a gas). This worksheet contains a program that will perform 2-D linear interpolation across two independent variables to give an interpolated value of the dependent variable. It is insensitive to the value of the matrix ORIGIN.
XE The first independent variable, in the form of a row vector, with strictly ascending or descending values
YE The second independent variable, in the form of a column vector, with strictly ascending or descending values
ZE The dependent variable, with the same number of columns and rows as XE and YE respectively
X, Y The values of the two independent variables at which you want an interpolated value of ZE
�������������������� !�
2. The Program The following program isn't the most elegant implementation of 2D linear interpolation, but a degree of error checking is built in
L2d XE YE, ZE, X, Y,( ) og ORIGIN←
xi
xi x←
break
X XE x� �( )og≤ XE og� �( )
og XE 1 og+� �( )og<if
X XE x� �( )og≥ otherwise
if
x og cols XE( ) 1− og+..∈for←
yi
yi x←
break
Y YEx≤ YEog YE1 og+<if
Y YEx≥ otherwise
if
x og rows YE( ) 1− og+..∈for←
Yt1ZEyi xi 1−, ZEyi 1− xi 1−,−
YEyi YEyi 1−−Y YEyi 1−−( )⋅
ZEyi 1− xi 1−,+
...�����
�����
← xi og> yi og>∧if
Yt1 ZEyi xi 1−,← xi og> yi og∧if
Yt1 ZEyi xi,← xi og yi og∧if
Yt1ZEyi xi, ZEyi 1− xi,−
YEyi YEyi 1−−Y YEyi 1−−( )⋅ ZEyi 1− xi,+← otherwise
Yt2ZEyi xi, ZEyi 1− xi,−
YEyi YEyi 1−−Y YEyi 1−−( )⋅ ZEyi 1− xi,+← yi og>if
Yt2 ZEyi xi,← otherwise
valueYt2 Yt1−
XE xi� �( )og XE xi 1−� �( )
og−X XE xi� �( )
og−��
��⋅ Yt2+← xi og>if
value Yt2← otherwise
valuereturn
:=
�������������������� "�
3. Sample Experimental Data and Usage
The following data gives the specific volume of steam (ZE) against the temperature (XE) and pressure (YE).
XE 374 400 410 420 430( )K:=
YE
0.5
0.6
0.7
0.8
0.9
1.0
�
� �
bar:= ZE
3426
2850
2440
2131
1892
1700
3671
3056
2617
2287
2031
1826
3766
3135
2685
2346
2084
1874
3859
3213
2752
2406
2137
1921
3953
3292
2819
2465
2199
1969
�
� �
liter
kg:=
Hence a sample usage....
Specific_Volume L2d XE YE, ZE, 404K, 0.63bar,( ):=
Specific_Volume 2.955m
3
kg= or Specific_Volume 2955
liter
kg=
4. Surface Plot of Experimental Data and Interpolated Surface
The follow two programs convert the two independent variables to a form suitable to plot with the dependent data on a 3D surface plot.
X_data
tempi j, XE j� �( )ORIGIN←
j ORIGIN cols XE( ) 1− ORIGIN+..∈for
i ORIGIN rows YE( ) 1− ORIGIN+..∈for
temp
:=
Y_data
tempi j, YEi←
j ORIGIN cols XE( ) 1− ORIGIN+..∈for
i ORIGIN rows YE( ) 1− ORIGIN+..∈for
temp
:=
plottingfunction X Y,( ) L2dXE
K
YE
bar,
ZE
liter kg1−⋅
, X, Y,�
� �
:=
X0 374:= X1 430:=
Y0 0.5:= Y1 1.0:=
Xgrid 100:= Ygrid 100:=
M CreateMesh plottingfunction X0, X1, Y0, Y1, Xgrid, Ygrid,( ):=
�������������������� #�
X_data
K
Y_data
bar,
ZE
liter kg1−⋅
,�
� �
M,
5. Interpolating Y values from X and Z Points
We can now backsolve for a specific pressure, given a required specific volume and temperature.
Required temperature Temperature 413K:=
Required specific volume Specific_Volume 3.1m
3
kg:=
A guess value of pressure is required to kick-start the numerical algorithm.
Guess Value Pressure 0.6bar:=
Given
L2d XE YE, ZE, Temperature, Pressure,( ) Specific_Volume
Pressure Find Pressure( ):=
Pressure 6.129 104× Pa= or Pressure 8.889psi=
The results can be checked by back-substitution.
L2d XE YE, ZE, Temperature, Pressure,( ) 3.1m
3
kg=
�������������������� $�
Energy Transfer across a Heat Exchanger
1. Introduction
Heat is being transferred from a hot to a cold stream across a heat exchanger according to the schematic below. The mass flowrates, input temperatures and specific heat capacities of both streams are known, as well as the heat transfer coefficient and heat transfer area. This worksheet will calculate the temperature of both output streams.
2. Physical Parameters
The following physical parameters are known.
Area of heat exchange A 25m2:=
Heat transfer coefficient U 1.2W m2−⋅ K
1−⋅:=
Specific heat capacity of hot stream CpH 4.18J kg1−⋅ K
1−⋅:=
Specific heat capacity of cold stream CpC 3J kg1−⋅ K
1−⋅:=
Mass flowrate of hot stream MH 10kg s1−⋅:=
Mass flowrate of cold stream MC 17kg s1−⋅:=
Temperature of hot input stream THin 372 K⋅:=
Temperature of cold input stream TCin 315K:=
�������������������� %�
3. Log-Mean Temperature Difference across Heat Exchanger
The log mean temperature difference ∆TLM is a function of the two unknown parameters, THout and TCout
∆T1 TCout( ) THin TCout−:=
∆T2 THout( ) THout TCin−:=
∆TLM TCout THout,( )∆T1 TCout( ) ∆T2 THout( )−
ln∆T1 TCout( )∆T2 THout( )
�
� �
:=
4. Energy Transfer across Hot and Cold Streams
The energy loss across the hot stream is a function of THout and is given by
∆QH THout( ) MH CpH⋅ THin THout−( )⋅:=
The energy gain across the cold stream is inferred via
(i) The energy transferred across the heat exchanger...
∆QC TCout THout,( ) U A⋅ ∆TLM TCout THout,( )⋅:=
(ii) ...which will be equal to the energy gain by the cold stream
∆EC TCout( ) MC CpC⋅ TCout TCin−( )⋅:=
4. Solution of the Implicitly Defined Equations
The series of implicitly defined equations described above will be solved for TCout and THout.
Guess values TCout 300K:=
THout 300K:=
Given ∆QH THout( ) ∆QC TCout THout,( )
∆QC TCout THout,( ) ∆EC TCout( ) TCout
THout
�
� �
Find TCout THout,( ):=
Hence TCout 335.3K= and THout 347.3K=
�������������������� &�
Equilibrium Stages Required to Separate a Propane/Pentane Mixture
1. Introduction
A propane-pentane feed at 10 bar is to be separated in a multistage distillation unit to a required purity of both components. This worksheet will calculate the required number of theoretical stages required. Data describing propane-pentane equilibrium composition is supplied.
2. Equilibrium Data and Required Purity
The following data gives the mole fraction of propane in the liquid and vapour phases in a propane/pentane mixture at equilibrium at 10 bar.
xPropLiq
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
�
� �
:= xPropVap
0
0.32
0.56
0.71
0.81
0.87
0.91
0.94
0.96
0.98
1
�
� �
:=
Required purity of pentane liq_pent_req 95%:=
Required purity of propane vap_prop_req 90%:=
Hence the purity of propane is liq_prop_req 100% liq_pent_req−:=
3. Functions Describing the Equilibrium Line
This is a continuous function which describes the equilibrium line
g x( ) interp cspline xPropLiq xPropVap,( ) xPropLiq, xPropVap, x,( ):=
�������������������� '�
4. Required Operating Points
The following function steps of the number of stages required given a function g that describes the equilibrium line
MC g( ) xguess 0←
X0 vap_prop_req←
Y0 vap_prop_req←
X1 root g xguess( ) Y0− xguess,( )←
Y1 Y0←
i 3←
Xi 1− Xi 2−←
Yi 1− Xi 1−←
Xi root g xguess( ) Yi 1−− xguess,( )←
Yi Yi 1−←
i i 2+←
Xi 2− liq_prop_req>while
Xi 1− Xi 2−←
Yi 1− Xi 2−←
augment X Y,( )return
:=
�������������������� �(�
5. Results
The number of equilibrium stages required is stages floorrows MC g( )( )
2�
� �
:=
stages 4=
x 0 0.01, 1..:=
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Propane-Pentane Equilibrium @ 10 bar
Mole Fraction of Propane in Liquid Phase
Mol
e Fr
actio
n of
Pro
pane
in V
apou
rPha
se
The efficiency of real stages will be about 0.5-0.7. Hence the actual required number of
stages is about stages
0.58= .
�������������������� ���
Fitting Experimental Data to the Antoine Equation
1. Introduction
The Antoine equation describes the relationship between the vapour pressure P and temperature T of a liquid.
P 10A
B
T C+−
=
This worksheet calculates the empirical coefficients A, B and C for a given set of data.
2. Experimental Data
The following physical data is known.
T�
�
�
�
�
�
�
�
�
���
����
�����
����
���
��
��
��
����
���
:= P�
�
�
�
�
�
�
�
�
�
�
��
��
��
��
���
���
���
���
:=
3. Calculation of the Antoine Coefficients
The following program returns a vector giving A, B and C.
Antoine T P,( ) i 0 rows T( ) 1−..←
c 0� � T←
c 1� � log P( )−←
ci 2, 1←
i 0 rows T( ) 1−..∈for
cT c⋅( ) 1−cT⋅ T log P( )⋅( )
→⋅
��
��0
cT c⋅( ) 1−cT⋅ T log P( )⋅( )
→⋅
��
��0 cT c⋅( ) 1−
cT⋅ T log P( )⋅( )→
⋅��
��1⋅ cT c⋅( ) 1−
cT⋅ T log P( )⋅( )→
⋅��
��2−
cT c⋅( ) 1−cT⋅ T log P( )⋅( )
→⋅
��
��1
��������
��������
:=
�������������������� � �
Hence for the data set above,
A
B
C
�
� �
Antoine T P,( ):=
A 4.968=
B 479.018=
C 137.216=
4. Comparison of Antoine Equation with Experimental Data
For the liquid described above, a function describing Antoine Equation can be defined.
PAntoine A B, C, T,( ) 10A
B
T C+−
:=
Define a range of temperatures over which to plot the Antoine Equation.
temp 50− 100..:=
60 40 20 0 20 40 60 80 1000
200
400
600
800
1000Experimental DataAntoine EquationExperimental DataAntoine Equation
Vapour Pressure (mm Hg)
Tem
pera
ture
(C
)
�������������������� �!�
Flowrate between Two Reservoirs
1. Introduction
A pump transfers from one reservoir to another reservoir according to the schematic below. Check valves are placed either side of the pump and experimental head/flowrate data for the pump is available.
2. Physical Parameters
The following physical parameters are known.
Pipe Lengths L1 50m:= L2 150m:=
Pipe Diameters D1 10cm:= D2 30cm:=
Pipe Roughness e 0.001m:=
Cross Sectional Areas A1
πD12
4:= A2
π D22⋅
4:=
Frictional Loss Coefficients Check Value Kcheck 3:=
Exit Kexit 1:=
Entrance Kent 0.5:=
Elevations z1 10m:= z2 35m:=
Liquid Viscosity µ 103−Pa s⋅:=
Liquid Density ρ 1000kg m3−⋅:=
�������������������� �"�
The following experimental data describe the flowrate-head relationship for the pump.
flowrate
0
1000
2000
3000
3500
4000
�
� �
gpm:= head
230
228.5
221
200.5
183.5
157
�
� �
ft:=
3. Generating the Pump Curve from Experimental Data
A continuous function that describes the head-flowrate for the pump is formed by fitting a spline to the experimental data.
Headpump Q( ) interp cspline flowrate head,( ) flowrate, head, Q,( ):=
4. The Reynolds Number
The function describing the Reynolds number will be a function of both the liquid velocity and pipe diameter.
Re V D,( )D V⋅ ρ⋅
µ:=
5. The Friction Factor
We will create a function to calculate the friction factor given the pipe roughness and the instantaneous value of the Reynolds Number. The following structure iteratively solves the Colebrook equation to calculate the friction factor in turbulent flow. Mathcad require a "guess" value of the friction factor to kick-start the numerical algorithms.
Guess value fturb 0.1:=
Given
1
fturb2− log
ε3.7
2.51
Re fturb⋅+
�
� �
⋅
f_turb Re ε,( ) Find fturb( ):=
The function to calculate the friction factor in laminar flow is far simpler.
f_lam Re( )64
Re:=
The following function evaluates the turbulent friction factor if Re is above 2300, or the laminar friction factor at all other points
friction Re ε,( ) f_turb Re ε,( ) Re 2300>if
f_lam Re( ) otherwise
:=
�������������������� �#�
6. The System Curve
The diameter of the piping is not constant. Hence the frictional losses will be written in terms of the volumetric flowrate, Q.
Major Losses
hL Q( ) friction ReQ
A2D2,
�
� �
e
D2,
�
� �
L2
D2⋅
Q
A2
�
� �
2
2 g⋅⋅
friction ReQ
A1D1,
�
� �
e
D1,
�
� �
L1
D1⋅
Q
A1
�
� �
2
2 g⋅⋅+
...:=
Minor Losses
K1 Kcheck Kent+:= K2 Kcheck Kexit+:=
K1 3.5= K2 4=
h1 Q( ) K1
Q
A1
�
� �
2
2g⋅:= h2 Q( ) K2
Q
A2
�
� �
2
2g⋅:=
Hence the full system curve is
Headsys Q( ) z2 z1− hL Q( )+ h1 Q( )+ h2 Q( )+:=
7. Intersection of the System Curve and the Pump Curve
The operating point will be calculated by solving for the flowrate at which the Pump and System curves intersect.
Guess value of the flowrate Q 1000gpm:=
Given
Headpump Q( ) Headsys Q( )
Qop Find Q( ):=
Hence the operating point is
Qop 0.049m
3
s=
�������������������� �$�
The intersection of the Pump and System curves can be shown graphically by plotting both curves.
Values of flowrate over which to plot the graph Q 0gpm 10gpm, 4000gpm..:=
0 1000 2000 3000 40000
100
200
300
400System CurvePump CurveSystem CurvePump Curve
Qop
gpm
�������������������� �%�
Pressure Loss and Liquid Flow through Pipe Networks
1. Introduction
A storage tank with water at a constant height feeds a piping system as shown in the diagram below. This worksheet will calculate the flowrate and the frictional pressure loss in the piping system.
2. Physical Parameters
Water density ρ 1000 kg⋅ m3−⋅:=
Water viscosity µ 103−Pa s⋅:=
Pipe diameter D 0.9in:=
Equivalent lengths Lvalve 150D:= Lelbow 20D:=
Pipe lengths L1 20ft:= L2 500ft:=
Pipe relative roughness e 0.003:=
Entrance loss coefficient Kent 0.5:=
Elevations z1 L1 2m+:= z2 0m:=
�������������������� �&�
3. Friction Factor
We will create a function to calculate the friction factor given the pipe roughness and the instantaneous of the Reynolds Number.
The following structure iteratively solves the Colebrook equation to calculate the friction factor in turbulent flow.
Guess value fturb 0.1:=
Given
1
fturb2− log
e
3.7
2.51
Re fturb⋅+
�
� �
⋅
f_turb Re e,( ) Find fturb( ):=
The function to calculate the friction factor in laminar flow is far simpler.
f_lam Re( )64
Re:=
The following function evaluates the turbulent friction factor if Re is above 2300, or the laminar friction factor at all other points
friction Re e,( ) f_turb Re e,( ) Re 2300>if
f_lam Re( ) otherwise
:=
4. Reynolds Number
Re V( )D V⋅ ρ⋅
µ:=
5. Calculating Liquid Velocity in the Pipe from the Bernoulli Equation
The liquid velocity V in the pipe is given by an iterative solution of the Bernoulli Equation
Guess value of velocity V 1m s1−⋅:=
Given
g z1⋅ friction Re V( ) e,( )L1 L2+ Lvalve+ Lelbow+
D
�
� �
⋅V
2
2Kent
V2
2⋅+ g z2⋅+
1
2V
2⋅+
V Find V( ):=
V 0.838m s-1⋅=
�������������������� �'�
Hence the flowrate is
Qπ D
2⋅4
V⋅:=
Q 3.438 104−×
m3
s=
The frictional pressure loss in the system is
∆p ρ g⋅ friction Re V( ) e,( )L1 L2+ Lvalve+ Lelbow+
D
�
� �
⋅ Kent+���
���
⋅V
2
2 g⋅⋅:=
∆p 7.904 104× Pa=
�������������������� (�
Liquid Flow through a Pump
1. Introduction
A pipe receives water from a centrifugal pump. This worksheet will calculate the flowrate through the pipe.
2. Physical Parameters
The following physical parameters are known.
Water viscosity µ 103−
Pa⋅ s⋅:=
Water density ρ 1000kg m3−⋅:=
Diameter of pipe D 2.5in:=
Pipe roughness e 0.005:=
Length of pipe L 1500ft:=
Gravitational constant
g 9.81m s2−⋅:=
�������������������� ��
3. Head Curve of Pump
The following function is an empirical correlation describing the various of head with flowrate for the pump. Note the dimensions on the constant parameters are to make the equation dimensionally consistent.
H Q( ) 20ft 5 103−⋅
ft
gal min1−⋅( )2
⋅ Q2⋅−:=
4. Reynolds Number
Re V( )D V⋅ ρ⋅
µ:=
5. Continuity Equation
Q V( )π D
2⋅4
V⋅:=
6. Friction Factor
We will create a function to calculate the friction factor given the pipe roughness and the instantaneous of the Reynolds Number.
The following structure iteratively solves the Colebrook equation to calculate the friction factor in turbulent flow.
Guess value fturb 0.1:=
Given
1
fturb2− log
e
3.7
2.51
Re fturb⋅+
�
� �
⋅
f_turb Re e,( ) Find fturb( ):=
The function to calculate the friction factor in laminar flow is far simpler.
f_lam Re( )64
Re:=
. The following function evaluates the turbulent friction factor if Re is above 2300, or the laminar friction factor at all other points.
friction Re e,( ) f_turb Re e,( ) Re 2300>if
f_lam Re( ) otherwise
:=
�������������������� �
7. Calculating the Liquid Velocity in the Pipe.
The liquid velocity is found by iteratively finding the point at which the pump head balances the frictional losses in the pipe.
Guess value of the liquid velocity V 1m s1−⋅:=
Given
g H Q V( )( )⋅ friction Re V( ) e,( )L
D⋅
V2
2⋅
V Find V( ):=
V 0.621m s-1⋅=
�������������������� !�
Heat Transfer Coefficient for Pool Boiling of Water
1. Introduction
This worksheet will calculate the heat transfer coefficient for the pool boiling of water from a surface using the Forster and Zuber (1955) correlation
2. Physical Parameters
All liquid properties are taken at a temperature of 121C and a pressure of 2.1 bar
Liquid density ρL 941.6kg m 3−⋅:=
Vapour density ρV 1.18kg m 3−⋅:=
Specific heat capacity of liquid CpL 4.25 103⋅ J kg 1−⋅ K 1−⋅:=
Thermal conductivity of liquid kL 687 10 3−⋅ W m 2−⋅ K 1−⋅:=
Liquid viscosity µL 230 10 6−⋅ N s⋅ m 2−⋅:=
Surface tension σ 55 10 3−⋅ N m 1−⋅:=
Latent heat of vapourisation λ 2198 103⋅ J kg 1−⋅:=
Ts 394K:= Saturation temp
Wall Temperature Tw 398.15K:=
Saturation pressure at temperature Tw pw 2.321 105⋅ N m 2−⋅:=
Saturation pressure at temperature TS ps 2.1 105⋅ N m 2−⋅:=
�������������������� "�
3. Heat Transfer Coefficient
The pool boiling heat transfer coefficient is given by the Foster and Zuber (1955) correlation.
hnb 0.00122
kL
W m 2−⋅ K 1−⋅
�
� �
0.79 CpL
J kg 1−⋅ K 1−⋅
�
� �
0.45
⋅ρL
kg m 3−⋅
�
� �
0.49
⋅
σ
N m 1−⋅
�
� �
0.5 µL
N s⋅ m 2−⋅
�
� �
0.29
⋅λ
J kg 1−⋅
�
� �
0.24
⋅ρV
kg m 3−⋅
�
� �
0.24
⋅
��������
��������
⋅Tw
K
Ts
K−
�
� �
0.24
⋅pw
N m 2−⋅
ps
N m 2−⋅−
�
� �
0.75
⋅W
m2K⋅:=
hnb 3.979 103× W m 2−⋅ K 1−=
�������������������� #�
Binary Distillation with the McCabe-Thiele Method
1. Introduction
A propane-pentane feed at 10 bar is to be separated in a multistage distillation unit to a required purity of both components. This worksheet will calculate the required number of theoretical stages required. Data describing propane-pentane equilibrium composition is supplied.
2. Equilibrium Data and Required Purity
The following data gives the mole fraction of propane in the liquid and vapour phases in a propane/pentane mixture at equilibrium at 10 bar.
xPropLiq
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
�
� �
:= xPropVap
0
0.32
0.56
0.71
0.81
0.87
0.91
0.94
0.96
0.98
1
�
� �
:=
Required purity of propane in distillate
xD 90%:=
Required purity of propane in bottoms
xB 15%:=
Fraction of Propane in Feed xF 50%:=
q value q 1.2:=
Reflux ratio R 2:=
�������������������� $�
3. The Equilibrium Line
This is a continuous function which describes the equilibrium line
g x( ) interp cspline xPropLiq xPropVap,( ) xPropLiq, xPropVap, x,( ):=
4. The Top and Bottom Operating Lines and the q-Line
q-line qline x( ) xq
q 1−⋅
xF
q 1−−:=
Top operating line top_op x( ) xR
1 R+⋅
xD
1 R++:=
Bottom operating line bottom_op x( ) xR xF xB−( )⋅ q xD xB−( )⋅+
q xD xB−( )⋅ R xF xB−( )⋅+ xD− xF+⋅
xB xF xD−( )⋅
q xD xB−( )⋅ R xF xB−( )⋅+ xD− xF++
...:=
Hence a function can be defined that described the combined operating line
operating_line x( ) bottom_op x( ) xxD q 1−( )⋅ xF R 1+( )⋅+
q R+<if
top_op x( ) otherwise
:=
�������������������� %�
5. Required Theoretical Stages
The following function steps off the required number of stages given a function f that describes the operating line and a function g that describes the equilibrium line
MC f g,( ) xguess 0←
X0 xD←
Y0 xD←
X1 root g xguess( ) Y0− xguess,( )←
Y1 Y0←
i 3←
Xi 1− Xi 2−←
Yi 1− f Xi 1−( )←
Xi root g xguess( ) Yi 1−− xguess,( )←
Yi Yi 1−←
i i 2+←
Xi 2− xB>while
Xi 1− Xi 2−←
Yi 1− Xi 2−←
augment X Y,( )return
:=
�������������������� &�
6. Results
x 0 0.001, 1..:=
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Propane-Pentane Equilibrium @ 10 bar
Mole Fraction of Propane in Liquid Phase
Mol
e Fr
actio
n of
Pro
pane
in V
apou
r Pha
sexB xD
The required number of stages is stages floorrows MC operating_line g,( ) 1� �( )
2
�
� �
:=
stages 3=
The efficiency of real stages will be about 0.5-0.7. Hence the actual required number of
stages is about stages
0.56= .
�������������������� '�
Pressure Drop through a Venturi Meter
1. Introduction
Water flows through a Venturi flow meter. This worksheet will calculate the pressure drop.
2. Physical Parameters
The following physical parameters are known
Volumetric flowrate Q 20 liter⋅ s1−⋅:=
Density of water ρ 10000 kg⋅ m3−⋅:=
Diameter of inlet Dinlet 10cm:=
Diameter of throat Dthroat 5cm:=
3. Velocity at Inlet and Throat
Cross-sectional area of inlet Ainletπ Dinlet
2⋅
4:= Ainlet 7.854 10
3−× m2=
Cross-sectional area of throat Athroatπ Dthroat
2⋅
4:= Athroat 1.963 10
3−× m2=
Velocity at inlet VinletQ
Ainlet:= Vinlet 2.546m s
-1⋅=
Velocity at throat VthroatQ
Athroat:= Vthroat 10.186m s
-1⋅=
4. Pressure Drop
Hence the pressure drop can be calculated by applying the Bernoulli equation.
∆P ρVthroat
2Vinlet
2−
2⋅:=
∆P 4.863 105× Pa=
�������������������� !(�
Pressure Drop through a Pipe of a Power Law Fluid
1. Introduction
A power law fluid (for which rheological data is available) is to be pumped through a pipe. This worksheet will calculate the maximum flowrate and the associated pressure drop if the flow is to be kept laminar.
2. Physical Parameters
The following physical parameters are known
Liquid Density ρ 1253 kg⋅ m3−⋅:=
Pipe Diameter D 0.10 m⋅:= Pipe Length L 200m:=
The following rheological describes the wall stress τw of the liquid at the corresponding shear rate γ.
τw
11.0
12.9
20.3
22.1
29.4
45.7
54.1
82.3
93.6
156.5
163.9
273
294.7
432.2
597.1
�
� �
:= γ
162.4
231.7
412.2
463.9
687.8
1023.3
1836.5
3003.9
4388.6
8127.0
10944.6
24837.6
23230.3
51548.2
89099.5
�
� �
:=
�������������������� !��
3. Power Law Parameters
A Power Law fluid is described by the following constitutive equation
τw K γn
⋅
Hence a graph of τw against γ on log-log axes for the above liquid will be a straight line.
100 1 .103 1 .104 1 .10510
100
1 .103Wall Stress Against Shear Rate
τw
N m 2−⋅
γ
s 1−
The values of n and K are hence
n slope logγ
SIUnitsOf γ( )�
� �
logτw
SIUnitsOf τw( )�
� �
,�
� �
:= n 0.638=
K 10
intercept logγ
SIUnitsOf γ( )�
� �
logτw
SIUnitsOf τw( )�
� �
,�
� �:= K 0.451=
3. Maximum Reynolds Number for Laminar Flow
An estimate for the maximum Reynolds Number for laminar flow of a Power Law fluid is
Re6464 n⋅ n 2+( )
n 2+
n 1+⋅
1 3 n⋅+( )2
:= Re 2.316 103×=
�������������������� ! �
4. Maximum Allowable Velocity
The generalised Reynolds Number is
ReD
nV
2 n−⋅ ρ⋅
8n 1−
K⋅=
Mathcad 13 does not allow dimensioned quantities to be raised to a power that is a non-integer multiple of 60. Hence D, V and ρ are replaced by their magnitude.
Re
D
m�
� �
nV
m s1−⋅
�
� �
2 n−⋅
ρ
kg m3−⋅
⋅
8n 1−
K⋅=
The maximum allowable fluid velocity and flowrate are hence
VRe 8
n 1−⋅ K⋅
D
m�
� �
n ρ
kg m3−⋅
⋅
������
������
1
2 n−
m⋅ s1−⋅:=
V 1.48 m s-1⋅=
Qπ4
D2⋅ V⋅:= Q 0.012m
3s-1⋅=
5. Pressure Drop
The pressure drop is hence
∆p
4L
m⋅ K⋅
D
m
8Q
m3
s1−
⋅
πD
m�
� �
3⋅
3 n⋅ 1+n
�
� �
⋅
������
������
n
Pa⋅:= ∆p 82528Pa=
It is good practise to check that the operating conditions fall within those of the rheological experimental data.
τwD ∆p⋅4 L⋅
:= τw 10.3N m2−⋅=
�������������������� !!�
6. References
Ryan, N.W., Johnson, M.M. Transition from laminar to turbulent flow in pipes. AIChEJ, 5 , 433-435, 1959.
Metzner, A.B.Reed, J.C. Flow of non-Newtonian fluids - correlation of the laminar, transition and turbulent flow regions. AIChEJ, 1(4), 434-440,
�������������������� !"�
Liquid Flow through Pumps in Parallel
1. Introduction
Two pumps in parallel pump water from a reservoir according to the schematic below. Experimental data describing the head/flowrate relationship for each pump is available. This worksheet will calculate the flowrate at the exit piping.
2. Physical Parameters
Pipe Dimensions L1 100ft:= D1 5in:= A1π D1
2⋅
4:=
L2 1800ft:= D2 9in:= A2π D2
2⋅
4:=
Pipe Roughness e 0.01mm:=
Liquid Density ρ 1000kg m3−⋅:=
Liquid Viscosity µ 103−Pa s⋅:=
�������������������� !#�
Experimental head/flowrate data for each pump
flowrate
250
500
750
1000
1250
1500
1750
2000
�
� �
galUK
min:= headA
224
220
215
207
200
190
177
162
�
� �
ft:= headB
199
195
189
182
175
165
151
131
�
� �
ft:=
3. The Reynolds Number
The Reynolds number is a function of both the liquid velocity and pipe diameter.
Re V D,( )D V⋅ ρ⋅
µ:=
4. The Friction Factor
The Colebrook Equation is used to calculate the friction factor in turbulent flow.
Guess value fturb 0.1:=
Given
1
fturb2− log
e
3.7
2.51
Re fturb⋅+
�
� �
⋅
f_turb Re e,( ) Find fturb( ):=
The function to calculate the friction factor in laminar flow is far simpler.
f_lam Re( )64
Re:=
The following function evaluates the turbulent friction factor if Re is above 2300, or the laminar friction factor at all other points.
friction Re e,( ) f_turb Re e,( ) Re 2300>if
f_lam Re( ) otherwise
:=
�������������������� !$�
4. Frictional Suction and Discharge Losses in Parallel Piping
The frictional losses for the parallel suction and discharge piping for both pumps is of the form
hfric Q( ) friction ReQ
A1D1,
�
� �
e
D1,
�
� �
L1
D1⋅
Q
A1
�
� �
2
2g⋅:=
5. Modified Pump Head Curve and Flow through Each Leg
Modified head/flowrate curves for both pumps can be formed by fitting the experimental flowrate/head data to a curve of the form H(Q)=a - bQ2 and then subtracting the frictional losses in the suction and discharge piping
F Q( )1
Q2−
�
� �
:=
a1
b1
�
� �
linfitflowrate
m3
s1−
headA
m, F,
�
� �
:=
a2
b2
�
� �
linfitflowrate
m3
s1−
headB
m, F,
�
� �
:=
a1 a1 m⋅:= a2 a2 m⋅:= b1 b1 s2⋅ m
5−⋅:= b2 b2 s2⋅ m
5−⋅:=
headA Q( ) a1 b1 Q2⋅−:=
headB Q( ) a2 b2 Q2⋅−:=
Remove the friction losses in the suction and discharge piping
headA Q( ) a1 b1 Q2⋅− hfric Q( )−:=
headB Q( ) a2 b2 Q2⋅− hfric Q( )−:=
�������������������� !%�
The flowrate in each leg of the parallel piping system can now be found. The head in both legs of the parallel piping system is the same. Hence the head of the composite system is headT = headA = headB Additionally the total flowrate is equivalent to the sum of the flowrates in both legs of the parallel piping system, QT = QA + QB
Guess value QA 2000galUK min1−⋅:=
Hence the flowrate in leg A is... QlegA QT( ) root headA QA( ) headB QT QA−( )− QA,( ):=
... and the flowrate in leg B is... QlegB QT( ) QT QlegA QT( )−:=
...while the head of the composite system is headT QT( ) headA QlegA QT( )( ):=
The system can now be visualised like so
7. System Curve
The System Curve consists purely of the frictional losses over L2.
headsys Q( ) friction ReQ
A2D2,
�
� �
e
D2,
�
� �
L2
D2⋅
Q
A2
�
� �
2
2g⋅:=
�������������������� !&�
8. Intersection of the Combined Pump Curve and System Curve
The operating point can be calculated by find the point at which the Pump Curve and the System curve intersect.
Guess Value Q 1500galUK min1−⋅:=
Qop root headsys Q( ) headT Q( )− Q,( ):=
Hence the operating point is Qop 2.883 103× galUK min
1−⋅=
The following graphs show the intersection of the combined pump curve and system curve
Q 250galUK min1−⋅ 300galUK min
1−⋅, 2000galUK min1−⋅..:=
QT 1200galUK min1−⋅ 1500galUK min
1−⋅, 4000galUK min1−⋅..:=
1000 1500 2000 2500 3000 3500 40000
50
100
150
200
250
System CurveCombined Pump CurveSystem CurveCombined Pump Curve
Intersection of Pump and System Curves
Head (ft)
Tot
al F
low
rate
(gpm
)
Qop
galUK min 1−⋅
The following graph shows the individual and combined pump curves.
�������������������� !'�
0 500 1000 1500 2000 2500 3000 3500 400050
100
150
200
250Characteristic Curve for Pump 1Characteristic Curve for Pump 2Combined Characteristic Curve
Characteristic Curve for Pump 1Characteristic Curve for Pump 2Combined Characteristic Curve
Pump Characteristic Curves
Flowrate (gpm)
Hea
d (f
t)
�������������������� "(�
Model of a Single-Component Vaporiser
1. Introduction
This worksheet develops a simple model of a single-component vaporiser via a heat and mass balance. The governing differential equations are then solved numerically.
2. Physical Parameters
The following physical parameters are known.
Boiling point of liquid at 1 bar Tboil 360:= K
Specific heat capacity Cp 95:= J mol1−⋅ K
1−⋅
Latent heat (via Trouton's rule) λ Tboil 92⋅:= J mol1−⋅
Flowrate into vaporiser F 0.49:= mol s1−⋅
Temperature of feed Tfeed 300:= K
Valve constant kv 0.1:=
Heat input to boiler Q 23500:= W
Initial temperature of vapouriser
Tinitial 370:= K
Initial quantity of fluid in vapouriser
Minitial 2:= mol
Initial total energy of fluid in vaporiser
Uinitial Cp Minitial⋅ Tinitial⋅:=
�������������������� "��
3. Governing Equations
The following equations are obtained from a heat and mass balance.
Mass Balance tM t( )d
dF V t( )−= (1)
Heat Balance tU t( )d
dTfeed Cp⋅ F⋅ hvap t( ) V t( )⋅− Q+= (2)
Pressure in vessel P t( ) e10 1
Tboil
T t( )−
�
� �
⋅= (3)
Rate of outflow V t( ) kv P t( ) 1.0−( )⋅= (4)
Temperature in vessel T t( )U t( )
M t( ) Cp⋅= (5)
Enthalpy of outlet vapour stream hvap t( ) Cp T t( )⋅ λ+= (6)
Substituting equations (3), (4), (5) and (6) into (1) and (2) gives the following differential equations in terms of M and U only
tM t( )d
dF kv e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅−=
tU t( )d
dTfeed Cp⋅ F⋅
U t( )
M t( )λ+
�� �
kv⋅ e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅− Q+=
�������������������� " �
4. Numerical Solution of the Governing Equations
The differential equations can be solved easily using Mathcad's numerical routines.
Terminal point of numerical integration tfinal 10:=
Given
tM t( )d
dF kv e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅−
tU t( )d
dTfeed Cp⋅ F⋅
U t( )
M t( )λ+
�� �
kv⋅ e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅− Q+
U 0( ) Uinitial
M 0( ) Minitial
U
M�
� �
OdesolveU
M�
� �
t, tfinal,���
���
:=
4. Results
The temperature is defined by the following function.
T t( )U t( )
M t( ) Cp⋅:=
t 0 0.01, tfinal..:=
0 2 4 6 8 101.9
2
2.1
2.2
2.3
350
400
Amount of Fluid in VaporiserTemperature in VaporiserAmount of Fluid in VaporiserTemperature in Vaporiser
Time (s)
Mas
s (m
ol)
Tem
pera
ture
(K)
�������������������� "!�
Model of a Single-Component Vaporiser under PI Control
1. Introduction
This worksheet develops a simple model of a single-component vaporiser via a heat and mass balance. The vaporiser maintains a constant temperature of liquid via PI control that modifies the heat. The governing differential equations are solved numerically.
2. Physical Parameters
The following physical parameters are known.
Boiling point of liquid at 1 bar Tboil 360:= K
Specific heat capacity Cp 95:= J mol1−⋅ K
1−⋅
Latent heat (via Trouton's rule) λ Tboil 92⋅:= J mol1−⋅
Flowrate into vaporiser F 0.49:= mol s1−⋅
Temperature of feed Tfeed 300:= K
Valve constant kv 0.1:=
Heat input to boiler Q 23500:= W
Initial temperature of vapouriser
Tinitial 370:= K
Initial quantity of fluid in vapouriser
Minitial 400:= mol
Initial total energy of fluid in vaporiser
Uinitial Cp Minitial⋅ Tinitial⋅:=
�������������������� ""�
Temperature Set Point Tset 437:=
Proportional gain KP 10:=
Integral time constant KI 1:=
3. Model of the Vaporiser
The following equations are obtained from a heat and mass balance.
Mass Balance tM t( )d
dF V t( )−= (1)
Heat Balance tU t( )d
dTfeed Cp⋅ F⋅ hvap t( ) V t( )⋅− Q+= (2)
Pressure in vessel P t( ) e10 1
Tboil
T t( )−
�
� �
⋅= (3)
Rate of outflow V t( ) kv P t( ) 1.0−( )⋅= (4)
Temperature in vessel T t( )U t( )
M t( ) Cp⋅= (5)
Enthalpy of outlet vapour stream hvap t( ) Cp T t( )⋅ λ+= (6)
Substituting equations (3), (4), (5) and (6) into (1) and (2) gives the following differential equations in terms of M and U only.
tM t( )d
dF kv e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅−=
tU t( )d
dTfeed Cp⋅ F⋅
U t( )
M t( )λ+
�� �
kv⋅ e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅− Q+=
�������������������� "#�
3. Model of the PI Controller
The heat supplied to the vaporiser Q is under PI control. Hence,
Q KP TsU t( )
M t( ) Cp⋅− KI errsum t( )⋅+
�� �
⋅=
where
terrsum t( )d
dTs
U t( )
M t( ) Cp⋅−=
4. Numerical Solution of the Governing Equations
The differential equations can be solved easily using Mathcad's numerical routines.
Terminal point of numerical integration
tfinal 1000:=
Given
tM t( )d
dF kv e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅−
tU t( )d
dTfeed Cp⋅ F⋅
U t( )
M t( )λ+
�� �
kv⋅ e
10 1TboilU t( )
M t( ) Cp⋅
−�
� �
⋅
1.0−
����
����⋅−
KP TsetU t( )
M t( ) Cp⋅− KI errsum t( )⋅+
�� �
⋅+
...
terrsum t( )d
dTset
U t( )
M t( ) Cp⋅−
errsum 0( ) 0
U 0( ) Uinitial
M 0( ) Minitial
U
M
errsum
�
� �
Odesolve
U
M
errsum
�
� �
t, tfinal,����
����
:=
�������������������� "$�
4. Results
The temperature in the vaporiser is defined by
T t( )U t( )
M t( ) Cp⋅:=
The following graph compares the dynamic change in temperature and amount of fluid inside the vaporiser.
t 0 0.01, tfinal..:=
0 200 400 600 800 1000390
400
410
420
430
440
360
380
400
420
440
460
480
Amount of Fluid in VaporiserTemperature in VaporiserAmount of Fluid in VaporiserTemperature in Vaporiser
Time (s)
Mas
s (m
ol)
Tem
pera
ture
(K)
�������������������� "%�
Calculating the Specific Enthalpy of Ethanol
1. Introduction
This worksheet will calculate the specific enthalpy of ethanol with respect to a reference temperature.
2. Physical Parameters
Latent heat of vapourisation λ 9.22kcal mol1−⋅:=
Boiling point of ethanol Tboil 351.55K⋅:=
Molecular weight of ethanol Methanol 46kg mol1−⋅:=
Temperature T 473.15K:=
Reference temperature Tref 273.15K:=
3. Specific Heat Capacities of Ethanol Liquid and Vapour
Cpliq T( ) 24.65 0.133T 273 K⋅−
K⋅+
�� �
cal⋅ mol1−⋅ K
1−⋅:=
Cpgas T( ) 14.66 3.758 103−⋅
T
K⋅+ 2.091 10
5−⋅T
K�
� �
2⋅− 4.740 10
9−⋅T
K�
� �
3⋅+
���
���
cal⋅ mol1−⋅ K
1−⋅:=
3. Specific Enthalpy of Ethanol
Hspec1
Methanol Tref
TboilTCpliq T( )
����
d λ+Tboil
TTCpgas T( )
����
d+�
� �
⋅:=
Hence the specific enthalpy of ethanol is Hspec 1.196 103× J kg
1−⋅=
�������������������� "&�
Heating an Oil Stream under PID Control
1. Introduction
A cold oil stream is being heated in a stirred tank. The dynamic change in temperature in the tank is modelled by an ordinary differential equation. The temperature of the liquid in the tank is driven to a set point via a PID controller, which alters the heat added to the system.
2. Physical Properties
Mass of Oil in Each Tank M 1000:= kg
Specific Heat Capacity of Oil Cp 2:= J kg-1 K-1
Oil Mass Flowrate W 100:= kg s-1
Initial Temperature of Cold Oil Tc 10:= C
Temperature Setpoint Tset 60:= C
Proportional Gain KP 10:=
Integral Gain KI 10:=
Derivative Gain KD 10:=
�������������������� "'�
3. Model of the PID Controller
The heat added to the system is modelled by the following PID control.
Proportional term Derivative term
Q KP Tset T t( )− KI0
ttTset T t( )−( )�
��
d⋅+ KD tTset T t( )−( )d
d⋅+
����
����
⋅=
Integral term
The integral term is change to derivative form by the following transformation.
terror_int t( )d
dTset T t( )−=
Hence the integral term can be rewritten as
KI0
ttTset T t( )−( )�
��
d⋅ KI error_int t( )⋅=
The derivate term is simplified to
KD tTset T t( )−( )d
d⋅ KD−
tT t( )d
d⋅=
4. Model of the Dynamic Change in Temperature in the Tank
An energy balance gives the following differential equation.
The transient change in energy in the tank
Energy supplied by PID Controller
M Cp⋅tT t( )d
d�
� �
⋅ W Cp⋅ Tc T t( )−( )⋅ Q+=
Energy supplied by the incoming stream
Substituting the equation describing the heat control gives
M Cp⋅tT1 t( )d
d⋅ W Cp⋅ Tc T1 t( )−( )⋅ KP Tset T t( )− KI error_int⋅+ KD t
T t( )dd
⋅−�
� �
⋅+=
�������������������� #(�
Rearranging this equation gives
tT t( )d
d
W Cp⋅ Tc⋅ W Cp⋅ T t( )⋅− Kp Tset⋅+ Kp T t( )⋅− Kp Ki⋅ error_int t( )⋅+ Kp Kd⋅ T t( )⋅−
M Cp⋅=
4. Numerical Solution of the Governing Equations
The governing equations are easily solved using Mathcad's flexible ordinary differential equations solve, Odesolve.
Terminal point of integration tfinal 50:=
Given
tT t( )d
d
W Cp⋅ Tc⋅ W Cp⋅ T t( )⋅− KP Tset⋅+ KP T t( )⋅− KP KI⋅ error_int t( )⋅+ KP KD⋅ T t( )⋅−
M Cp⋅
terror_int t( )d
dTset T t( )−
T 0( ) Tc
error_int 0( ) 0
T
error_int�
� �
OdesolveT
error_int�
� �
t, tfinal,���
���
:=
5. Results
t 0 0.1, tfinal..:=
0 5 10 15 20 25 30 35 40 45 500
20
40
60
80
Temperature of Liquid in TankSet pointTemperature of Liquid in TankSet point
Temperature (C)
Tim
e (s
)
�������������������� #��
The Transient Draining of Liquid from One Tank to Another with a Pump
1. Introduction
A pump drains liquid from one tank into another identical tank. It is positioned midway between each tank, connected by a pipe at the bottom of each tank. The flow is opposed by friction in the connecting pipe. This worksheet models the transient change in liquid height in each tank. It iteratively solves • The Colebrook equation to describe friction factor in turbulent flow, or the standard eqation that describes the friction factor in laminar flow. • The Bernoulli equation to find the fluid velocity, • The Pump Characteristic equation. i.e. a correlation describing head versus flowrate, • together with the Continuity equation and the Reynolds Number at every time step in the solution of the differential equations that describe the transient change in liquid height in both tanks.
�������������������� # �
2. Physical Parameters
The following physical parameters are known
Liquid Density ρ 1000kg m3−⋅:=
Liquid Viscosity µ 0.0001Pa s⋅:=
Pipe Relative Roughness e 0.0001:=
Length of pipe L 50m:=
Diameter of Pipe D 0.05m:=
Cross-section area of pipe Ad
π D2⋅
4:=
Ad 1.963 103−× m
2=
Cross-section area of tank
At 1m2:=
Gravitational Constant g 9.81m s2−⋅:=
Initial Height of Liquid in Tank 1
h1init 3m:=
Initial Height of Liquid in Tank 1
h2init 0m:=
3. Head Curve of Pump
The following function is an empirical correlation describing the various of head with flowrate for the pump. Note the dimensions on the constant parameters are to make the function dimensionally consistent.
H Q( ) 4m 8 103−⋅ m
5−
2s⋅
�
� �
2
⋅ Q2⋅−:=
4. Reynolds Number
The liquid velocity V is unknown. The Reynolds Number is hence defined as a function of V.
Re V( )D V⋅ ρ⋅
µ:=
5. Continuity Equation
The liquid velocity V is unknown. The Continuity equation is hence defined as a function of V.
Q V( ) Ad V⋅:=
�������������������� #!�
6. Friction Factor
We will create a function to calculate the friction factor given the pipe roughness and the instantaneous of the Reynolds Number.
The following structure iteratively solves the Colebrook equation to calculate the friction factor in turbulent flow.
Guess value fturb 0.1:=
Given
1
fturb2− log
e
3.7
2.51
Re fturb⋅+
�
� �
⋅
f_turb Re e,( ) Find fturb( ):=
The function to calculate the friction factor in laminar flow is far simpler.
f_lam Re( )64
Re:=
. The following function gives the turbulent friction factor if Re is above 2300, or the laminar friction factor at all other points.
friction Re e,( ) f_turb Re e,( ) Re 2300>if
f_lam Re( ) otherwise
:=
7. Calculating Liquid Velocity in the Pipe from the Bernoulli Equation
The instantaneous liquid velocity V is given by an iterative solution of the Bernoulli Equation.
Guess value of V V 0.01m s1−⋅:=
Given
h1 H Q V( )( )+ h2 friction Re V( ) e,( )2 L⋅D
⋅V
2
2 g⋅⋅+
V2
2g+
V h1 h2,( ) Find V( ):=
�������������������� #"�
8. Dynamic Change in Liquid Height in each Tank
The rate of change of liquid height in Tank 1 is th1 t( )d
dV h1 t( ) h2 t( ),( )−
Ad
At⋅=
However the sum of h1(t) and h2(t) is constant h1 t( ) h2 t( )+ h1init h2init+=
Hence... th1 t( )d
dV h1 t( ) h1init h2init+ h1 t( )−,( )−
Ad
At⋅=
This differential equation will be solved using a simple Euler method.
Time Step ∆t 25s:=
Liquid height in Tank 1 and 2 at t=0
h10 h1init:= h20 h2init:=
Total number of solution steps n 0 40..:=
Hence the dynamic liquid height in Tank 1 is given by... h1n 1+ h1n ∆t V h1n h1init h2init+ h1n−,( )−
Ad
At⋅
�
� �
⋅+:=
..with the dynamic liquid height in Tank 2 given by
h2n h1init h1n−:=
0 200 400 600 800 10000
1
2
3Tank 1Tank 2Tank 1Tank 2
Transient Change in Liquid Height
Liquid Height (m)
Tim
e (s
) h1n
h2n
n ∆t⋅
�������������������� ##�
9. Time Required to Drain Tank 1
The total time required to completely drain Tank 1 is hence
draining_timeAt
Ad0m
h1inith
1
V h h1init h−,( )����
d⋅:=
draining_time 1014.8s=
�������������������� #$�
Pressure Drop through a Pipe of a Two-Phase Fluid
1. Introduction
A mixture of gas and oil flow through a pipeline. This worksheet will use the Lockhart-Martinelli correlation to find the two-phase pressure gradient.
2. Physical Parameters
The following physical parameters are known.
Pipe relative roughness e 0.0001:=
Pipe diameter D 150mm:=
Liquid flowrate WL 20kg s1−⋅:=
Gas flowrate WG 2kg s1−⋅:=
Liquid viscosity µL 0.005Pa⋅ s⋅:=
Gas viscosity µG 1.35 105−⋅ Pa⋅ s⋅:=
Liquid density ρ L 710kg m3−⋅:=
Gas density ρ G 2.73kg m3−⋅:=
3. Mass Fluxes
Cross-sectional area of pipe A
π D2⋅
4:= A 0.018m
2=
Liquid mass flux GLWL
A:= GL 1131.8
kg
m2
s⋅=
Gas mass flux GGWG
A:= GG 113.2
kg
m2
s⋅=
4. Reynolds Numbers
Liquid Reynolds number ReLGL D⋅
µL:= ReL 3.395 10
4×=
Gas Reynolds number ReGGG D⋅
µG:= ReG 1.258 10
6×=
�������������������� #%�
5. Friction Factors
The individual liquid and gas friction factors are calculated with the Colebrook equation.
guess value fturb 0.01:=
Given 1
fturb2− log
e
3.7
2.51
Re fturb⋅+
�
� �
⋅
friction Re e,( ) Find fturb( ):=
Liquid friction factor fL friction ReL e,( ):= fL 0.023=
Gas friction factor fG friction ReG e,( ):= fG 0.013=
6. Individual Pressure Gradients
Liquid phase pressure gradient dPdLLfL
2
GL2
ρ L D⋅⋅:= dPdLL 138.932
Pa
m=
Gas phase pressure gradient dPdLGfG
2
GG2
ρ G D⋅⋅:= dPdLG 206.384
Pa
m=
7. Lockhart-Martinelli Factor and the Total Pressure Gradient
The two-phase multiplier will be calculated using the Lockhart-Martinelli paremeter and the correlations provided by Chisholm (1967).
Lockhart-Martinelli factor XttdPdLL
dPdLG:= Xtt 0.82=
Liquid two-phase multiplier
ΦL 1 18Xtt1−+ Xtt
2−+�
��
0.5:= ΦL 4.942=
Gas two-phase multiplier ΦG 1 18Xtt+ Xtt2+
���
0.5:= ΦG 4.055=
Hence the total pressure gradient is calculated using both the gas and liquid two-phase multipliers. They should both be the same.
Total pressure gradient dPdLT_L dPdLL ΦL2
⋅:= dPdLT_L 3.393 103×
Pa
m=
dPdLT_G dPdLG ΦG2
⋅:= dPdLT_G 3.393 103×
Pa
m=
�������������������� #&�
8. References
Chisholm, D., "A Theoretical Basis for the Lockhart-Martinelli Correlation for Two-Phase Flow", Int. J. Heat Mass Transfer, 10 (12), pp. 1767-1778
�������������������� #'�
Vapour/Liquid Equilibria of an Acetonitrile/Nitrobenzene Mixture
1. Introduction
This worksheet will calculate the bubble and dewpoint of two different acetonitrile/nitrobenzene mixtures.
2. Physical Parameters
Vapour pressure of acetonitrile p1 T( ) e
14.27242945.47K
T 49K−−
103Pa⋅:=
Vapour pressure of nitrobenzene p2 T( ) e
14.20432972.64K
T 64 K⋅−−
103Pa:=
3. Temperature given Composition of Liquid Phase and Pressure
Fraction of acetonitrile in liquid phase
x1 0.6:=
Fraction of nitrobenzene in liquid phase
x2 1 x1−:=
Pressure Ptotal 70 103Pa⋅:=
Function giving sum of partial pressures
P T x1, x2,( ) x1 p1 T( )⋅ x2 p2 T( )⋅+:=
Guess value T 200K:=
Given
P T x1, x2,( ) Ptotal
T Find T( ):=
T 349.4K=
�������������������� $(�
4. Dew Point and Composition of Liquid Phase Given Composition of Vapour Phase and Pressure
Fraction of acetonitrile in vapour phase
y1 0.6:=
Fraction of nitrobenzene in vapour phase
y2 1 y1−:=
Pressure Ptotal 70 103Pa⋅:=
Guess value T 400K:=
Given
y1 Ptotal⋅
p1 T( )
y2 Ptotal⋅
p2 T( )+ 1
T Find T( ):=
T 352.6K=
Hence the partial pressures are...
p1 T( ) 9.653 104× Pa= p2 T( ) 4.957 10
4× Pa=
...and the composition of the liquid phase is
x1 y1Ptotal
p1 T( )⋅:= x1 0.435=
x2 y2Ptotal
p2 T( )⋅:= x2 0.565=