# Changeset 407

Ignore:
Timestamp:
Nov 19, 2007, 11:52:18 AM (15 years ago)
Message:

Better naming conventions for gibbs simple examples

File:
1 edited

Unmodified
Removed
• ## trunk/sample/miscellaneous/sample_gibbs_reactor_simple.mso

 r402 outer NComp     as Integer (Brief="Number of components", Default=1); stoic(NComp) as Real; nu(NComp) as Real; R  as Real(Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); T as temperature; P as pressure; ni(NComp) as positive(Brief="Initial number of mols", Unit='mol'); n(NComp)  as positive(Brief="Number of mols at equilibrium", Unit='mol', Upper=10); advance   as Real(Unit='mol', Lower=-10, Upper=10); K  as Real(Brief="Reaction equilibrium constant at T"); K0 as Real(Brief="Reaction equilibrium constant at T0"); K1 as Real(Brief="Reaction equilibrium constant correction from T0 to T"); n0(NComp) as positive(Brief="Initial number of mols", Unit='mol'); n(NComp)  as positive(Brief="Number of mols at equilibrium", Unit='mol'); advance   as Real(Unit='mol'); K  as positive(Brief="Reaction equilibrium constant at T"); K0 as positive(Brief="Reaction equilibrium constant at T0"); phi(NComp)      as fugacity(Brief="Fugacity coefficient", Default=1); EQUATIONS "Equilibrium constant at 298 K" K0 = exp(-sum(stoic*G0)/(R*T0)); "Equilibrium constant temperature correction" K1 = exp(sum(stoic*H0)/(R*T0) * (1- T0/T)); K0 = exp(-sum(nu*G0)/(R*T0)); "Equilibrium constant at T" K = K1*K0; K = K0 * exp(-sum(nu*H0)/R*(1/T - 1/T0)); "Equilibrium rule" K = prod( (n/sum(n)*phi*P/P0) ^ stoic); K = prod( (n/sum(n)*phi*P/P0) ^ nu); "Reaction advance" n = ni + stoic * advance; n = n0 + nu * advance; "Fugacity coefficient" SET NComp = PP.NumberOfComponents; stoic = [-1, 1, 1]; nu = [-1, 1, 1]; SPECIFY T = (1000 + 273.15) * 'K'; P = 1 * 'atm'; ni = [1, 0, 0] * 'mol'; n0 = [1, 0, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -1, 1]; nu = [-1, -1, 1]; SPECIFY T = (250 + 273.15) * 'K'; P = 35 * 'atm'; ni = [1, 5, 0] * 'mol'; n0 = [1, 5, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -1, 1, 1]; nu = [-1, -1, 1, 1]; SPECIFY T = 1100 * 'K'; P = 1 * 'bar'; ni = [1, 1, 0, 0] * 'mol'; n0 = [1, 1, 0, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -1, 1, 1]; nu = [-1, -1, 1, 1]; SPECIFY T = 1100 * 'K'; P = 1 * 'bar'; ni = [1, 1, 0, 0] * 'mol'; n0 = [1, 1, 0, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -1, 1, 1]; nu = [-1, -1, 1, 1]; SPECIFY T = 1100 * 'K'; P = 1 * 'bar'; ni = [1, 2, 0, 0] * 'mol'; n0 = [1, 2, 0, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -1, 2]; nu = [-1, -1, 2]; SPECIFY T = (500 + 273.15) * 'K'; P = 1 * 'bar'; ni = [1, 3, 0] * 'mol'; n0 = [1, 3, 0] * 'mol'; # Expected results: SET NComp = PP.NumberOfComponents; stoic = [-1, -3, 2]; nu = [-1, -3, 2]; SPECIFY T = (500 + 273.15) * 'K'; P = 300 * 'bar'; ni = [1, 3, 0] * 'mol'; n0 = [1, 3, 0] * 'mol'; # Expected results:
Note: See TracChangeset for help on using the changeset viewer.