$TITLE SHALEXENVIROMENT - WATER PRE-TREATMENT * Just copy and paste on GAMS ------- $OFFSYMXREF $OFFSYMLIST option limrow = 10; option limcol = 10; option solprint = on; option sysout = off; option optcr = 0; option nlp = CONOPT; option MINLP = BARON; $eolcom % $ontext _______ F1________ ______ElECTROCOAGUL _________ ______SEDIMENTATION _________ ____ F2________ ---> CARTRIDGE FILTER---> | | | | | | | | | | | | | | | | | | ----> STRAINER ---> HYDROCYCLONE ------> COAGULATION ---> FLOCCULATOR ---> |--- GRANULAR FILTRATION------|---SOFTENING ------>|----> ULFILTRATION------->| ---> REVERSE OSMSIS | | | | | | | | |_________ F3 _____________| |___ DISSOLVED AIR FLORATION__| | | |------------------------------> WATER REUSE | |------------------------------> THERMAL TECHNOLOGY $offtext *======================================================================================================================================================================================================= Set i components /1 TDS 2 TSS 3 TOC 4 Fe 5 Ca 6 Mg 7 Ba 8 Oil/ j technologies /s sedimentations f flotation gf ganular filtration co coagulantion(FeCl3) sf Primary treatment cf catridge filtration uf ultrafiltration h hydrocyclone flo floculator t Filter press ec electrocoagulation sof softening (lime - soda ash)/ Area_SGFT(j) Area - sedimentation granular filtration and thickener /s, gf, t/ Volumen_COFLOSF(j) Volumen - coagulation flotation and granular filtration /co, flo, ec, sof/ Scale(i) /5,6,7/ gamma_equip(j) /s, f, h, sof, t/ gamma_equip_no_t(j) /s, f, h, sof/ no_gamma_equip(j) /gf, co, sf, cf, uf, flo, ec/ Sed_gf_flota(j) /s, gf, f/ Otras(j) /sf, cf, co, uf, h, flo, t, ec, sof/ ; Parameters R(i,j) Percentage removal gamma(j) percentage of solids in the sludge /s=0.45, f=0.05, h=0.40, sof=0.45, t=0.80/ * Water properties mud Dynamic viscosuty of water (Pa.s Ns:m2) /0.001518/ rho_w Density (kgm3) /1020/ rho_p Particle density (kgm3) /2500/ * Initial conditions ci0(i) Inital compositions A (kg:m3) /1=200, 2=3.220, 3=0.2, 4=0.092, 5=15.680, 6=4.730, 7=0.098, 8=0/ *ci0(i) Inital compositions B (kg:m3) /1=54.23, 2=0.881, 3=0.089, 4=0.060, 5=6.800, 6=1.707, 7=0.112, 8=0/ *ci0(i) Inital compositions C (kg:m3) /1=110.847, 2=1.530, 3=0.138, 4=0.105, 5=3.600, 6=0.899, 7=0.127, 8=0.018/ *ci0(i) Inital compositions E (kg:m3) /1=9.751, 2=0.168, 3=0.038, 4=0.04, 5=0.241, 6=0.049, 7=0.001, 8=0/ Qi0 Inlet flow (m3h)/25/ fi0(i) Inlet mass flow (kgh) fi0water Inlet water (kgh) Fi0total Total inlet flow (kgh) * Equipment design VelocityGradient(j) Velocity gradient (1:s) /co=600, flo=50/ DetentionTime(j) (min) /co=5, flo=30, ec=15, sof=30/ LoadingRate(j) Surfase loading rate (m:h) /s=3, f=10, gf=10, cf=0.25, uf=0.25, t=3/ H Water depth (m) /s=3, f=2/ Bradley Bradley ecuation (size of hydrocyclone needed to separate 90% of particles with a diameter greater than 20 microm) Xlime Soda-ash concentration (mg:L) Xsoda Soda-ash concentration (mg:L) * Cost Parameters Time Time working (h) /8760/ int Interest /0.1/ m Time horizon (year) /10/ CE Electricity cost (dolar:kwh) /0.06/ CostCo Coagulation cost ($:m3) /3.5/ CostLime Precipitation cost ($:kg) /0.070/ CostSoda Precipitation cost ($:kg) /0.165/ CostElec Electrocoagulation cost ($:m3) /0.26/ CostFresh Cost fresh water ($:m3) /3.14/ fac Annalized factor CostIndex(j) Cost index depend of the cost year for each equipment /s=218.8, f=218.8, gf=218.8, co=218.8, sf=218.8, cf=556.8, uf=218.8, h= 394.3, flo=218.8, t=218.8, ec=394.3, sof=394.3/ Updated ; Table R_co(i,j) Removal s f gf 1 0 0 0 2 37 37 37 3 51 51 51 4 8 8 8 5 0 0 0 6 0 0 0 7 0 0 0 8 0 100 0 ; Table R_ec(i,j) Removal s f gf 1 0 0 0 2 97 97 97 3 19 19 19 4 84 84 84 5 37 37 37 6 0 0 0 7 0 0 0 8 0 100 0 ; Table R(i,j) Removal co sf cf uf h flo t ec sof 1 0 0 0 0 0 0 90 0 0 2 0 0 100 100 73 0 90 0 0 3 0 0 20 20 0 0 90 0 0 4 0 0 90 90 0 0 90 0 0 5 0 0 0 0 0 0 90 0 100 6 0 0 0 0 0 0 90 0 100 7 0 0 0 0 0 0 90 0 100 8 0 0 0 0 0 0 90 0 0 ; fac = ((int*(1+int)**m)/((1+int)**m-1)); Updated(j) = (556.8/CostIndex(j)); Bradley = (14*((rho_p-rho_w))/(4.5*mud*1000))**0.33; * Initial conditions fi0(i) = ci0(i)*Qi0; fi0water = Qi0*rho_w - sum(i,fi0(i)); Fi0total = sum(i,fi0(i)) + fi0water; * Lime hydrated and soda ash required Xlime = ((ci0('5')/3*1000)/20 + (ci0('6')/3*1000)/12)*37; %Ca(OH)2 (Carbonate Hardness) XSoda = ((2*ci0('5')/3*1000)/20 + (2*ci0('6')/3*1000)/12)*53; %Na2CO3 (Non-Carbonate Hardness) display Xlime, XSoda, fi0water, Fi0total, gamma; Positive variables fu(i,j) Sludge flowrate of component i in equipment j (kg:h) ff(i,j) Outlet flowrate of component i in equipment j (kg:h) fi(i,j) Inlet component flowrate of component i in equipment j (kg:h) Futotal(j) Total sludge flowrate of equipment j (kg:h) Fftotal(j) Total outlet flowrate of equipment j (kg:h) Fitotal(j) Total inlet flowrate of equipment j (kg:h) fuwater(j) Outlet water flowrate of equipment j (kg:h) ffwater(j) Sludge water flowrate of equipment j (kg:h) fiwater(j) Inlet water flowrate of equipment j (kg:h) A(j) Equipment area (m2) V(j) Volumen (m3) fiRO(i) Inlet flowrate of component i to Reverse Osmosis (kg:h) fiROwater Water Inlet flowrate to Reverse Osmosis (kg:h) FiROtotal Total inlet flowrate to Reverse Osmosis (kg:h) fiThermal(i) Inlet flowrate of component i to Thermal Technology (kg:h) fiThermalwater Water Inlet flowrate to Thermal Technology (kg:h) FiThermaltotal Total inlet flowrate to Thermal Technology (kg:h) fReuse(i) Inlet flowrate of component i to reuse (kg:h) fReusewater Water Inlet flowrate to reuse (kg:h) FReusetotal Total inlet flowrate to reuse (kg:h) f1(i) Bypass hydrocyclone - Flowrate of component i (kg:h) f1water Bypass hydrocyclone - Flowrate of water (kg:h) F1total Bypass hydrocyclone - Total flowrate (kg:h) f2(i) Flowrate of component i (kg:h) f2water Flowrate of water (kg:h) F2total Total flowrate (kg:h) dh(j) Hydrocyclon diameter (m) Fresh f3(i) f3water F3total ff_m1(i,j) ff_m2(i,j) fi_m1(i,j) fi_m2(i,j) ; Binary variables y_h, y_s, y_f, y_gf, y_uf, y_cf, ybaypass_1, ybaypass_3, y_co, y_ec, y_flo, ymembrane, yreuse, ythermal, y_co_2(j), y_ec_2(j), y_sof , ybaypass_2 ; Variables TAC; Equations logic01, logic02, logic03, logic04, logic05, logic06,logic07, logic08, logic09 B10, B20, B30, B40, B50, B60, B70, B80, B90, B100, B110, B120, B130, B140, B150, Eq10, Eq20, Eq30, Eq40, Eq41, Eq42, Eq43, Eq44, Eq45, Eq46, Eq47, Eq48, Eq50, Eq70, Eq80, Eq90, Eq100, Eq110, Eq120, Eq130, Eq140, Eq150, Eq160, Eq170, Eq180, Eq190, Eq200, Eq210, Eq220, Eq230, Eq240, Eq250, Eq260, Eq270, Eq280, Eq290, Eq300, Eq310, Eq320, Eq330, Eq340, Eq350, Eq360, Eq370, Eq380, Eq390, Eq400, Eq410, Eq420, Eq430, Eq440, Eq450, Eq460, Eq470 size1, size2, size3, size4, size5, size6, C1, C2, C3, C4, C5 C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, Obj ; * LOGIC PROPOSITIONS yreuse.fx = 1; ymembrane.fx = 0; ythermal.fx = 0; logic01.. y_h + ybaypass_1 =E= 1; logic02.. y_s + y_f + y_gf =E= 1; logic03.. (y_uf + y_cf + ybaypass_3) =L= ymembrane; logic04.. y_co + y_ec =E= 1; logic05.. y_co =L= y_flo; logic06.. yreuse + ythermal + ymembrane =E= 1; logic07.. sum(j, y_co_2(j)) =E= y_co; logic08.. sum(j, y_ec_2(j)) =E= y_ec; logic09.. y_sof + ybaypass_2 =G= 1; y_co_2.fx(j)$(Otras(j)) = 0; y_ec_2.fx(j)$(Otras(j)) = 0; parameter Mtotal, Mwater, MComp(i); Mtotal = 2*Fi0total; Mwater = 2*Fi0water; MComp(i) = 2*Fi0(i); ; * HYDROCYCLON B10.. Fitotal('h') =L= Mtotal*y_h; * SEDIMENTATION B20.. Fitotal('s') =L= Mtotal*y_s; * FLOTATION B30.. Fitotal('f') =L= Mtotal*y_f; * GRANULAR FILTRATION B40.. Fitotal('gf') =L= Mtotal*y_gf; * ULTRAFILTRATION B50.. Fitotal('uf') =L= Mtotal*y_uf; * CARTRIDGE FILTER B60.. Fitotal('cf') =L= Mtotal*y_uf; * BYPASS-1 B70.. F1total =L= Mtotal*ybaypass_1; * BYPASS-2 B80.. F3total =L= Mtotal*ybaypass_3; * COAGULATION B90.. Fitotal('co') =L= Mtotal*y_co; * ELECTROCOAGULATION B100.. Fitotal('ec') =L= Mtotal*y_ec; * SOFTENING B110.. Fitotal('sof') =L= Mtotal*y_sof; * BYPASS-3 B150.. F2total =L= Mtotal*ybaypass_2; B120.. Freusetotal =L= Mtotal*yreuse; B130.. FiROtotal =L= Mtotal*ymembrane; B140.. Fithermaltotal =L= Mtotal*ythermal; *------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * Inlet stream Filter Press Eq10(i).. Fi(i,'t') =E= sum(j $(gamma_equip_no_t(j)), fu(i,j)); Eq20.. Fitotal('t') =E= sum(j $(gamma_equip_no_t(j)), futotal(j)); Eq30.. Fiwater('t') =E= sum(j $(gamma_equip_no_t(j)), fuwater(j)); * Equipment equations eq40(i,j)$(Otras(j)).. ff(i,j) =E= (100 - R(i,j))/100*fi(i,j); eq41(i,j)$(Sed_gf_flota(j)).. ff(i,j) =E= ff_m1(i,j) + ff_m2(i,j) ; eq42(i,j)$(Sed_gf_flota(j)).. fi(i,j) =E= fi_m1(i,j) + fi_m2(i,j) ; eq43(i,j)$(Sed_gf_flota(j)).. ff_m1(i,j) =E= (100 - R_co(i,j))/100*fi_m1(i,j); eq44(i,j)$(Sed_gf_flota(j)).. ff_m2(i,j) =E= (100 - R_ec(i,j))/100*fi_m2(i,j); eq45(i,j)$(Sed_gf_flota(j)).. fi_m1(i,j) =L= 0.5*Fi0total*y_co_2(j); eq46(i,j)$(Sed_gf_flota(j)).. fi_m2(i,j) =L= 0.5*Fi0total*y_ec_2(j); eq47(i,j)$(Sed_gf_flota(j)).. ff_m1(i,j) =L= 0.5*Fi0total*y_co_2(j); eq48(i,j)$(Sed_gf_flota(j)).. ff_m2(i,j) =L= 0.5*Fi0total*y_ec_2(j); eq50(i,j).. ff(i,j) + fu(i,j) =E= fi(i,j) ; eq70(j)$(gamma_equip(j)).. fuwater(j) =E= (1 - gamma(j))*sum(i, fu(i,j))/gamma(j); fuwater.fx(j)$(no_gamma_equip(j)) = 0; eq80(j).. ffwater(j) + fuwater(j) =E= fiwater(j) ; * Overall balances eq90(j).. Fitotal(j) =E= Fftotal(j) + Futotal(j); eq100(j).. Futotal(j) =E= fuwater(j) + sum(i,fu(i,j)); eq110(j).. Fftotal(j) =E= ffwater(j) + sum(i,ff(i,j)); eq120.. F1total =E= f1water + sum(i,f1(i)); eq130.. F2total =E= f2water + sum(i,f2(i)); eq140.. FiThermaltotal =E= fiThermalwater + sum(i,fiThermal(i)); eq150.. FReusetotal =E= fReusewater + sum(i,fReuse(i)); eq160.. FiROtotal =E= FiROwater + sum(i,fiRO(i)); * Feed eq170(i).. fi(i,'sf') =E= fi0(i) ; eq180.. fiwater('sf') =E= fi0water ; eq190.. Fitotal('sf') =E= Fi0total ; * Node 1 eq200(i).. ff(i,'sf') + Ff(i,'t') =E= f1(i) + fi(i,'h'); eq210.. ffwater('sf') + Ffwater('t') =E= f1water + fiwater('h'); eq220.. Fftotal('sf') + Fftotal('t') =E= F1total + Fitotal('h'); * Node 2 eq230(i).. f1(i) + ff(i,'h') =E= fi(i,'co') + fi(i,'ec') ; eq240.. f1water + ffwater('h') =E= fiwater('co')+ fiwater('ec') ; eq250.. f1total + Fftotal('h') =E= Fitotal('co')+ Fitotal('ec') ; eq260(i).. ff(i,'co') =E= fi(i,'flo'); eq270.. ffwater('co') =E= fiwater('flo'); eq280.. Fftotal('co') =E= Fitotal('flo'); * Node 3 eq290(i).. ff(i,'flo') + ff(i,'ec') =E= fi(i,'s') + fi(i,'f') + fi(i,'gf'); eq300.. ffwater('flo')+ ffwater('ec') =E= fiwater('s') + fiwater('f') + fiwater('gf'); eq310.. Fftotal('flo')+ Fftotal('ec') =E= Fitotal('s') + Fitotal('f') + Fitotal('gf'); * Node 4 eq320(i).. ff(i,'s') + ff(i,'f') + ff(i,'gf') =E= fi(i,'sof') + f2(i); eq330.. ffwater('s') + ffwater('f') + ffwater('gf') =E= fiwater('sof') + f2water; eq340.. Fftotal('s') + Fftotal('f') + Fftotal('gf') =E= fitotal('sof') + f2total; eq350(i).. ff(i,'s')*fitotal('sof') =E= fi(i,'sof')*Fftotal('s'); eq360(i).. ff(i,'f')*fitotal('sof') =E= fi(i,'sof')*Fftotal('f'); eq370(i).. ff(i,'gf')*fitotal('sof') =E= fi(i,'sof')*Fftotal('gf'); eq380(i).. ff(i,'s')*f2total =E= f2(i)*Fftotal('s'); eq390(i).. ff(i,'f')*f2total =E= f2(i)*Fftotal('f'); eq400(i).. ff(i,'gf')*f2total =E= f2(i)*Fftotal('gf'); * Node 5 eq410(i).. ff(i,'sof') + f2(i) =E= fi(i,'cf') + fi(i,'uf') + fiThermal(i) + fReuse(i) + f3(i); eq420.. ffwater('sof') + f2water =E= fiwater('cf') + fiwater('uf') + fiThermalwater + fReusewater + f3water; eq430.. fftotal('sof') + f2total =E= Fitotal('cf') + Fitotal('uf') + FiThermaltotal + FReusetotal + f3total; * Node 6 eq440(i).. ff(i,'cf') + ff(i,'uf') + f3(i) =E= fiRO(i); eq450.. ffwater('cf') + ffwater('uf') + f3water =E= fiROwater; eq460.. Fftotal('cf') + Fftotal('uf') + F3total =E= FiROtotal; * Equipment Area Size1(j)$( Area_SGFT(j)).. A(j) =E= Fitotal(j)/rho_w/LoadingRate(j); Size2.. A('f') =E= (Fitotal('f') + Fitotal('f')*0.08)/rho_w/LoadingRate('f'); * Equipment Volume Size3(j)$(Volumen_COFLOSF(j)).. V(j) =E= Fitotal(j)*DetentionTime(j)/(rho_w*60); Size4.. V('f') =E= A('f')*H('f'); Size5.. Dh('h') =E= (Bradley*((Fitotal('h')/rho_w)*1000/60)**0.17)/100; % caudal en Lmin y diametro en m Size6.. V('h') =E= 1.096*Dh('h') - 0.346*y_h; Fresh.lo = 0.001; Obj.. TAC =E= * Cost EPA + (500 * Sedimentation +(536.64*A('s') + 30289*y_s)*fac*Updated('s') * Dissolved Air Flotation +(-0.1502*V('f')**2 + 1138*V('f') + 49401*y_f)*fac*Updated('f') * Granular Filtration +(-10.875*A('gf')**2+5459.6*A('gf')+97749*y_gf + 161.62*A('gf')+ 7806*y_gf)*fac*Updated('gf') * Coagulation +(434.4*V('co') + 11350*y_co)*fac*Updated('co') +(Fitotal('co')/rho_w)*CostCo*Time * Hydrocyclone (Turton) +(322278.1*V('h') + 11068*y_h)*fac*Updated('h') * Cartridge Filtration +2*(0.000002*Fitotal('cf')**2-0.0359*Fitotal('cf')+1697*y_cf)*fac*Updated('cf') +(0.0018*600**2-0.2818*600+329.5)*(Fitotal('cf')/600)*12 * Ultrafiltration + 2*(4.3067*Fitotal('uf')+17857*y_uf)*fac*Updated('uf') * Flocculation +(-0.3924*V('flo')**2 + 473.16*V('flo') + 11890*y_flo)*fac*Updated('flo') * Gravity Sludge Thickeners + (-0.372*A('t')+428.51*A('t')+42464)*fac*updated('t') * Electrocoagulation + CostElec*(Fitotal('ec')/rho_w)*Time + (2774.4*V('ec') + 7288.4*y_ec)*fac*Updated('ec') * Softening + (434.4*V('sof') + 11350*y_sof)*fac*Updated('sof') + (Fitotal('sof')/rho_w)*CostSoda*Xsoda*Time/1000 + (Fitotal('sof')/rho_w)*Costlime*Xlime*Time/1000)/1000; *------------------------------------------------------------------------------------------------------------------------------ fu.l(i,j) = 0.1*Fi0(i); ff.l(i,j) = 0.9*Fi0(i); fi.l(i,j) = Fi0(i); Eq470.. Fi('2','gf') =L= 0.1*((Fitotal('gf'))/rho_w); C1(i).. freuse(i)$(Scale(i)) =L= 2.500*(Fi0total + Fresh)/rho_w; C2.. freuse('2') =L= 0.05*(FReusetotal + Fresh)/rho_w; C3.. freuse('4') =L= 0.035*(FReusetotal + Fresh)/rho_w; C4.. freuse('8') =L= 0.025*(FReusetotal + Fresh)/rho_w; C5$(ci0('1')>= 50) .. freuse('1') =E= 50*(Freusetotal + Fresh)/rho_w; Fresh.fx$(ci0('1')< 50) = 0; C6(i).. fiRO('5') =L= 0.000013/2.5*(FiROtotal)/rho_w; C7(i).. fiRO('6') =L= 0.000024/1.4373*(FiROtotal)/rho_w; C8(i).. fiRO('7') =L= 0.106/3.47*(FiROtotal)/rho_w; C9.. fiRO('2') =L= 0.05*(FiROtotal)/rho_w; C10.. fiRO('4') =L= 0.05*(FiROtotal)/rho_w; C11.. fiRO('8') =L= 0.01*(FiROtotal)/rho_w; C12$(ci0('1')>= 35).. fiRO('1') =E= 35*(FiROtotal)/rho_w; C13(i).. fiThermal('5') =L= 0.000013/2.5/2*(FiThermaltotal)/rho_w; C14(i).. fiThermal('6') =L= 0.000024/1.4373/2*(FiThermaltotal)/rho_w; C15(i).. fiThermal('7') =L= 0.106/3.47/2*(FiThermaltotal)/rho_w; *C12.. fiThermal('2') =L= 0.8*FiThermaltotal/rho_w; *C13.. fiThermal('4') =L= 0.2*FiThermaltotal/rho_w; C16.. fiThermal('8') =L= 0.01*FiThermaltotal/rho_w; model REUSE / logic01, logic02, logic03, logic04, logic05, logic06, logic07, logic08, logic09 B10, B20, B30, B40, B50, B60, B70, B80, B90, B100, B110, B120, B130, B140, B150, Eq10, Eq20, Eq30, Eq40, Eq50, Eq41, Eq42, Eq43, Eq44, Eq45, Eq46, Eq47, Eq48, Eq70, Eq80, Eq90, Eq100, Eq110, Eq120, Eq130, Eq140, Eq150, Eq160, Eq170, Eq180, Eq190, Eq200, Eq210, Eq220, Eq230, Eq240, Eq250, Eq260, Eq270, Eq280, Eq290, Eq300, Eq310, Eq320, Eq330, Eq340, Eq350, Eq360, Eq370, Eq380, Eq390, Eq400, Eq410, Eq420, Eq430, Eq440, Eq450, Eq460, Eq470 size1, size2, size3, size4, size5, size6, C1, C2, C3, C4,C5 * C6, C7, C8, C9, C10, C11, C12, * C13, C14, C15, C16, Obj / SOLVE REUSE USING MINLP minimizing TAC; *------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Parameter CAPEX(j), OPEX(j), aa, bb, cc, Total(j), Totaltotal, Cost_Fresh_Water, CapexTotal, OpexTotal, Fsludge ; * Cost EPA CAPEX('sf') = 500; * Sedimentation CAPEX('s') = (536.64*A.l('s') + 30289*y_s.l)*fac*Updated('s'); * Dissolved Air Flotation CAPEX('f') = (-0.1502*V.l('f')**2 + 1138*V.l('f') + 49401*y_f.l)*fac*Updated('f'); * Granular Filtration CAPEX('gf') = 2*(-10.875*A.l('gf')**2+5459.6*A.l('gf')+97749*y_gf.l + 161.62*A.l('gf')+ 7806*y_gf.l)*fac*Updated('gf'); * Coagulation CAPEX('co') = (434.4*V.l('co') + 11350*y_co.l)*fac*Updated('co'); OPEX('co') = (Fitotal.l('co')/rho_w)*CostCo*Time; * Hydrocyclone (Turton) CAPEX('h') = (322278.1*V.l('h')*y_h.l + 11068*y_h.l)*fac*Updated('h'); * Cartridge Filtration CAPEX('cf')= 2*(0.000002*Fitotal.l('cf')**2-0.0359*Fitotal.l('cf')+1697*y_cf.l)*fac*Updated('cf'); OPEX('cf') = (0.0018*600**2-0.2818*600+329.5)*(Fitotal.l('cf')/600)*12; * Ultrafiltration CAPEX('uf') = 2*(4.3067*Fitotal.l('uf')+17857*y_uf.l)*fac*Updated('uf'); * Flocculation CAPEX('flo') = (-0.3924*V.l('flo')**2 + 473.16*V.l('flo') + 11890*y_flo.l)*fac*Updated('flo'); * Mechanical gravity thickening CAPEX('t') = (-0.372*A.l('t')+428.51*A.l('t')+42464)*fac*updated('t'); * Electrocoagulation CAPEX('ec') = (2774.4*V.l('ec') + 7288.4*y_ec.l)*fac*Updated('ec'); OPEX('ec') = CostElec*(Fitotal.l('ec')/rho_w)*Time; * Cost Fresh water Cost_Fresh_Water = CostFresh*(Fresh.l/rho_w)*Time ; * Softening CAPEX('sof') = (434.4*V.l('sof') + 11350*y_sof.l)*fac*Updated('sof'); OPEX('sof') = (Fitotal.l('sof')/rho_w)*CostSoda*Xsoda/1000*Time + (Fitotal.l('sof')/rho_w)*Costlime*Xlime/1000*Time; Total(j) = Capex(j) + opex(j); CapexTotal = sum(j,Capex(j)); OpexTotal = sum(j,Opex(j)); Totaltotal = sum(j,total(j))+ Cost_Fresh_Water; Display Total, Cost_Fresh_Water, CapexTotal, OpexTotal, FiROtotal.l, FiThermaltotal.l, FReusetotal.l, Fresh.l, CAPEX, OPEX, Fitotal.l; *------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- execute_unload "Pretreatment - Results"