Skip to content

Commit

Permalink
Model codes update
Browse files Browse the repository at this point in the history
1. update MED empirical equations
2. update cooling water flow rate calculation
3. modify input tables of VAGMD and RO cost models
4. minor improvements
  • Loading branch information
Zhuoran29 committed Apr 1, 2022
1 parent ceaa02b commit bb1ce25
Show file tree
Hide file tree
Showing 56 changed files with 16,389 additions and 709 deletions.
70 changes: 47 additions & 23 deletions DesalinationModels/ABS.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import numpy as np
import math
import DesalinationModels.IAPWS97_thermo_functions as TD_func
from DesalinationModels.LT_MED_calculation import lt_med_calculation
from scipy.optimize import fmin
from DesalinationModels.VAGMD_batch.SW_functions import SW_Density
# from DesalinationModels.LT_MED_calculation import lt_med_calculation
from scipy.optimize import fmin
from DesalinationModels.VAGMD_batch.SW_functions import SW_Density, BPE, SW_Enthalpy
from iapws import IAPWS97, SeaWater

class ABS(object):

Expand Down Expand Up @@ -112,31 +112,55 @@ def design(self):



self.STEC = 1/self.GOR * (TD_func.enthalpySatVapTW(self.Ts+273.15)-TD_func.enthalpySatLiqTW(self.Ts+273.15))[0] *1000/3600
self.P_req = 1/self.GOR * (TD_func.enthalpySatVapTW(self.Ts+273.15)-TD_func.enthalpySatLiqTW(self.Ts+273.15))[0] *self.Capacity *1000/24/3600
self.T_d = self.Tin + 10 # Brine temperature at last effect

# Calculate cooling water flow rate
Q_loss = 0.054 # System thermal loss

# mass balance
q_d = self.Capacity / 24 # Hourly distillate production (m3/hr)
self.q_feed = q_d / self.RR # Feed seawater flow rate (m3/hr)
q_b = self.q_feed - q_d # Brine flow rate (m3/hr)

self.s_b = self.Xf /1000/ (1- self.RR) # brine salinity (g/L)

# BPE calculation
SW_BPE = BPE(self.T_d, self.s_b)

self.T_b = self.T_d + SW_BPE # brine temperature
self.T_cool = self.T_d - 3 # cooling reject temperature (Assume DHTP = 3)

self.T_d = self.Tin + 10
self.T_b = self.T_d + 1
self.DTPH = 3
self.T_cool = self.T_d - self.DTPH
self.h_b = TD_func.enthalpyreg1(self.T_b + 273.15, 1) # Enthalpy of the flow at brine temperature
self.h_sw = TD_func.enthalpyreg1(self.Tin + 273.15, 1)
self.h_d = TD_func.enthalpyreg1(self.T_d + 273.15, 1)
self.h_cool = TD_func.enthalpyreg1(self.T_cool + 273.15, 1)
# densities
rho_b = SW_Density(self.T_b,'c',self.s_b*1000,'ppm',1,'bar') # brine density
rho_d = SW_Density(self.T_d,'c',0,'ppm',1,'bar') # distillate density
rho_sw= SW_Density(self.Tin,'c',self.Xf,'ppm',1,'bar') # seawater density
rho_f = SW_Density(self.T_cool,'c',self.Xf,'ppm',1,'bar') # cooling reject density

brine_s = self.Xf / 1000 / (1- self.RR)
self.brine_d = SW_Density(self.T_b,'c',brine_s,'ppt',1,'bar')
self.distillate_d = SW_Density(self.T_b,'c',0,'ppm',1,'bar')
self.average_d = self.brine_d * self.RR + self.distillate_d * (1-self.RR)
# enthalpies
h_d = IAPWS97(T=273.15+ self.T_d,x=0).h
h_b = SW_Enthalpy(self.T_b, self.s_b)/ 1000
h_sw = SW_Enthalpy(self.Tin, self.Xf/1000)/ 1000
h_cool = SW_Enthalpy(self.T_cool, self.Xf/1000)/ 1000

# energy consumption
self.STEC = 1/self.GOR * (TD_func.enthalpySatVapTW(self.Ts+273.15)-TD_func.enthalpySatLiqTW(self.Ts+273.15))[0] *rho_d/3600
self.P_req = self.STEC *self.Capacity /24

# mass flow rates
self.m_d = q_d * rho_d / 3600 # distillate mass flow rate (kg/s)
self.m_b = q_b * rho_b / 3600 # brine mass flow rate (kg/s)
self.m_f = self.q_feed * rho_f / 3600 # feed mass flow rate (kg/s)
self.m_sw = ((1-Q_loss)*self.P_req - self.m_b * h_b - self.m_d * h_d + h_cool * self.m_f) / (h_cool - h_sw) # intake + cooling water mass flow rate (kg/s)


# volume flow rates
self.q_sw = self.m_sw / rho_sw * 3600 # m3/h
self.q_cooling = self.q_sw - self.q_feed


self.PR = 2326 / self.STEC * 1000 /3600

# Calculate cooling water flow rate
self.q_cooling = (0.85 * self.P_req * 3600 - self.brine_d * self.qF * (1- self.RR) * self.h_b - self.distillate_d * self.qF * self.RR * self.h_d + self.qF * self.average_d * self.h_sw ) / (self.h_cool - self.h_sw)

self.PR = 2326 / self.STEC * 1000 /3600
self.T_b = 37 # Brine temperature at last effect (T_b = T_d = T_cool = T_cond)
# Add ABS
pp1 = self.Tcond
pp2 = self.Ts
Expand Down Expand Up @@ -201,8 +225,8 @@ def design(self):
self.design_output.append({'Name':'Brine concentration','Value':brine_s,'Unit':'g/L'})

self.design_output.append({'Name':'Feedwater flow rate','Value':self.qF,'Unit':'m3/h'})
# if self.q_cooling[0] > 0:
# self.design_output.append({'Name':'Cooling water flow rate','Value':self.q_cooling[0] / 1000,'Unit':'m3/h'})
if self.q_cooling> 0:
self.design_output.append({'Name':'Cooling water flow rate','Value':self.q_cooling ,'Unit':'m3/h'})
self.design_output.append({'Name':'The mass flow rate of the steam','Value':self.qs,'Unit':'kg/s'})
self.design_output.append({'Name':'Specific heat transfer area of MED','Value':self.sA,'Unit':'m2/m3/day'})
self.design_output.append({'Name':'Specific heat transfer area of the absorption heat pump','Value':self.sA_pump,'Unit':'m2/kW'})
Expand Down
Loading

0 comments on commit bb1ce25

Please sign in to comment.