* Heat exchanger network synthesis * Yee and Grossmann, 1991. SCALAR ns number of temperature intervals / 2 /; * Sets SET k ns+1 /1*3/; SET i set of hot streams /1*2/; SET j set of cold streams /1*2/; ALIAS (k,kk); * Parameters SCALAR unitc fixed cost of a heat exchanger / 5500 /; SCALAR acoeff area-dependent cost coefficient for stream-stream exchangers / 150 /; SCALAR hucoeff area-dependent cost coefficient for cold stream-utility exchangers / 150 /; SCALAR cucoeff area-dependent cost coefficient for hot stream-utility exchangers / 150 /; SCALAR hucost steam utility cost / 80 /; SCALAR cucost cooling water utility cost / 15 /; SCALAR cfhu film heat transfer coefficient for hot utility / 5 /; SCALAR cfcu film heat transfer coefficient for cold utility / 1 /; SCALAR thuin inlet temperature of hot utility / 680 /; SCALAR thuout outlet temperature of hot utility / 680 /; SCALAR tcuin inlet temperature of cold utility / 300 /; SCALAR tcuout outlet temperature of cold utility / 320 /; PARAMETER cfi(i) film heat transfer coefficient for hot stream i / '1' 1.0 '2' 1.0/; PARAMETER cfj(j) film heat transfer coefficient for cold stream j / '1' 1.0 '2' 1.0/; PARAMETER dtmax(i,j,k) maximum temperature difference between streams i and j in interval k / '1'.'1'.'1' 280 '1'.'1'.'2' 130 '1'.'2'.'1' 280 '1'.'2'.'2' 150 '2'.'1'.'1' 280 '2'.'1'.'2' 130 '2'.'2'.'1' 280 '2'.'2'.'2' 150/; PARAMETER fci(i) flowrate heat capacity for stream i / '1' 10 '2' 20/; PARAMETER fcj(j) flowrate heat capacity for stream j / '1' 15 '2' 13/; PARAMETER tiin(i) inlet temperature for hot stream i / '1' 650 '2' 590/; PARAMETER tiout(i) outlet temperature for hot stream i / '1' 370 '2' 370/; PARAMETER tjin(j) inlet temperature for cold stream i / '1' 410 '2' 350/; PARAMETER tjout(j) outlet temperature for cold stream i / '1' 650 '2' 500/; PARAMETER mqiqj(i,j) minimum heat duty for streams i and j ; PARAMETER qci(i) heat duty for stream i; PARAMETER qcj(j) heat duty for stream j; qci(i) = (fci(i))*(tiin(i) - tiout(i)); qcj(j) = (fcj(j))*(tjout(j) - tjin(j)); mqiqj(i,j) = MIN(qci(i), qcj(j)); VARIABLES tki(i,kk) temperature of hot stream i at temperature location kk tkj(j,kk) temperature of cold stream j at temperature location kk q(i,j,k) heat exchanged between streams i and j in temperature interval k qcold(i) heat exchanged between stream i and the cold utility qhot(j) heat exchanged between stream j and the hot utility dt(i,j,kk) temperature difference between streams i and j at temperature location kk dtcu(i) temperature difference between stream i and the cold utility dthu(j) temperature difference between stream j and the hot utility z(i,j,k) existence of heat exchanger between streams i and j in temperature interval k zcu(i) existence of heat exchanger between stream i and the cold utility zhu(j) existence of heat exchanger between stream j and the hot utility objval objective function variable; FREE VARIABLES objval; BINARY VARIABLE z; BINARY VARIABLE zcu; BINARY VARIABLE zhu; EQUATIONS f Objective function l1(i) overall heat balance for stream i l2(j) overall heat balance for stream j l3(i,k) heat balance for stream i in interval k l4(j,k) heat balance for stream j in interval k l5(i) assignment of inlet temperature for stream i l6(j) assignment of inlet temperature for stream j l7(i,k) feasibility of temperature change for stream i in interval k l8(j,k) feasibility of temperature change for stream j in interval k l9(i) feasibility of temperature change for stream i around cold utility l10(j) feasibility of temperature change for stream j around hot utility l11(i) hot utility load l12(j) cold utility load l13(i,j,k) logical constraints on heat duty q l14(i) logical constraints on heat duty qcu l15(j) logical constraints on heat duty qhu l16(i,j,k) temperature difference calculation for streams i and j in interval k l17(i,j,k) temperature difference calculation for streams i and j in interval k l18(i) temperature difference calculation for stream i and cold utility l19(j) temperature difference calculation for stream j and hot utility; f .. objval =e= SUM((i,j,k,kk)$((ORD(k) LE ns) AND (ORD(kk) EQ (ORD(k)+1))),acoeff*q(i,j,k)*(1/cfi(i)+1/cfj(j))/(dt(i,j,k)*dt(i,j,kk)*(dt(i,j,k)+dt(i,j,kk))/2)**0.3333) + SUM(i,cucoeff*qcold(i)*(1/cfi(i) + 1/cfcu) / ((tiout(i)-tcuin)*dtcu(i)*(tiout(i)-tcuin+dtcu(i))/2)**0.33333) + SUM(j,hucoeff*qhot(j)*(1/cfj(j)+1/cfhu) / ((thuin-tjout(j))*dthu(j)*(thuin-tjout(j)+dthu(j))/2)**0.33333) + SUM((i,j,k)$(ORD (k) LE ns), unitc*z(i,j,k)) + SUM(i,unitc*zcu(i)) + SUM(j,unitc*zhu(j)) + SUM(j,hucost*qhot(j)) + SUM(i,cucost*qcold(i)); l1(i) .. SUM((k,j)$(ORD(k) LE ns),q(i,j,k)) + qcold(i) =e= (tiin(i) - tiout(i))*(fci(i)); l2(j) .. SUM((k,i)$(ORD(k) LE ns),q(i,j,k)) + qhot(j) =e= (tjout(j) - tjin(j))*(fcj(j)); l3(i,k)$(ORD(k) LE ns) .. fci(i)*tki(i,k) - fci(i)*SUM(kk$(ORD(kk) EQ ORD(k)+1),tki(i,kk)) =e= SUM(j,q(i,j,k)); l4(j,k)$(ORD(k) LE ns) .. fcj(j)*tkj(j,k) - fcj(j)*SUM(kk$(ORD(kk) EQ ORD(k)+1),tkj(j,kk)) =e= SUM(i,q(i,j,k)); l5(i) .. tki(i,'1') =e= tiin(i); l6(j) .. tkj(j,'3') =e= tjin(j); l7(i,k)$(ORD(k) LE ns) .. -tki(i,k) + SUM(kk$(ORD(kk) EQ ORD(k)+1),tki(i,kk)) =l= 0; l8(j,k)$(ORD(k) LE ns) .. -tkj(j,k) + SUM(kk$(ORD(kk) EQ ORD(k)+1),tkj(j,kk)) =l= 0; l9(i) .. -tki(i,'3') =l= -tiout(i); l10(j) .. tkj(j,'1') =l= tjout(j); l11(i) .. fci(i)*tki(i,'3') - qcold(i) =e= tiout(i)*fci(i); l12(j) .. fcj(j)*tkj(j,'1') + qhot(j) =e= tjout(j)*fcj(j); l13(i,j,k)$(ORD(k) LE ns) .. q(i,j,k) - mqiqj(i,j)*z(i,j,k) =l= 0; l14(i) .. qcold(i) - qci(i)*zcu(i) =l= 0; l15(j) .. qhot(j) - qcj(j)*zhu(j) =l= 0; l16(i,j,k)$(ORD(k) LE ns) .. dt(i,j,k) - tki(i,k) + tkj(j,k) + dtmax(i,j,k)*z(i,j,k) =l= dtmax(i,j,k); l17(i,j,k)$(ORD(k) LE ns) .. SUM(kk$(ORD(kk) EQ ORD(k)+1),dt(i,j,kk) - tki(i,kk) + tkj(j,kk)) + dtmax(i,j,k)*z(i,j,k) =l= dtmax(i,j,k); l18(i) .. dtcu(i) - tki(i,'3') =l= -tcuout; l19(j) .. dthu(j) + tkj(j,'1') =l= thuout; * Bounds qhot.LO(j) = 0; qcold.LO(i) = 0; q.LO(i,j,k) = 0; dt.LO(i,j,kk) = 10; dtcu.LO(i) = 10; dthu.LO(j) = 10; tki.UP(i,k) = tiin(i); tki.LO(i,k) = tiout(i); tkj.LO(j,k) = tjin(j); tkj.UP(j,k) = tjout(j); * Starting point (global solution) * tki.L('1','1') = 650; * tki.L('1','2') = 581.77; * tki.L('1','3') = 386.77; * tki.L('2','1') = 590; * tki.L('2','2') = 590; * tki.L('2','3') = 468.67; * tkj.L('1','1') = 617.26; * tkj.L('1','2') = 571.77; * tkj.L('1','3') = 410; * tkj.L('2','1') = 500; * tkj.L('2','2') = 500; * tkj.L('2','3') = 350; * q.L('1','1','1') = 682.31; * q.L('1','1','2') = 0; * q.L('1','2','1') = 0; * q.L('1','2','2') = 1950; * q.L('2','1','1') = 0; * q.L('2','1','2') = 2426.53; * q.L('2','2','1') = 0; * q.L('2','2','2') = 0; * qcold.L('1') = 167.69; * qcold.L('2') = 1973.47; * qhot.L('1') = 491.16; * qhot.L('2') = 0; * dt.L('1','1','1') = 32.74; * dt.L('1','1','2') = 10; * dt.L('1','2','2') = 81.77; * dt.L('1','2','3') = 36.77; * dt.L('2','1','2') = 18.23; * dt.L('2','1','3') = 58.67; * dtcu.L('1') = 66.77; * dtcu.L('2') = 148.67; * dthu.L('1') = 62.74; * z.L('1','1','1') = 1; * z.L('1','2','2') = 1; * z.L('2','1','2') = 1; * zcu.L('1') = 1; * zcu.L('2') = 1; * zhu.L('1') = 1; MODEL test /ALL/; SOLVE test USING MINLP MINIMIZING objval;