***************************************************************** *** Chapter 8 *** Section: Phase and Chemical Equilibrium Problems - Equations of State *** Test Problem 2 *** *** Van der Waals equation *** Tangent Plane distance minimization *** Ternary System ***************************************************************** SETS i components /1*3/ ***************************************************************** * P = pressure (bar) * T = temperature (K) * feedmf(i) = mole fraction of component i in candidate phase * feedz = compressibility of candidate phase * feedfc(i) = fugacity coefficient of component i in candidate phase * b(i) = Van der Waals pure-component parameter * a(i,j) = Van der Waals mixture parameter PARAMETERS P, T, feedmf(i), feedz, feedfc(i), b(i), a(i,j); P = 80.0; T = 400.0; feedmf('1') = 0.69; feedmf('2') = 0.155; feedmf('3') = 0.155; feedz = 0.331438; feedfc('1') = -0.214553; feedfc('2') = -1.67364; feedfc('3') = -0.319125; b('1') = 0.14998; b('2') = 0.14998; b('3') = 0.14998; a('1','1') = 0.37943; a('1','2') = 0.75885; a('1','3') = 0.48991; a('2','1') = 0.75885; a('2','2') = 0.88360; a('2','3') = 0.23612; a('3','1') = 0.48991; a('3','2') = 0.23612; a('3','3') = 0.63263; ******************************************************************* * dist = tangent plane distance * x(i) = mole fractio of component i in incipient phase * z = compressibility of incipient phase * amix = mixture A parameter (function of composition) * bmix = mixture B parameter (function of composition) VARIABLES dist, x(i), z, amix, bmix; ******************************************************************* * obj = objective (tangent plane distance) * eos = equation of state constraint * defa = definition of Amix * defb = definition of Bmix * molesum = mole fractions sum to 1 EQUATIONS obj eos defa defb molesum; obj.. dist =e= SUM(i, x(i)*LOG(x(i))) +bmix/(z-bmix) -LOG(z-bmix) -2.0*amix/z -SUM(i, x(i)*(LOG(feedmf(i))+feedfc(i))); eos.. POWER(z,3) - (bmix+1)*POWER(z,2) + amix*z - amix*bmix =e= 0; defa.. amix - SUM(i,SUM(j, a(i,j)*x(i)*x(j))) =e= 0; defb.. bmix - SUM(i, b(i)*x(i)) =e= 0; molesum.. SUM(i, x(i)) =e= 1.0; MODEL tpd /all/;