0% found this document useful (0 votes)
9 views22 pages

Mahi

The document presents a chemical process design assignment focused on developing dynamic models for a perfectly stirred, constant-volume tank with two input streams. It includes mass and energy balance equations, assumptions, and variables related to both liquid and gas phases. The assignment also outlines the modeling of liquid surge tanks and the application of ideal gas laws for gas phase behavior.

Uploaded by

trko5354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views22 pages

Mahi

The document presents a chemical process design assignment focused on developing dynamic models for a perfectly stirred, constant-volume tank with two input streams. It includes mass and energy balance equations, assumptions, and variables related to both liquid and gas phases. The assignment also outlines the modeling of liquid surge tanks and the application of ideal gas laws for gas phase behavior.

Uploaded by

trko5354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

CHEMICAL

PROCESS
DESIGN
ASSIGNMEN
T
UNIVERSITY OF GONDAR
INSTITUTE OF ChEg6083
TECHNOLOGY
DEPARTMENT OF
CHEMICAL By:Mahlet Biadgilign
ENGINEERING

SUBMITTED TO DR.TEWODROS NIGATU


1. A perfectly stirred, constant- volume tank has two input streams, both consisting
of the same liquid as shown in the figure below. The temperature and flow rate of
each the streams can vary with time.

Drive a dynamic model

Given:

A perfectly stirred, constant-volume tank has two input streams whose temperature and flow rate
can vary with time.

Solution:

a. Mass Balance for a Perfectly Stirred Tank

We now perform a mass balance to describe how the liquid level or volume changes in the tank.
The mass balance will involve the inlet and outlet streams.

Define the Variables

 T=T3: Temperature of the liquid in the tank (state variable).


 T1: Temperature of the first inlet stream (input variable).
 T2: Temperature of the second inlet stream (input variable).
 ⱳ1: mass flow rate of the first inlet stream (input variable).
 ⱳ 2: mass flow rate of the second inlet stream (input variable).
 ⱳ 3=w: mass flow rate of the outlet stream (output variable).
 V: Volume of the liquid in the tank (constant).

1
 ρ: Density of the liquid (constant).
 Cp: Specific heat capacity of the liquid (constant).

Assumptions

1. No reaction: no chemical reactions occur within the tank


2. The liquid is perfectly mixed, so the temperature in the tank is uniform.
3. constant volume: the volume(v) of the liquid in the tank remains constant
4. Constant density (ρ): the density of the liquid in all streams is constant and equal

 General Mass Balance


 The general mass balance equation is:
o 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑎𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑚𝑎𝑠𝑠 =
𝑀𝑎𝑠𝑠 𝑖𝑛𝑓𝑙𝑜𝑤 𝑟𝑎𝑡𝑒 − 𝑀𝑎𝑠𝑠 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑟𝑎𝑡 … (1)
 The total mass in the tank is:𝑀𝑎𝑠𝑠 = 𝜌 ∗ 𝑉..........................................................(2)
dV..................................................................................
 The rate of mass accumulation is:d(ρV) = 𝜌 (3)
dt dt

Mass Inflow and Outflow


 The inflow rate is due to the two inlet streams:
 Ma𝑠𝑠 𝐼𝑛𝑓𝑙𝑜𝑤 𝑅𝑎𝑡𝑒(𝑀˙ in) = ⱳ1 + ⱳ 2............................................................................(4)
 𝑀𝑎𝑠𝑠 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑟𝑎𝑡𝑒 (𝑀˙ out) = ⱳ.......................................................................................(5)

Step 4: Mass Balance Equation

Substitute the terms into the mass balance equation1:

𝑑𝑉
𝜌
𝑑𝑡 = ⱳ1 + ⱳ 2 − 𝜔..............................................................................................(6)

Cancel out ρ (since it is constant and non-zero):


𝒅𝑽
𝜌 = ⱳ𝟏 + ⱳ 𝟐 − ⱳ...............................................................................................................(7)
𝒅𝒕

The dynamic model for the liquid volume in the tank is equation 7.
b. General Energy Balance

2
Assumptions for the Energy Balance

 Perfectly Mixed: The tank is perfectly stirred, so the temperature of the liquid inside
the tank is uniform at any given time (T).
 Constant Properties:
o The density (ρ) and specific heat capacity (Cp ) of the liquid are constant and
do not vary with temperature or time.
 No Phase Change:The liquid remains in a single phase (no evaporation, condensation,
or chemical reaction).
 Heat Transfer Neglected:
o There is no heat transfer to or from the tank walls or surroundings
unless explicitly included (e.g., no heat loss to the ambient).
 Time-Dependent Temperature:
o The temperature in the tank (T) changes with time depending on the inflows
and outflows of energy.
 Energy Inflow Sources:
o Energy enters the tank only via the two inlet streams, each bringing in energy at
a rate proportional to their temperature (T1, T2) and flow rates (ω1,m2).
 Energy Outflow Sources:
o Energy exits the tank with the liquid leaving at the outlet flow rate m) at the tank's
temperature (T).
dU dH..............
 Kinetic anergy and potential energy is negligible; i.e. dE = = (8)
dt dt dt

Solution

The energy balance is:

𝑅𝑎𝑡𝑒 𝑜𝑓 𝑒𝑛𝑒𝑟𝑔𝑦 𝑎𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑎𝑛𝑘


= 𝑠𝑢𝑚𝑎𝑡𝑖𝑜𝑛 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑒𝑛𝑒𝑟𝑔𝑦 𝑖𝑛𝑓𝑙𝑜𝑤 − 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑒𝑛𝑒𝑟𝑔𝑦 𝑜𝑢𝑡𝑓𝑙𝑜𝑤)

𝑑𝐸 (𝑢 + 𝑘𝑒 + 𝑝𝑒)
=𝑑
𝑑𝑡 = Σ 𝐸˙system in − 𝐸˙system out ± 𝑄 + 𝑊 … … . (9)
𝑑𝑡

Based on the above assumption equation 9 is reduced to equation 10

𝑑𝐸 𝑑𝐻
=
𝑑𝑡 = Σ 𝐸˙system in − 𝐸˙system out … … . (10)
𝑑𝑡

3
Hence: -𝐻 = 𝑚𝑐𝑝∆𝑇
Substitute in to equation 10
𝑑(𝑚𝑐𝑝∆𝑇)
= Σ 𝑚˙ 𝑐𝑝∆𝑇system in − 𝑚˙ 𝑐𝑝∆𝑇system out … … . (11)
𝑑𝑡
Hence: - m=𝜌 ∗ 𝑉
Substitute in to equation 11

𝑑(𝜌 ∗ 𝑉 𝑐𝑝∆𝑇)
= Σ 𝑤 ∗ 𝑐𝑝 ∗ ∆𝑇 𝑠𝑦𝑠𝑡𝑒𝑚 𝑖𝑛 − 𝜌 ∗ 𝑉˙ ∗ 𝑐𝑝 ∗ ∆𝑇system out … … . (12)
𝑑𝑡
Hence: 𝑚˙ =ⱳ
Substitute in to equation 12

𝑑(𝜌 ∗ 𝑉 𝑐𝑝∆𝑇)
= Σⱳ ∗ 𝑐𝑝 ∗ ∆𝑇𝑠𝑦𝑠𝑡𝑒𝑚 𝑖𝑛 − 𝜌 ∗ ⱳ ∗ 𝑐𝑝 ∗ ∆𝑇system out … … . (13)
𝑑𝑡
Based on assumption 2 we can cancel out 𝑐𝑝 the equation be coming

𝑑𝜌(𝑉 ∗ ∆𝑇)
= Σⱳ ∗ ∆𝑇𝑠𝑦𝑠𝑡𝑒𝑚 𝑖𝑛 − ⱳ ∗ ∆𝑇system out … … . (14)
𝑑𝑡

Hence: ∆𝑇 = 𝑇 − 𝑇reference
Substitute in to equation 14 and rearrange it

𝑑(𝜌𝑉 ∗ 𝑇)
𝑑𝑡 = 𝑤1 ∗ 𝑇1 + 𝑤2 ∗ 𝑇2 − 𝑤 ∗ 𝑇 … … . (15)

𝑉𝑑𝑇 𝑑𝑉
𝜌 + 𝑇𝜌 = 𝑤1 ∗ 𝑇1 + 𝑤2 ∗ 𝑇2 − 𝑤 ∗ 𝑇 … … . (16)
𝑑𝑡 𝑑𝑡
From mass balance we have dVfrom equation 7 and we have to substitute into to equation 16 and
dt

rearrange it

ρVdΤ
+T*(w1+𝑤2 − 𝑤) = 𝑤1 ∗ 𝑇1 + 𝑤2 ∗ 𝑇2 − 𝑤 ∗ 𝑇 … … . (16)
dt

4
rearrange it
𝜌VdΤ = 𝑤1 ∗ 𝑇1 + 𝑤2 ∗ 𝑇2 − 𝑤 ∗ 𝑇 − T ∗ (w1 + 𝑤2 − 𝑤)
dt

𝜌V dΤ
= 𝑤1(𝑇1 − 𝑇) + 𝑤2(𝑇2 − 𝑇)
dt

We get
𝜌𝑑𝑇 𝑤1 𝑤2
𝑑𝑡 = (𝑇1 − 𝑇) + (𝑇2 − 𝑇)...........(17)
𝑉 𝑉

Coupled Dynamic Model

The complete dynamic model now includes:

a. Mass balance
𝒅𝑽
𝜌 = ⱳ𝟏 + ⱳ 𝟐 − ⱳ
𝒅𝒕
b. Energy balance

𝑑𝑇 𝑤1 𝑤2
= (𝑇1 − 𝑇) + (𝑇 2 − 𝑇 )
𝑑𝑡 𝜌𝑉 𝜌𝑉

Q2. Often liquid surge tanks (Particularly those containing hydrocarbons) will have a
gas “blanket” of nitrogen or Carbone dioxide to prevent the accumulation of exclusive
vapors above the liquid as depicted below.

5
Develop the modeling equation with gas pressure and liquid volume as the state variables.
let qfand q represents the inlet and out let gas molar flow rates Ff and F the liquid volumetric
flow rates. And Vl the liquid volume, V the constant (total) volume and p the gas pressure.

Variables and Definitions

1. Gas phase variables:


o qf: Gas molar flow rate into the tank (inlet gas flow rate).
o q: Gas molar flow rate out of the tank (outlet gas flow rate).
o p: Gas pressure (state variable).
o ng: Moles of gas in the gas phase.
o Vg: is the volume of the gas.
2. Liquid phase variables:
o Ff Liquid volumetric flow rate into the tank.
o F: Liquid volumetric flow rate out of the tank.
o Vl: Liquid volume (state variable).
3. Tank constraints:
o Total tank volume is constant: V=Vl+Vg.
4. Gas law:
o The gas phase follows the ideal gas law: PVg=ngRT
o T is the temperature.

Assumptions

1. The gas phase behaves as an ideal gas.


2. The tank volume (V) is constant.
3. The system operates at constant temperature (T=constant).
4. The liquid phase is incompressible.

1. Mass Balance for the Liquid Phase

For the liquid volume Vlapply the conservation of mass

6
Step I: General Mass Balance

 The general mass balance equation is:


𝑅𝑎𝑡𝑒 𝑜𝑓 𝑎𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑚𝑎𝑠𝑠 = 𝑀𝑎𝑠𝑠 𝑖𝑛𝑓𝑙𝑜𝑤 𝑟𝑎𝑡𝑒 − 𝑀𝑎𝑠𝑠 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑟𝑎𝑡 … (1)
 The total mass in the tank is: 𝑀𝑎𝑠𝑠 = 𝜌 ∗ 𝑉𝑙..........................................................(2)
dVl...................................................................................
 The rate of mass accumulation is: d(ρVl) = 𝜌 (3)
dt dt

Step II: Mass Inflow and Outflow

 The inflow rate is due to the two inlet streams:


 Ma𝑠𝑠 𝐼𝑛𝑓𝑙𝑜𝑤 𝑅𝑎𝑡𝑒(𝑀˙ in) = 𝜌𝐹f........................................................................................................... (4)
 𝑀𝑎𝑠𝑠 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑟𝑎𝑡𝑒 (𝑀˙ out) = 𝐹𝜌.......................................................................................(5)

Step III: Mass Balance Equation

Substitute the terms into the mass balance equation1:

𝑑𝑉𝑙
𝜌 = 𝜌𝐹f − 𝐹𝜌....................................................................................................(6)
𝑑𝑡

Cancel out ρ (since it is constant and non-zero):


𝒅𝑽𝒍
= 𝐹 − 𝐹 … … … … … … … … … … … … … … … … … … … … … … … … … … … … … … (7)
𝒅𝒕 f

2. Mass Balance for the Gas Phase

For the gas phase, we track the molar accumulation of gas, considering the inflow (𝑞f) and
outflow (q) of gas:

We use ideal gas law P𝑣g = 𝑛g𝑅𝑇

OR 𝑛g Pvg
= RΤ

For the liquid volume Vlapply the conservation of mass

Step I: General Mass Balance

7
 The general Mole balance equation is:
𝑅𝑎𝑡𝑒 𝑜𝑓 𝑎𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑚𝑜𝑙𝑒 = 𝑚𝑜𝑙𝑒 𝑖𝑛𝑓𝑙𝑜𝑤 𝑟𝑎𝑡𝑒 − 𝑚𝑜𝑙𝑒 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑟𝑎𝑡 … (1)
 The rate of molein the tank for the gas phase is: 𝑞f
 The rate of mole out the tank for the gas phase is: 𝑞
pvg
d( )
 The rate of mole accumulation is: g) RT
… … … … … … … … … … … . … … … . . (2)
d(n dt
pvg =
𝑑( ) dt

= 𝑞f − 𝑞....................................................(3)
𝑑𝑡
Since R and T are constants

1
(𝑣g𝑑𝑝 + 𝑝𝑑𝑣g) = 𝑞f − 𝑞........................................................(4)
𝑅𝑇𝑑𝑡

Relating volume of gas steam and liquid stream

Total volume of the tank contains both phase is constant.

Therefore 𝑉 = 𝑣l + 𝑣g............................................................................... (5)

Differentiate equation 5 with respect to time and rearrange it

𝑑𝑣 𝑑𝑣l 𝑑𝑣g
= +
𝑑𝑡 𝑑𝑡 𝑑𝑡

𝑑𝑣l 𝑑𝑣g
0= +
𝑑𝑡 𝑑𝑡

𝑑𝑣g 𝑑𝑣l
= − … … … … … (6)
𝑑𝑡 𝑑𝑡

To eliminate 𝑣g we substitute equation 5 and 6 into equation 4

1
((𝑉 − 𝑣l)𝑑𝑝 − 𝑝𝑑𝑣l) = 𝑞f − 𝑞
𝑅𝑇𝑑𝑡

After rearrangement

8
(𝑉 − 𝑣l) 𝑑𝑝 𝑃 𝑑𝑣l
𝑅𝑇 𝑑𝑡 𝑅𝑇 𝑑𝑡 = 𝑞f − 𝑞......................(7)

𝒅𝑽𝒍 = 𝐹 f − 𝐹 From substitutemass balance equation to this equation


𝒅𝒕

(V–v l ) dp P
∗ dt − RΤ ∗ (𝐹f − 𝐹) = 𝑞 f− 𝑞........................(8)

After rearrangement

𝑑𝑝 𝑃 ∗ (𝐹f − 𝐹 𝑅𝑇(𝑞f − 𝑞)
= )+
𝑑𝑡 𝑉 − 𝑣l 𝑉 − 𝑣l

Final Model Equations

The system is now described by the following two coupled differential equations:

i. Liquid phase mass balance:

𝒅𝑽𝒍
= 𝐹f − 𝐹
𝒅𝒕

ii. Gas phase pressure balance:

𝑑𝑝 𝑃 ∗ (𝐹f − 𝐹 𝑅𝑇(𝑞f − 𝑞)
= )+
𝑑𝑡 𝑉 − 𝑣l 𝑉 − 𝑣l

Q3. Develop adynamic model for PFR shown in the figure below. It is assumed that a first
order liquid phase reaction occurs in the reactor.

k
𝐴→𝐵

9
Solution

Assumptions:

 The reaction is first-order: 𝑟𝐴 = −𝑘𝐶𝐴 , where k is the reaction rate constant.


 The velocity profile v is flat, meaning the flow is uniform.
 Concentration CA varies along the reactor length z, but not radially (perfect radial
mixing).
 Steady flow rate and constant density.

Step 1: Mass Balance for a Differential Element

Consider a small differential volume element of the reactor, Δzas shown in the given diagram.
For species A, the mass balance over this element can be expressed as:
10
𝑅𝑎𝑡𝑒 𝑜𝑓 𝑎𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝐴
= 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑖𝑛𝑓𝑙𝑜𝑤 𝑜𝑓 𝐴 − 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑜𝑢𝑡𝑓𝑙𝑜𝑤 𝑜𝑓 𝐴
− 𝑅𝑎𝑡𝑒 𝑜𝑓 𝑐𝑜𝑛𝑠𝑢𝑚𝑝𝑡𝑖𝑜𝑛 𝑜𝑓 𝐴 … … … … … … … … … … (1)

Mathematically:

&𝑁A
= 𝑛˙𝐴|ιn− 𝑛˙𝐴|˙ out − 𝑟A. 𝑉..........................(1)
&𝑡

Step 2: Define the Terms

1. Rate of Accumulation: The accumulation of A in the differential volume is:

&𝑁A &(𝐶A. 𝑉)
=
&𝑡 &𝑡
Since the reactor has a constant cross-sectional area Ac , the volume of the
element is V=Ac*ΔzThus:
&(𝐶A. 𝑉) &(𝐶A ∗ 𝐴C ∗ ∆𝑍) 𝐴C ∗ ∆𝑍 ∗ &𝐶A
&𝐶A
= = … … . . (3)
&𝑡 &𝑡 = 𝐴C ∗ ∆𝑍 ∗ &𝑡
&𝑡
2. Rate of Inflow: The molar flow rate of A entering the element is:

𝑛˙𝐴|in = ∆𝑍 ∗ 𝐴C ∗ 𝐶A........................(4)
3. Rate of Outflow: The molar flow rate of A leaving the element is:

𝑛˙𝐴|out = ∆𝑍 ∗ 𝐴C ∗ 𝐶A|Z+∆z..............................(5)

Using a Taylor expansion, approximate:

𝐶A|Z+∆z ≈ 𝐶A|Z + &𝐶A


∆𝑍 … … … . (6)
&𝑍

Thus

11
𝑛˙𝐴|out ≈ ∆𝑍 ∗ 𝐴C ∗ (𝐶A|Z + &𝐶A
∆ 𝑍 )… … … (7)
&𝑍

Rate of Consumption: The reaction rate per unit volume 𝑖𝑠 𝑟A = −𝑘𝐶A

The rate of consumption in the differential volume is:

𝑟A ∗ 𝑉 = −𝑘𝐶A ∗ (𝐴𝑐 ∗ 𝛥𝑧 )..............................(8)

Step 3: Substitute Terms into the Mass Balance

Now, substitute the above expressions into the mass balance equation:

𝐴C ∗ ∆𝑍 ∗ &𝐶A &𝐶A
= (𝑉 ∗ 𝐴C ∗ 𝐶A|Z) − (𝑉 ∗ 𝐴C ∗ (𝐶A|Z + ∆𝑍)) − ( −𝑘𝐶A ∗ (𝐴𝑐 ∗ 𝛥𝑧 ))
&𝑡 &𝑍

Simplify:

&𝐶A &𝐶A
𝐴C ∗ ∆𝑍 ∗ =− ∆𝑍 + 𝑘𝐶A ∗ (𝐴𝑐 ∗ 𝛥𝑧 ))...............................(9)
&𝑡 &𝑍

𝑑𝑖𝑣𝑖𝑑𝑒𝑑 𝑏𝑦 𝐴C ∗ ∆𝑍 we get

&𝐶A &𝐶A
+ = −𝑘𝐶A … … … (10)
&𝑡 &𝑍𝐴C

Step 4: Final Governing Equation

12
The dynamic model for the PFR is:

13
&𝐶A &𝐶A
= − 𝑘𝐶A
&𝑡 &𝑍𝐴C

subject to the boundary and initial conditions:

 At z=0: CA= CA,in (t) (inlet concentration).


 At t=0: CA= CA, 0 (z) (initial concentration along the reactor)

Q4. Completely enclosed stirred tank heating process is used to heat an incoming stream
whose flow rate varies.

The heating rate from this coil and the volume are both constant.

Develop a mathematical model that describes the exit temperature if heat losses to the
ambient occur and if the ambient temperature (Ta)and the incoming streams temperature (Ti)
both can vary.

Given
The problem involves deriving a mathematical model for a stirred-tank heating
process that accounts for variable flowrate, heat losses to the ambient, and

14
variations in the incoming stream temperature (Ti) and ambient temperature (Ta
).

Solution

Step 1: Mass and Energy Balance

Assumptions:

1. The tank is well-mixed, so the temperature inside the tank (T) is uniform.
2. Constant volume of the tank.
3. Heat losses to the ambient are proportional to the temperature difference between
the tank (T) and the ambient (Ta).
4. The heating rate from the coil (Q) is constant.
5. Variations in density (ρ), specific heat capacity (Cp), and flowrate (w) are negligible.
6. No Phase Change:

The liquid remains in a single phase (no evaporation, condensation, or chemical reaction).

7. Time-Dependent Temperature:

The temperature in the tank (T) changes with time depending on the inflows and outflows
of energy.
dE dU dH
8. Kinetic anergy and potential energy is negligible; i.e. = =
dt dt dt
i. Mass Balance:

The liquid flowrate w entering the tank equals the flowrate exiting the tank (steady-state flow):

𝑀˙ in = 𝑀˙ out = 𝑤 … … (1)
ii. energy Balance:

𝑻𝒉𝒆 𝒓𝒂𝒕𝒆 𝒐𝒇 𝒄𝒉𝒂𝒏𝒈𝒆 𝒐𝒇 𝒊𝒏𝒕𝒆𝒓𝒏𝒂𝒍 𝒆𝒏𝒆𝒓𝒈𝒚 𝒊𝒏 𝒕𝒉𝒆 𝒕𝒂𝒏𝒌 𝒊𝒔 𝒆𝒒𝒖𝒂𝒍 𝒕𝒐:

15
𝑅𝒂𝒕𝒆 𝒐𝒇 𝒆𝒏𝒆𝒓𝒈𝒚 𝒊𝒏 − 𝑹𝒂𝒕𝒆 𝒐𝒇 𝒆𝒏𝒆𝒓𝒈𝒚 𝒐𝒖𝒕 + 𝑹𝒂𝒕𝒆 𝒐𝒇 𝒆𝒏𝒆𝒓𝒈𝒚 𝒂𝒅𝒅𝒆𝒅 𝒃𝒚 𝒉𝒆𝒂𝒕𝒊𝒏𝒈
− 𝑹𝒂𝒕𝒆 𝒐𝒇 𝒆𝒏𝒆𝒓𝒈𝒚 𝒍𝒐𝒔𝒕 𝒕𝒐 𝒕𝒉𝒆 𝒂𝒎𝒃𝒊𝒆𝒏𝒕 … … . . (𝟏)

To express
𝑑𝐸 ( )
= 𝑑 𝑢 + 𝑘𝑒 + 𝑝𝑒
𝑑𝑡 = Σ 𝐸˙system in − Σ 𝐸˙system out ± 𝑄 − 𝐸˙lost … … . (2)
𝑑𝑡

Mathematically:Explanation of Each Term.

𝑻𝒉𝒆 𝒓𝒂𝒕𝒆 𝒐𝒇 𝒄𝒉𝒂𝒏𝒈𝒆 𝒐𝒇 𝒊𝒏𝒕𝒆𝒓𝒏𝒂𝒍 𝒆𝒏𝒆𝒓𝒈𝒚 𝒊𝒏 𝒕𝒉𝒆 𝒕𝒂𝒏𝒌: 𝑑𝐸 𝑑𝐻


=
𝑑𝑡 𝑑𝑡

a. Rate of Accumulation of EnergydH = 𝑉𝜌𝐶 ∗ … … . (3) :
dt p dt

 This term represents the rate of change of internal energy inside the tank due
to temperature changes over time.
 ρ: Density of the liquid (kg/m³).
 V: Volume of the tank (m³).
 Cp: Specific heat capacity of the liquid (J/(kg·°C)).

 : Time rate of change of the tank temperature (°C/s)
dt

b. Rate of Energy In
𝐸˙system in = 𝐰 ∗ 𝐂𝐩 ∗ 𝐓𝐢 … … . (𝟒)

 Energy enters the tank through the inflow of liquid at temperature Ti


 w: Mass flowrate of the incoming liquid (kg/s).
 Cp : Specific heat capacity (J/(kg·°C)).
 Ti : Temperature of the incoming liquid (°C).
 This term increases the tank's energy, as hotter incoming liquid raises the
tank's temperature.
c. Rate of Energy Out:

16
𝐸˙system out = 𝐰 ∗ 𝐂𝐩 ∗ 𝐓 … … . (𝟒)

17
 Energy leaves the tank through the outflow of liquid at the tank temperature T.
 w: Mass flowrate of the outgoing liquid (kg/s).
 Cp : Specific heat capacity (J/(kg·°C)).
 T: Tank temperature (°C).
 This term decreases the tank's energy, as heat is carried away by the exiting liquid.
d. Rate of Energy Added by Heating (Q):
 Energy is added to the tank from the heating coil.
 Q: Heat input rate from the coil (W or J/s).
 This term always adds energy to the tank, raising its temperature.
e. Rate of Energy Lost to Ambient

𝑬˙ 𝒍𝒐𝒔𝒕 = 𝐔 ∗ 𝐀 ∗ (𝐓 − 𝐓𝐚).............(𝟓)

 Energy is lost to the surroundings due to heat transfer from the tank to the ambient.
 U: Overall heat transfer coefficient (W/(m²·°C)).
 A: Heat transfer area of the tank (m²).
 T: Tank temperature (°C).
 Ta : Ambient temperature (°C).
 This term decreases the tank's energy, as heat flows out when T >Ta.

Final Energy Balance with Identified Terms:

Combining all terms in to equation 2, the energy balance equation is:

𝑑𝑇
𝑉𝜌𝐶p ∗ = (𝐰 ∗ 𝐂𝐩 ∗ 𝐓𝐢) − (𝐰 ∗ 𝐂𝐩 ∗ 𝐓) + 𝐐 − (𝐔 ∗ 𝐀 ∗ (𝐓 − 𝐓𝐚))
𝑑𝑡

Divide by 𝑉𝜌𝐶pall terms we get

𝑑𝑇 (𝒘 ∗ 𝑻𝒊) (𝐰 ∗ 𝐓 ) 𝐐 (𝐔 ∗ 𝐀 ∗ (𝐓 − 𝐓𝐚))
= − + − … … . (6)
𝑑𝑡 𝑉𝜌 𝑉𝜌 𝑉𝜌𝐶p 𝑉𝜌𝐶p

Step 2: Final Mathematical Model

18
The governing equation for the tank temperature T is:

𝑑𝑇 (𝒘 ∗ 𝑻𝒊) (𝐰 ∗ 𝐓 ) 𝐐 (𝐔 ∗ 𝐀 ∗ (𝐓 − 𝐓𝐚))
= − + −
𝑑𝑡 𝑉𝜌 𝑉𝜌 𝑉𝜌𝐶p 𝑉𝜌𝐶p

Boundary and Initial Conditions:

 At t=0, T=T0 , where T0 is the initial tank temperature.


 The parameters Ti(t), Ta(t), w(t), and Q can vary as inputs.

Q5. Write a MATLAB code to draw the following pictures using both for and while
loops.
Pattern 1 Pattern 2

∗∗∗∗∗∗ ∗∗∗∗∗∗
∗∗∗∗∗ ∗∗∗∗∗
∗∗∗∗ ∗∗∗∗
∗∗∗ ∗∗∗
∗∗ ∗∗
∗ ∗

19
Note book
I. The fprintf function is used for all outputs.
II. The \n in fprintf ensures a new line after each
row. MATLAB code
Pattern For loop While loop
Pattern 1 n=6; Nmax=6;
for i=n:-1:1 n=0;
for k=1:i while (n<6)
fprintf('*') n=n+1;
end fprintf('\ k=0;
n') end while(k<Nmax-m)
k=k+1;
fprintf('*')
end
fprintf('\n')
end

20
Pattern For loop While loop
Pattern 2 n=6; Nmax=6;
for i=n:-1:1 n=0;
for j= 1:n-1 while (n<6)
fprintf(' ') n=n+1;
end m=0;
for k= 1:i while m<(n-1)
fprintf('*') m=m+1;
end fprintf('\ fprintf(' ')
n') end end
k=0;
while(k<Nmax-m)
k=k+1;
fprintf('*')
end
fprintf('\n')
end

21

You might also like