Ignore:
Timestamp:
Nov 29, 2007, 10:05:51 AM (15 years ago)
Author:
Rodolfo Rodrigues
Message:

Added symbols

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eml/reactors/gibbs.mso

    r414 r421  
    1818*
    1919*   Description:
    20 
    2120*       Thermodynamic equilibrium modeling of a reactor using Gibbs
    2221*       free energy minimization approach.
    23 
    24 *
    25 
     22*
    2623*   Assumptions:
    27 
     24*               * single- and two-phases involved
    2825*       * thermodynamic equilibrium
    29 
    3026*               * steady-state
    31 
    32 *
    33 
     27*
    3428*       Specify:
    35 
    3629*               * inlet stream
    3730*               * number of elements related to components
    38 
    3931*               * matrix of elements by components
    40 
    4132*               * equilibrium temperature
    4233*
     
    5849        Brief   = "Model of a generic vapour-phase Gibbs CSTR";
    5950        Info    = "
    60 Requires the information of:
    61 * number of elements
    62 * matrix of elements (elements by compoments)
     51== Assumptions ==
     52* thermodynamic equilibrium
     53* steady-state
     54
     55== Specify ==
     56* inlet stream
     57* number of elements related to components
     58* matrix of elements by components
     59* equilibrium temperature
    6360";
    6461
     
    7168       
    7269        VARIABLES
    73 out Outlet                      as vapour_stream; # Outlet stream
     70out Outlet                      as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    7471
    7572        G(NComp)                as energy_mol   (Brief="Gibbs free-energy change of formation");
    76         lambda(NElem)   as energy_mol   (Brief="Lagrangian multiplier");
    77         activ(NComp)    as Real                 (Brief="Activity", Lower=1e-20);
    78         phi(NComp)              as fugacity             (Brief="Fugacity coefficient", Default=1);
     73        lambda(NElem)   as energy_mol   (Brief="Lagrangian multiplier", Symbol="\lambda");
     74        activ(NComp)    as Real                 (Brief="Activity", Symbol="\hat{a}", Lower=1e-20);
    7975       
    8076        rate(NComp)     as reaction_mol (Brief="Overall component rate of reaction");
    81         conv(NComp)     as Real                 (Brief="Fractional conversion of component", Default=0);
     77        conv(NComp)     as Real                 (Brief="Fractional conversion of component", Symbol="X", Default=0);
    8278        Fi(NComp)               as flow_mol             (Brief="Component molar flow rate");
    8379
    8480        EQUATIONS
    8581        "Outlet stream"
    86         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     82        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    8783       
    8884        "Mechanical equilibrium"
     
    105101
    106102#       "Gibbs free-energy of formation without Cp correction"
    107 #       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To);
     103#       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To
     104#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    108105
    109106        for i in [1:NComp]
     
    122119                        end
    123120          end
    124        
    125121        end
    126122       
    127         "Fugacity coefficient"
    128         phi = PP.VapourFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z);
    129        
    130123        "Activity"
    131         activ = phi*Outlet.P*Outlet.z/fs;
     124        activ = PP.VapourFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z)
     125                *Outlet.P*Outlet.z/fs;
    132126end
    133127
     
    142136        Brief   = "Model of a generic liquid-phase Gibbs CSTR";
    143137        Info    = "
    144 Requires the information of:
    145 * number of elements
    146 * matrix of elements (elements by compoments)
     138== Assumptions ==
     139* thermodynamic equilibrium
     140* steady-state
     141
     142== Specify ==
     143* inlet stream
     144* number of elements related to components
     145* matrix of elements by components
     146* equilibrium temperature
    147147";
    148148
     
    155155       
    156156        VARIABLES
    157 out Outlet                      as liquid_stream; # Outlet stream
     157out Outlet                      as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    158158
    159159        G(NComp)                as energy_mol   (Brief="Gibbs free-energy change of formation");
    160         lambda(NElem)   as energy_mol   (Brief="Lagrangian multiplier");
    161         activ(NComp)    as Real                 (Brief="Activity", Lower=0);
    162         gamma(NComp)    as fugacity             (Brief="Activity coefficient", Default=1);
    163 
     160        lambda(NElem)   as energy_mol   (Brief="Lagrangian multiplier", Symbol="\lambda");
     161        activ(NComp)    as Real                 (Brief="Activity", Symbol="\hat{a}", Lower=0);
     162       
    164163        rate(NComp)     as reaction_mol (Brief="Overall component rate of reaction");
    165         conv(NComp)     as Real                 (Brief="Fractional conversion of component", Default=0);
     164        conv(NComp)     as Real                 (Brief="Fractional conversion of component", Symbol="X", Default=0);
    166165        Fi(NComp)               as flow_mol             (Brief="Component molar flow rate");
    167166
    168167        EQUATIONS
    169168        "Outlet stream"
    170         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     169        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    171170       
    172171        "Mechanical equilibrium"
     
    189188
    190189#       "Gibbs free-energy of formation without Cp correction"
    191 #       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To);
     190#       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To
     191#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    192192
    193193        for i in [1:NComp]
     
    206206                        end
    207207          end
    208        
    209208        end
    210209       
    211         "Activity coefficient"
    212         gamma = PP.LiquidFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z);
    213        
    214210        "Activity"
    215         activ = gamma*Outlet.z*exp(PP.LiquidVolume(Outlet.T,Outlet.P,Outlet.z)*(Outlet.P - Ps)/Rg/Outlet.T);
     211        activ = PP.LiquidFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z)*Outlet.z
     212                *exp(PP.LiquidVolume(Outlet.T,Outlet.P,Outlet.z)*(Outlet.P - Ps)/Rg/Outlet.T);
    216213end
Note: See TracChangeset for help on using the changeset viewer.