 Timestamp:
 Nov 20, 2007, 1:30:10 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/sample/miscellaneous/sample_gibbs_reactor_simple.mso
r407 r410 43 43 outer NComp as Integer (Brief="Number of components", Default=1); 44 44 45 nu(NComp) as Real ;45 nu(NComp) as Real(Symbol="\nu_i"); 46 46 47 47 R as Real(Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); 48 T0 as temperature(Default = 298.15 );49 P0 as Real(Default=1, Unit='bar' );50 G0(NComp) as energy_mol (Brief="Gibbs energy in standard state");51 H0(NComp) as energy_mol (Brief="Enthalpy in standard state");52 53 SET 54 G0 = PP.IdealGasGibbsOfFormationAt25C();55 H0 = PP.IdealGasEnthalpyOfFormationAt25C();48 T0 as temperature(Default = 298.15, Symbol="T_{298}"); 49 P0 as Real(Default=1, Unit='bar', Symbol="P^0"); 50 g0(NComp) as energy_mol (Brief="Gibbs energy in standard state", Symbol="g^0_{298,i}"); 51 h0(NComp) as energy_mol (Brief="Enthalpy in standard state", Symbol="h^0_{298,i}"); 52 53 SET 54 g0 = PP.IdealGasGibbsOfFormationAt25C(); 55 h0 = PP.IdealGasEnthalpyOfFormationAt25C(); 56 56 57 57 VARIABLES 58 58 T as temperature; 59 59 P as pressure; 60 n0(NComp) as positive(Brief="Initial number of mols", Unit='mol' );61 n(NComp) as positive(Brief="Number of mols at equilibrium", Unit='mol' );62 advance as Real(Unit='mol' );60 n0(NComp) as positive(Brief="Initial number of mols", Unit='mol', Symbol="n_{i,0}"); 61 n(NComp) as positive(Brief="Number of mols at equilibrium", Unit='mol', Symbol="n_i"); 62 advance as Real(Unit='mol', Symbol="\epsilon"); 63 63 64 64 K as positive(Brief="Reaction equilibrium constant at T"); 65 K0 as positive(Brief="Reaction equilibrium constant at T0" );66 67 phi(NComp) as fugacity(Brief="Fugacity coefficient", Default=1 );65 K0 as positive(Brief="Reaction equilibrium constant at T0", Symbol="K_{298}"); 66 67 phi(NComp) as fugacity(Brief="Fugacity coefficient", Default=1, Symbol="\phi_i"); 68 68 69 69 EQUATIONS 70 70 "Equilibrium constant at 298 K" 71 K0 = exp(sum(nu* G0)/(R*T0));71 K0 = exp(sum(nu*g0)/(R*T0)); 72 72 "Equilibrium constant at T" 73 K = K0 * exp(sum(nu* H0)/R*(1/T  1/T0));73 K = K0 * exp(sum(nu*h0)/R*(1/T  1/T0)); 74 74 75 75 "Equilibrium rule"
Note: See TracChangeset
for help on using the changeset viewer.