You are on page 1of 13

1.

SOLUTION OF STIFF ORDINARY DIFFERENTIAL EQUATIONS


In biological process involves the growth of biomass from substrate in a batch process
the material balances on this batch process yield
𝑑𝐵 𝐾𝐵𝑆
=𝐾 (1)
𝑑𝑡 𝑚 +𝑆

𝑑𝑆 −0.75𝐾𝐵𝑆
= (2)
𝑑𝑡 𝐾𝑚 +𝑆

Where B and S are respective biomass and substrate concentration.


The reaction kinetics are such that K=0.3, Km=10-6 in consistent units.
a) Solve this set of differential equations starting at to=0 where S=5.0 and B=0.05 to a final
time given by tf=20.
b) Plot S and B with time for the conditions of (a).
2. METHOD OF LINES FOR PARTIAL DIFFERENTIAL EQUATIONS
Problem Statement:
Unsteady-state heat transfer in a slab in the x direction is described by the partial differential
equation
𝜕𝑇 𝜕2 𝑇
=𝛼 (1)
𝜕𝑡 𝜕𝑥 2

where T is the temperature in K, t is the time in s, and α is the thermal diffusivity in m 2/s
given by k/ρcp. In this treatment, the thermal conductivity k in W/m·K, the density ρ in
kg/m3, and the heat capacity cp in J/kg·K are all considered to be constant.
Consider that a slab of material with a thickness 1.00 m is supported on a non-conducting
insulation. This slab is shown in Figure 1. For a numerical problem solution, the slab is
divided into N sections with N + 1 node points. The slab is initially at a uniform temperature
of 100 °C. This gives the initial condition that all the internal node temperatures are known at
time t = 0.
Tn = 100 for n = 2 … (N + 1) at t = 0 (2)

If at time zero the exposed surface is suddenly held constant at a temperature of 0 °C, this
gives the boundary condition at node 1:
T1=0 for t ≥ 0 (3)
The other boundary condition is that the insulated boundary at node N + 1 allows no heat
conduction. Thus
𝜕𝑇𝑁+1
=0 for t ≥ 0 (4)
𝜕𝑥

Note that this problem is equivalent to having a slab of twice the thickness exposed to the
initial temperature on both faces.
Numerically solve Equation (1) with the initial and boundary conditions of (2), (3), and (4)
for the case where α = 2 × 10-5 m2/s and the slab surface is held constant at T1 = 0 °C. This
solution should utilize the numerical method of lines with N = 10 sections. Plot the
temperatures T2, T3, T4,…..,T10 as functions of time to 6000 s.
Additional information:
For this problem with N = 10 sections of length ∆x = 0.1 m, Equation (1) can be rewritten
using a central difference formula for the second derivative as
𝜕𝑇𝑁 𝑎
= (𝑇𝑛+1 − 2𝑇𝑛 + 𝑇𝑛−1 ) for (2 ≤ n ≤10) (5)
𝜕𝑡 ∆𝑥 2

The boundary condition represented by Equation (4) can be written using a second-order
backward finite difference as
𝜕𝑇11 3𝑇11 −4𝑇10 +𝑇9
= =0 (6)
𝜕𝑡 2∆𝑥

that can be solved for T11 to yield


4𝑇10 −𝑇9
𝑇11 = (7)
3

The problem then requires the solution of Equations (3), (5), and (7) which results in nine
simultaneous ordinary differential equations and two explicit algebraic equations for the 11
temperatures at the various nodes.
3. CALCULATION OF THE FLOW RATE IN A PIPELINE
Problem Statement

The Figure below shows a pipeline which delivers water at constant temperature T = 60 °F
from point 1 where the pressure is p1 = 150 psig and the elevation is z1 = 0 ft to point 2 where
the pressure is atmospheric and the elevation is z2 = 300 ft.

Calculate the flow velocity and flow rate for pipelines with effective length of L = 500, 1000,
… 10000 ft and made of nominal 4,5,6 and 8-inch schedule 40 commercial steel pipe. Use
the successive substitution method for solving the equations for the various cases and present
the results in tabular form. Prepare plots of flow velocity versus D and L and flow rate versus
D and L.

Equations and numerical data

The general mechanical energy balance on an incompressible liquid that applicable to this
case is the following
1 g P f Lv 2
 v 2  gz  c 2 F 0
2  D (A-1)
where v is flow velocity in ft/s, g is acceleration of gravity given by g = 32.174 ft/s , Δz =
2

z2-z1 is the difference in elevation (ft), gc is a conversion factor (in English units gc =32.174
ft.lbm/lbf.s2), ΔP = P2-P1 is the difference in pressure lbm/ft2), ρ is the fluid density (for water
at T = 60 °F), fF is the Fanning friction factor, L is the length of the pipe (ft) and D is the
inside diameter of the pipe (ft). To use the Successive Substitution method equation (A-1)
should be rewritten:
g P
gz  c

v (A-2)
fF L
0.5  2
D
The equation used for calculating the Fanning friction factor depends on the flow regime. The
flow regime is characterized by the Reynold's number Re. The Reynold's number is a
dimensionless number Re= vρD/μ where μ is the viscosity (for water at T = 60 °F, μ =
0.76×10-3 lbm/ft.s). For laminar flow (Re < 2100) the Fanning friction factor can be calculated
from the equation

16
fF  (A-3)
Re
For turbulent flow (Re > 2100) the Shacham equation can be used.

1
fF  2
(A-
   / D 5.02   / D 14.5  
16log   log    
  3.7 Re  3.7 Re  
4)

Where ε/D is the surface roughness of the pipe (ε = 0.00015 ft for commercial steel pipes).

The flow velocity in the pipeline can be converted to flow rate by multiplying it by the cross
section are of the pipe, thus q = vπD2/4 (ft3/s). The inside diameter (D) of commercial steel
pipes can be found, for example, in Table D-5 of the book by Cutlip and Shacham (1999). The
iteration function of the successive substitution method for calculation of the flow velocity is

vi 1  F (vi ) i  0, 1, (A-5)

where i is the iteration number, F is the function in the right side of Equation (A-2) and v0 is
an initial estimate for the flow velocity (use v0 = 10 ft/s ). Equation (A-6) provides an error
estimate at iteration i:

ˆi | vi  vi 1 | (A-6)

Additional information:

The flow velocity in the pipeline can be converted to flow rate by multiplying it by the cross
section are of the pipe, the density of water (7.481 gal/ft3), and factor (60 s/min). Thus q has
units of (gal/min). The inside diameters (D) of nominal 4, 5, 6 and 8-inch schedule 40
commercial steel pipes are 4.026 in, 5.047 in, 6.065 in and 7.981 in, respectively.
4. ISOTHERMAL COMPRESSION OF GAS USING REDLICH KWONG
EQUATION OF STATE
Carbon dioxide is being compressed isothermally at 50oC to 1/100th of its initial volume. The
initial pressure is 1.0 atm.
Calculate the work per g.mol of gas required using the ideal and non-ideal assumption of
employing R.K equation of state. Considering 1/10th change as an interval between the initial
and final volumes, calculate the ideal and non-ideal work done, Ideal and Non-Ideal
pressures, and Volumes at each interval and display them.

Equations and data:


The R-K equation is usually written (Cutlip and Shacham, 1999)
RT a
P 
V  b V (V  b) T
(1)
Where

 R 2Tc5 / 2 
a  0.42747 
 Pc  (2)

 RT 
b  0.08664 c 
 Pc  (3)
P = pressure in atm
V = molar volume in liters/g-mol
T =323.15(temperature in K)
R = gas constant (R = 0.08206 (atm·liter/g-mol·K))
Tc = 304.2(critical temperature in K)
Pc = 72.9(critical pressure in atm)
Additional information:
For a closed system in a reversible isothermal compression from V1 to V2. The work W done
on the system can be calculated from the ideal case equation
𝑑𝑊
= −𝑃 (4)
𝑑𝑉

For an ideal gas this equation can be integrated from V1 to V2


𝑉2
𝑊 = −𝑅𝑇 𝑙𝑛 (5)
𝑉1

For Non ideal case equation (4) should be numerically integrated using equation (1) to
calculate pressure as a function of volume. The initial volume should be calculated from R.K
equation of state by solving the non-linear equation for V1 of 1 atm and 50oC.
5. SOLVING DIFFERENTIAL ALGEBRAIC EQUATIONS
Problem Statement:
For a binary batch distillation process involving two components Benzene and toluene
designated 1 and 2, the moles of liquid remaining, L, as a function of the mole fraction of the
component 2, x2, can be expressed by the following equation
𝑑𝐿 𝐿
=
𝑑𝑥2 𝑥2 (𝑘2 − 1)
where k2 is the vapor liquid equilibrium ratio for component 2. If the system may be
considered ideal, the vapor liquid equilibrium ratio can be calculated from ki=Pi/P where Pi is
the vapour pressure of component i and P is the total pressure.
A common vapor pressure model is the Antoine equation which utilizes three parameters A,
B, and C for component i as given below where T is the temperature in °C.
𝐵
𝑃𝑖 = 10(𝐴−𝑇+𝐶)
The temperatures in the batch still follow the bubble point curve. The bubble point
temperature is defined by the implicit algebraic equation which can be written using the
vapor liquid equilibrium ratios as

𝑘1 𝑥1 + 𝑘2 𝑥2 = 1
The temperature controller is used to maintain the temperature of still at Bubble point. The
control action is given as a Differential equation
𝑑𝑇
= 𝐾𝑐 ∈
𝑑𝑥2
Where 𝐾𝑐 is the proportionality constant (= 0.5*106)
∈ is the error input to the control
∈ = 1 − 𝑘1 𝑥1 − 𝑘2 𝑥2
Consider a binary mixture of benzene (component 1) and toluene (component 2) which is to
be considered as ideal. The Antoine equation constants for benzene are A = 6.90565, B=
1211.033 and C = 220.79 & for toluene A = 6.95464, B= 1344.8 and C = 219.482. P is the
pressure in mmHg and the temperature in oC.
The batch distillation of benzene (component 1) and toluene (component 2) mixture is being
carried out at a pressure of 1.2 atm. Initially, there are 100 moles of liquid in the still,
comprised of 60% benzene and 40% toluene (mole fraction basis). Calculate the amount of
liquid remaining in the still when concentration of toluene reaches 80%. Also Plot the graph
showing the variation of liquid (in moles) with toluene (in mole fraction).
6. MOLAR VOLUME AND COMPRESSIBILITY FACTOR FROM
REDLICH-KWONG EQUATION
Problem Statement:

Using "Solution of Set of explicit equations" numerical method, Calculate the molar volume
and compressibility factor for ethylene (critical temperature, Tc =282.3 K, critical pressure, Pc
=50.4bar) at 298.15 K and 12 bar.
Equations and Numerical Data

The R-K equation is usually written (Y.V.C.Rao, 1997)

𝑹𝑻 𝒂
𝑷 = 𝑽−𝒃 − 𝑽(𝑽+𝒃) (1)

Where
𝟓
𝑹𝟐 𝑻𝒄 𝟐
𝒂 = 𝟎. 𝟒𝟐𝟕𝟒𝟖( 𝟏 ) (2)
𝑷𝒄 𝑻𝟐

 RT 
b  0.08664 c  (3)
 Pc 

P = pressure in bar

V = molar volume in cm3/g-mol

T = temperature in K

R = gas constant (R = 83.14 (cm3.bar/g-mol·K))

Tc = critical temperature in K

Pc = critical pressure in bar

Eliminating V from Eq.(1) and writing it as a cubic equation of the compressibility factor, z

yields

𝑓(𝑧) = 𝑧 3 − 𝑧 2 + 𝑞𝑧 + 𝑟 = 0 (4)

Where

𝑟 = −𝐴𝐵 (5)

𝑞 = 𝐴 − 𝐵 − 𝐵2 (6)

𝑎𝑃
𝐴 = (𝑅𝑇)2 (7)

𝑏𝑃
𝐵 = 𝑅𝑇 (8)
Equation (4) can be solved analytically for three roots. Some of these roots are complex.

Considering only the real roots, the sequence of calculations involves the following steps:

3 2
 f  g
C     (9)
 3 2

Where

1
𝑓 =𝑞−3 (10)

27𝑟+9𝑞−2
𝑔= (11)
27

If C>0 there is one real solution for z:

z  D  E  1/ 3 (12)

Where

D  (  g / 2  C )1 / 3 (13)

E  (  g / 2  C )1 / 3 (14)

If C<0 there are three real solutions

−𝑓 1
𝑍1 = 2 ∗ [ ∗ cos[𝜃⁄3] ] +
3 3

−𝑓 1
𝑍2 = 2 ∗ [ ∗ cos [2𝜋 + 𝜃⁄3] ] +
3 3

−𝑓 1
𝑍3 = 2 ∗ [ ∗ cos [4𝜋 + 𝜃⁄3] ] +
3 3

Where

𝒈𝟐 ⁄𝟒
𝜽 = 𝒄𝒐𝒔−𝟏 √
−𝒇𝟑 ⁄𝟐𝟕
7. ADIABATIC OPERATION OF A TUBULAR REACTOR FOR
CRACKING OF ACETONE
Problem Statement:
The irreversible, vapor-phase cracking of acetone (A) to ketone (B) and methane (C) that is
given by the following reaction is carried out adiabatically in a tubular reactor.
𝐶𝐻3 𝐶𝑂𝐶𝐻3 → 𝐶𝐻2 𝐶𝑂 + 𝐶𝐻4
The reaction is first order with respect to acetone and the specific reaction rate can be
expressed by
34222
ln 𝑘 = 34.34 −
𝑇
where k is in s-1 and T is in K. The acetone feed flow rate to the reactor is 8000 kg/hr, the
inlet temperature is T = 1150 K and the reactor operates at the constant pressure of P = 162
kPa (1.6 atm). The volume of the reactor is 4 m3.
Calculate the flow rates of acetone, ketone and methane along the reactor in and also plot the
flow rate and temperature versus volume of the reactor.
Equations and Numerical Data:
The material balance equations for the plug-flow reactor are given by
𝑑𝐹𝐴 𝑑𝐹𝐵 𝑑𝐹𝐶
= 𝑟𝐴 = −𝑟𝐴 = −𝑟𝐴
𝑑𝑉 𝑑𝑉 𝑑𝑉

where FA, FB and FC are flow rates of acetone, ketene and methane in g-mol/s, respectively
and rA is the reaction rate of A in g-mol/m3·s. The reaction is first order with respect to
acetone, thus
𝑟𝐴 = −𝑘𝐶𝐴
where CA is the concentration of acetone in g-mol/m3. For a gas phase reactor, using the
appropriate units of the gas constant, the concentration of the acetone in g-mol/m3 is obtained
by
1000𝑦𝐴 𝑃
𝐶𝐴 =
8.314𝑇
The mole fractions of the various components are given by
𝐹𝐴 𝐹𝐵 𝐹𝐶
𝑦𝐴 = 𝑦𝐵 = 𝑦𝑐 =
𝐹𝐴 +𝐹𝐵 +𝐹𝐶 𝐹𝐴 +𝐹𝐵 +𝐹𝐶 𝐹𝐴 +𝐹𝐵 +𝐹𝐶

The conversion of acetone can be calculated from


𝐹𝐴𝑂 − 𝐹𝐴
𝑥𝐴 =
𝐹𝐴𝑂
An enthalpy (energy) balance on a differential volume of the reactor yields
𝑑𝑇 −𝑟𝐴 (−∆𝐻)
=
𝑑𝑉 𝐹𝐴 𝐶𝑝𝐴 + 𝐹𝐵 𝐶𝑝𝐵 + 𝐹𝐶 𝐶𝑝𝐶

where ∆H is the heat of the reaction at temperature T (in J/g-mol) and CpA, CpB and CpC are
the molar heat capacities of acetone, ketene and methane (in J/g-mol´K) provides the
following equations for calculating the heat of reaction and the molar heat capacities.
∆𝐻 = 80770 + 6.8(𝑇 − 298) − 0.00575(𝑇 2 − 2982 ) − 1.27 ∗ 10−6 (𝑇 3 − 2983 )
𝐶𝑝𝐴 = 26.6 + 0.183𝑇 − 45.86 ∗ 10−6 𝑇 2

𝐶𝑝𝐵 = 20.04 + 0.0945𝑇 − 30.95 ∗ 10−6 𝑇 2

𝐶𝑝𝐶 = 13.39 + 0.077𝑇 − 18.71 ∗ 10−6 𝑇 2

𝐹𝐴𝑂 = 10
8. VARIATION OF COMPRESSIBILITY FACTOR USING VAN DER
WAALS EQUATION OF STATE

Problem statement:
Calculate and Plot the compressibility factor (Z) for CO2 gas at a critical temperature of
304.2K under a critical pressure of 73.83 bar over a reduced pressure range of 0.1 ≤ Pr ≤ 10
for different reduced temperatures of Tr = 1.1, 1.3 and 2.0 using Van der waals equation of
state using the solution of a polynomial equation.

Van der waals equation of state:


Van der waals equation of state is given as
𝑅𝑇 𝑎
𝑃= − 2
𝑉−𝑏 𝑉
Where, P is the pressure, V is the molar volume, R is the universal gas constant
a and b are constants given by the equations as follows:
27 𝑅 2 𝑇𝑐2 𝑅𝑇
𝑎= ( ) and 𝑏 = 8𝑃𝑐
64 𝑃𝑐 𝑐

Note: Do not convert the equation in the form of Z. Calculate the molar volume from the
given Van der waals equation and then calculate Z using the calculated molar volume. Check
for units’ consistency everywhere and write appropriate units after the values.

2. METHOD OF LINES FOR PARTIAL DIFFERENTIAL EQUATIONS


Problem Statement:
Unsteady-state heat transfer in a slab in the x direction is described by the partial differential
equation
𝜕𝑇 𝜕2 𝑇
=𝛼 (1)
𝜕𝑡 𝜕𝑥 2

where T is the temperature in K, t is the time in s, and α is the thermal diffusivity in m 2/s
given by k/ρcp. In this treatment, the thermal conductivity k in W/m·K, the density ρ in
kg/m3, and the heat capacity cp in J/kg·K are all considered to be constant.
Consider that a slab of material with a thickness 1.00 m is supported on a non-conducting
insulation. This slab is shown in Figure 1. For a numerical problem solution, the slab is
divided into N sections with N + 1 node points. The slab is initially at a uniform temperature
of 100 °C. This gives the initial condition that all the internal node temperatures are known at
time t = 0.
Tn = 100 for n = 2 … (N + 1) at t = 0 (2)
If at time zero the exposed surface is suddenly held constant at a temperature of 0 °C, this
gives the boundary condition at node 1:
T1=0 for t ≥ 0 (3)
The other boundary condition is that the insulated boundary at node N + 1 allows no heat
conduction. Thus
𝜕𝑇𝑁+1
=0 for t ≥ 0 (4)
𝜕𝑥

Note that this problem is equivalent to having a slab of twice the thickness exposed to the
initial temperature on both faces.
Numerically solve Equation (1) with the initial and boundary conditions of (2), (3), and (4)
for the case where α = 2 × 10-5 m2/s and the slab surface is held constant at T1 = 0 °C. This
solution should utilize the numerical method of lines with N = 10 sections. Plot the
temperatures T2, T3, T4,…..,T10 as functions of time to 6000 s.
Additional information:
For this problem with N = 10 sections of length ∆x = 0.1 m, Equation (1) can be rewritten
using a central difference formula for the second derivative as
𝜕𝑇𝑁 𝑎
= (𝑇𝑛+1 − 2𝑇𝑛 + 𝑇𝑛−1 ) for (2 ≤ n ≤10) (5)
𝜕𝑡 ∆𝑥 2

The boundary condition represented by Equation (4) can be written using a second-order
backward finite difference as
𝜕𝑇11 3𝑇11 −4𝑇10 +𝑇9
= =0 (6)
𝜕𝑡 2∆𝑥

that can be solved for T11 to yield


4𝑇10 −𝑇9
𝑇11 = (7)
3

The problem then requires the solution of Equations (3), (5), and (7) which results in nine
simultaneous ordinary differential equations and two explicit algebraic equations for the 11
temperatures at the various nodes.

You might also like