In [1]:

```
from sympy import symbols,solve
#Assuming that the steam is dry and saturated at 205 kN/m2, then from the Steam Tables in the Appendix, the steam temperature = 394 K at which the total enthalpy = 2530 kJ/kg.
#At 13.5 kN/m2, water boils at 325 K and, in the absence of data on the boiling point elevation,this will be taken as the temperature of evaporation, assuming an aqueous solution. The total enthalpy of steam at 325 K is 2594 kJ/kg.
#Thus the feed, containing 10 per cent solids, has to be heated from 294 to 325 K at which temperature the evaporation takes place.
print"\n mass of dry solids = %.1f kg/sec"%((7*10/100))
x = symbols('x')
x1 = solve(0.7*100-50*(0.7+x))[0]
print"\n x = %.1f kg/sec"%(x1)
print"\n Water to be evaporated = %.1f kg/sec"%((7-0.7)-0.7)
print"\n Summarising"
print"\n Stream Solids Liquid Total "
print"\n (kg/s) (kg/s) (kg/s) "
print"\n Feed %.1f %.1f %.1f"%(x1,7-x1,x1+7-x1)
print"\n Product %.1f %.1f %.1f"%(x1,x1,x1+x1)
print"\n Evaporation %.1f %.1f"%(7-x1-x1,7-2*x1)
#Using a datum of 273K
q_entering = (7*3.76)*(294-273)
print"\n Heat entering with the feed = %.1f kW"%(q_entering)
q_leaving = (1.4*3.14)*(325-273)
print"\n Heat leaving with the product = %.1f kW"%(q_leaving)
print"\n Heat leaving with the evaporated water = %d kW"%(5.6*2594)
print"\n Heat transferred from the steam = %d kW"%(14526+228.6-552.7)
print"\n The enthalpy of the condensed steam leaving at 352.7 K = %.1f kJ/kg "%(4.18*(352.7-273))
print"\n The heat transferred from 1 kg steam = %.1f kJ/kg"%(2530-333.2)
print"\n Steam required = %.2f kg/s "%(14202/2196.8)
#s the preheating of the solution and the sub-cooling of the condensate represent but a small proportion of the heat load, the temperature driving force may be taken as the difference between the temperatures of the condensing steam and the evaporating water, or:
print"\n deltaT = %d deg K "%(394-325)
print"\n Heat transfer area ,A = %.1f m**2"%(14202/(3*69))
```

In [3]:

```
from numpy import mat
#Temperature of dry saturated steam at 205 kN/m2 = 394 K.
#At a pressure of 13 kN/m2 (0.13 bar), the boiling point of water is325 K, so that the totaltemperature difference &T = (394 − 325) = 69deg K.
#First Approximation.
#Assuming that: U1*deltaT1 = U2*deltaT2 = U3*deltaT3
#then substituting the values of U1, U2 and U3 and &T = 69 deg K gives:
print"\n deltaT1 = %.f deg K"%(13)
print"\n deltaT2 = %.f deg K"%(20)
print"\n deltaT2 = %.f degK"%(36)
#Since the feed is cold, it will be necessary to have a greater value of T1 than given by this analysis. It will be assumed that T1 = 18 deg K, T2 = 17 deg K, T3 = 34 deg K.
#For steam to 1: T0 = 394 K and λ0 = 2200 kJ/kg
#For steam to 2: T1 = 376 K and λ1 = 2249 kJ/kg
#For steam to 3: T2 = 359 K and λ2 = 2293 kJ/kg
# T3 = 325 K and λ3 = 2377 kJ/kg
#Assuming that the condensate leaves at the steam temperature, then heat balances across each effect may be made as follows:
#Effect 1 :
#2200 D0 = 4 × 4.18(376 − 294) + 2249 D1
#Effect 2:
#2249 D1 + (4 − D1)4.18(376 − 359) = 2293 D2
#Effect 3:
#2293 D2 + (4 − D1 − D2)4.18(359 − 325) = 2377 D3
print"\n Solids liquor Total "
print"\n (kg/s) (kg/s) (kg/s) "
print"\nFeed %.1f %.1f %.1f "%(0.4,3.6,4.0)
print"\nProduct %.1f %.1f %.1f "%(0.4,0.4,0.8)
print"\nEvaporation %.1f %.1f "%(3.6-0.4,4.0-0.8)
#D1 + D2 + D3 = 3.2 kg/s
D = mat([[2177.94, -2293, 0],[-4.18*(359-325), 2293-4.18*(359-325), -2377],[1, 1, 1]])
C = mat([[-4*4.18*(376-359)],[-4*4.18*(359-325)],[3.2]])
D1 = (D**-1)*C
for dd in D1:print"\n ans = %.3f kg/s"%(dd)
D0 = (4*4.18*(376-294)+2249*D1[0])/2200
A1 = D0*2200/(3.1*18)
print"\n A1 = %.1f m**2"%(A1)
A2 = D1[0]*2249/(2*17)
print"\n A2 = %.1f m**2"%(A2)
A3 = D1[1]*2293/(1.1*34)
print"\n A3 = %.1f m**2"%(A3)
print"\n These three calculated areas are approximately equal, so that the temperature differences assumed may be taken as nearly correct"
#let, deltaT1 = x
#deltaT2 = y
#deltaT3 = z
X = mat([[3.1, -2.0, 0],[0, 2.0, -1.1],[1, 1, 1]])
A = mat([[0],[0],[69]])
T = (X**-1)*A
print"\n deltaT1 = %d deg K"%(T[0])
print"\n deltaT2 = %d deg K"%(T[1])
print"\n deltaT3 = %d deg K"%(T[2])
#ghting the temperature differences to allow for the fact that the feed enters at ambient temperature gives:
#deltaT1 = 18 deg Kdelta T2 = 18 degK delta T3 = 33 deg K
Steam_temp = 394
T1 = Steam_temp-18
print"\n T1 = %d K"%(T1)
T2 = T1 - 18
print"\n T2 = %d K"%(T2)
T3 = T2 - 33
print"\n T3 = %d K"%(T3)
#The total evaporation (D1 + D2 + D3) is obtained from a material balance:
print"\n Solids liquor Total "
print"\n (kg/s) (kg/s) (kg/s) "
print"\nFeed %.1f %.1f %.1f "%(0.4,3.6,4.0)
print"\nProduct %.1f %.1f %.1f "%(0.4,0.4,0.8)
print"\nEvaporation %.1f %.1f "%(3.6-0.4,4.0-0.8)
#Assuming, as an approximation, equal evaporation in each effect, or D1 = D2 = D3 = 1.07 kg/s, then the latent heat of flash vaporisation in the second effect is given by:
q = 4.18*(4-1.07)*(376-358)
print"\n latent heat of flash vaporisation in the second effect is = %.1f kW"%(q)
print"\n latent heat of flash vaporisation in the third effect is:= %.1f kW "%(4.18*(4-2*1.07)*(358-325))
print"\n At 394 K, the latent heat = 2200 kJ/kg"
print"\n At 325 K, the latent heat = 2377 kJ/kg"
print"\n Mean value, λ = 2289 kJ/kg"
print"\n Values ofT1,T2T3 are now chosen by trial and error to give equal values of A in each effect, as follows"
print"\n deltaT1 A1 deltaT2 A2 deltaT3 A3"
print"\n (deg K) (m**2) (deg K) (m**2) (deg K) m**2"
print"\n 18 64.2 18 61.4 33 66.9 "#
print"\n 19 60.5 17 65.0 33 66.9"#
print"\n 18 64.2 17.5 63.1 33.5 65.9"#
print"\n 18 64.2 17 65.0 34 64.9"
print"\n Steam consumption = %.2f kg/s"%(3580/2289)
print"\n Economy = %.1f kg/kg"%(3.2/1.56)
```

In [5]:

```
from numpy import mat
deltaT1 = 20# #temperature is in deg K
deltaT2 = 24# #temperature is in deg K
deltaT3 = 25# #temperature is in deg K
To = 394# #temperature is in deg K
T1 = 374# #temperature is in deg K
T2 = 350# #temperature is in deg K
T3 = 325# #temperature is in deg K
latent_heat0 = 2200# #latent heat in kJ/kg
latent_heat1 = 2254# #latent heat in kJ/kg
latent_heat2 = 2314# #latent heat in kJ/kg
latent_heat3 = 2377# #latent heat in kJ/kg
#Effect 3:
# 2314 D2 = 4 × 4.18(325 − 294) + 2377 D3
#Effect 2:
# 2254 D1 = (4 − D3)4.18(350 − 325) + 2314 D2
#Effect 1:
# 2200 D0 = (4 − D3 − D2)4.18(374 − 350) + 2254 D1
#(D1 + D2 + D3) = 3.2 kg/s
D = mat([[0, 2314, -2377],[2254, -2314, 4.18*(350-325)],[1, 1, 1]])
C = mat([[4*4.18*(325-294)],[4*4.18*(350-325)],[3.2]])
D1 = (D**-1)*C
print"\n D1 = %.3f kg/s"%(D1[0])
print"\n D2 = %.3f kg/s"%(D1[1])
print"\n D3 = %.3f kg/s"%(D1[2])
A1 = 1.387*latent_heat0/(2.5*20)
A2 = 1.261*latent_heat1/(2*24)
A3 = 1.086*latent_heat2/(1.6*25)
print"\n A1 = %.1f m**2"%(A1)
print"\n A2 = %.1f m**2"%(A2)
print"\n A3 = %.1f m**2"%(A3)
```

In [7]:

```
He = 2690# #He is the enthalpy of entrained steam in kJ/kg
H4 = ((1*2780)+(1.6*2690))/2.60
#Again assuming isentropic compression from 101.3 to 135 kN/m2, then:
H3 = 2640# #in kJ/kg (from the chart)
n = (1.0+1.6)*(2725-2640)/(1.0*(2780-2375))
print"\n η = %.2f "%(n)
print"\n This value is low, since in good design overall efficiencies approach 0.75–0.80. Obviously the higher the efficiency the greater the entrainment ratio or the higher the saving in live steam"
Pe = 101.3# #pressure of entrained vapour in kN/m**2
discharge_P = 135##discharge pressure in kN/m**2
print"\n the required flow of live steam = 0.5 kg/kg entrained vapour."
print"\n In this case the ratio is (1.0/1.6) = 0.63 kg/kg"
```

In [10]:

```
from sympy import symbols,solve
#Making a mass balance, there are two inlet streams-
#the additional steam, say Gx kg/s
#the sea water feed, say Gy kg/s.
#The two outlet streams are
#distilled water product, 0.125 kg/s
#the concentrated sea water, 0.5 Gy kg/s
#Thus: (Gx + Gy) = (0.125 + 0.5 Gy) or (Gx + 0.5 Gy) = 0.125
#At 650 kN/m2, the total enthalpy of the steam = 2761 kJ/kg.
#Thus the energy in this stream = 2761Gx kW
#sea water enters at 344 K
#enthalpy of feed = [Gy × 4.18(344 − 273)] = 296.8Gy kW
print"\n The enthalpy of the product is 439*0.125 = 54.9 kW"
#Making a balance
#(E + 2761Gx + 296.8Gy) = (211.3Gy + 54.9)
#(E + 2761Gx + 85.5Gy) = 54.9
#where E is the power supplied to the compressor
#(E + 2590Gx) = 33.5
#For a single-stage isentropic compression
#the work done in compressing a volume V1 of gas at pressure P1 to a volume V2 at pressure P2 is given by
P1 = 101.3# #pressure is in kN/m**2
P2 = 120# #pressure is in kN/m**2
dsteam_P1 = (18/22.4)*(273/374.1)# #density of steam at 101.3 kN/m**2 and 374.1 K
#V1 = 0.5Gy/dsteam_P1 = 0.853 Gy m**3/sec
E = symbols('E')
E1 = solve(0.5*E-(P1*0.853)/(1.3-1)*((P2/P1)**(0.3/1.3)-1))[0]
print"\n E = %.1f kW/(kg/sec)"%(E1)
print"\n As the compressor is 50 per cent efficient then E = %.1f kW/(kg/sec)"%(E1/0.5)
#E = 46*0.5*Gy = 23.0Gy kW
Gx = symbols('Gx')
Gx1 = solve(2761*Gx - 54.9 - 4.72*(33.5-2590*Gx))[0]
print"\n Gx = %.3f kg/sec"%(Gx1)
```

In [13]:

```
from sympy import symbols,solve
#Properties of the ejector
e1 = 0.95# #nozzle efficiency
e2 = 0.80# #efficiency of momentum transfer
e3 = 0.90# #efficiency of compression
P1 = 650# #pressure of live stream
P2 = 101.3# #pressure of entrained steam
H1 = 2970##The enthalpy of the live steam at 650 kN/m2 and (435 + 100) in kJ/kg
H2 = 2605##the enthalpy after isentropic expansion from 650 to 101.3 kN/m2, using an enthalpy–entropy chart,in kJ/kg
x2 = 0.97# #dryness fraction
print"\n The enthalpy of the steam after actual expansion to 101.3 kN/m**2 is %d kJ/kg"%(e1*(H1 - H2))
LatentHeat = 2258# #latent heat at 101.3 kN/m**2
#dryness after expansion but before entrainment x21 is given by:
#(x21− x2)λ = (1 − e1)(H1 − H2)
x21 = symbols('x21')
x22 = solve((x21-x2)*LatentHeat-(1-e1)*(H1-H2))[0]
print"\n dryness after expansion but before entrainment x21 is = %.3f"%(x22)
#If x23 is the dryness after expansion and entrainment, then:
#(x23−x2)λ = (1 − e3)(H1 − H2)
x23 = symbols('x23')
x24 = solve((x23-x2)*LatentHeat-(1-e3)*(H1-H2))[0]
print"\n the dryness after expansion and entrainment is %.2f"%(x24)
P3 = 205# #discharge pressure in kN/m**2
#Assuming that the steam at the discharge pressure P3 = 205 kN/m2 is also saturated
x3 = 1
H3 = 2675##enthalpy of the mixture at the start of compression in the diffuser section at 101.3 kN/m2
#Again assuming the entrained steam is also saturated, the enthalpy of the mixture after isentropic compression in thediffuser from 101.3 to 205 kN/m2 is H4
H4 = 2810# #in kJ/kg
m = (((H1-H2)/(H4-H3))*e1*e2*e3-1)# #m = m2/m1
print"\n m2/m1 = %.2f kg vapour entrained/kg kive stream"%(m)
print"\n Thus with a flow of 0.14 kg/s live steam, the vapour entrained at 101.3 kN/m2 is %.2f kg/sec"%(0.14*m)
print'\n Total saturated steam = %.2f kg/sec at 205 kN/m**2'%(0.14+0.14*m)
print"\n The economy of the steam = %.2f"%(0.214/0.14)
print"\n The capacity in terms of throughput of solution Gf = %.3f kg/sec"%(0.214+0.025)
```

In [14]:

```
#(a) Diesel engine
print"\n (a) Diesel engine"
print"\n For 1 kg evaporation, ammonia circulated = 2.28 kg"
print"\n Work done in compressing the ammonia = %d MJ/kg"%(150*2.28)
print"\n For an output of 1 MJ, the engine consumes 0.4 kg fuel."
print"\n fuel consumption = %.3f kg/kg water evaporated"%(0.4*0.342)
print"\n cost = %.5f euro/kg water evaporated "%(0.02*0.137)
print"\n (b) Turbine"
print"\n The work required is 0.342 MJ/kg evaporation"
#Therefore with an efficiency of 70 per cent:
print"\n energy required from steam = %.3f MJ/kg "%(0.342*100/70)
print"\n Enthalpy of steam saturated at 700 kN/m2 = 2764 kJ/kg."
print"\n Enthalpy of steam saturated at 101.3 kN/m2 = 2676 kJ/kg"
print"\n thus : energy from steam = %d kg/kg"%(2764-2676)
print"\n steam required = %.2f kg/kg evaporation "%(0.489/0.088)
print"\n Cost = %.4f euro/kg water evaporated"%(0.01*5.56/10)
print"\n Hence the Diesel engine would be used for driving the compressor"
```

In [17]:

```
#(a) Maximum throughput
print"\n (a) Maximum throughput"
t_bopt = (15*10**3)+(2/(7*10**(-5)))*(7*10**(-5)*0.2*15*10**3)**0.5
print"\n The boiling time to give maximum heat transfer and hence maximum throughput is %.1f ksecs "%(t_bopt*10**(-3))
Qb = (2*40*40)*(7*10**(-5))*(((7*10**(-5)*2.81*10**4)+0.2)**0.5-0.2**0.5)
print"\n The heat transferred during boiling is %.2f*10**7 kJ"%(Qb)
print"\n the water vaporated = %.2f*10**4 kg"%((4.67*10**(7)/2300)*10**(-4))
print"\n Rate of evaporation during boiling = %.3f kg/secs"%((2.03*10**4)/(2.81*10**4))
print"\n Mean rate of evaporation during the cycle = %.3f kg/secs"%(2.03*10**(4)/((2.8*10**4)+(15*10**3)))
print"\n cost = %.1f euro/cycle"%(((2.81*10**(4)*18)/1000)+600)
print"\n (b) Minimum cost"
t_bopt1 = (600/0.018)+(2*(7*10**(-5)*0.2*600*0.018)**0.5)/(7*10**(-5)*0.018)
print"\n The boiling time to give minimum cost is %.1f ksecs"%(t_bopt1*10**(-3))
Qb1 = ((2*40*40)/(7*10**(-5)))*((7*10**(-5)*5.28*10**4 + 0.2)**0.5-0.2**0.5)
print"\n The heat transferred during one boiling period is %.2f*10**7 kJ"%(Qb1*10**(-7))
print"\n The water evaporated = %.2f*10**4 kg"%(Qb1/2300)
print"\n Rate of evaporation = %.3f kg/secs"%((3.03/5.28))
print"\n Mean rate of evaporation during the cycle = %.2f kg/secs"%((3.03*10**4)/((5.28*10**4)+(15*10**3)))
print"\n cost of one cyce = %.1f euro"%(5.28*10**(4)*0.018+600)
```