Changeset 421


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

Added symbols

Location:
trunk
Files:
7 edited

Legend:

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

    r415 r421  
    2222*
    2323*   Assumptions:
     24*               * single- and two-phases involved
    2425*       * thermodynamic equilibrium
    2526*               * steady-state
     
    4748        Brief           = "Model of a generic vapour-phase equilibrium CSTR";
    4849        Info            = "
    49 Requires the information of:
    50 * number of reactions
    51 * matrix of stoichiometric coefficients (components by reactions)
     50== Assumptions ==
     51* only vapour-phase
     52* thermodynamic equilibrium
     53* steady-state
     54
     55== Specify ==
     56* inlet stream
     57* stoichiometric matrix
     58* equilibrium temperature
    5259";
    5360
    5461        PARAMETERS
    5562        NReac           as Integer              (Brief="Number of reactions", Default=1);
    56     stoic(NComp,NReac) as Real  (Brief="Stoichiometric matrix");
     63    stoic(NComp,NReac) as Real  (Brief="Stoichiometric matrix", Symbol="\nu");
    5764        Rg                      as Real                 (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314);
    5865        fs(NComp)       as pressure     (Brief="Fugacity in standard state", Default=1, DisplayUnit='atm');
     
    6067
    6168        VARIABLES
    62 out Outlet              as vapour_stream; # Outlet stream
     69out Outlet              as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    6370
    6471        G(NComp)        as energy_mol   (Brief="Gibbs free-energy of formation");
    6572        K(NReac)        as Real                 (Brief="Equillibrium constant",Default=1.5);
    66         activ(NComp)as Real             (Brief="Activity",Default=0.2);
     73        activ(NComp)as Real             (Brief="Activity", Symbol="\hat{a}", Default=0.2);
    6774       
    6875        rate(NComp) as reaction_mol (Brief="Overall component rate of reaction");
    69         extent(NReac) as flow_mol       (Brief="Extent of reaction");
    70         conv(NComp) as Real             (Brief="Fractional conversion of component", Default=0); # Lower=-1e3, Upper=1e3);
     76        extent(NReac) as flow_mol       (Brief="Extent of reaction", Symbol="\xi");
     77        conv(NComp) as Real             (Brief="Fractional conversion of component", Symbol="X", Default=0); # Lower=-1e3, Upper=1e3);
    7178       
    7279        EQUATIONS
    7380        "Outlet stream"
    74         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     81        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    7582       
    7683        "Mechanical equilibrium"
     
    8794
    8895#       "Gibbs free-energy of formation without Cp correction"
    89 #       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To);
     96#       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To
     97#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    9098
    9199        "Gibbs free energy of reaction"
    92 #       sumt(G*stoic) = -Rg*Outlet.T*ln(K);
    93         K = exp(-sumt(G*stoic)/(Rg*Outlet.T));
     100        sumt(G*stoic) = -Rg*Outlet.T*ln(K);
     101#       K = exp(-sumt(G*stoic)/(Rg*Outlet.T));
    94102       
    95103        for j in [1:NReac]
     
    131139        Brief           = "Model of a generic liquid-phase equilibrium CSTR";
    132140        Info            = "
    133 Requires the information of:
    134 * number of reactions
    135 * matrix of stoichiometric coefficients (components by reactions)
     141== Assumptions ==
     142* only liquid-phase
     143* thermodynamic equilibrium
     144* steady-state
     145
     146== Specify ==
     147* inlet stream
     148* stoichiometric matrix
     149* equilibrium temperature
    136150";
    137151
    138152        PARAMETERS
    139153        NReac           as Integer              (Brief="Number of reactions", Default=1);
    140     stoic(NComp,NReac) as Real  (Brief="Stoichiometric matrix");
     154    stoic(NComp,NReac) as Real  (Brief="Stoichiometric matrix", Symbol="\nu");
    141155        Rg                      as Real                 (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314);
    142156        Ps                      as pressure     (Brief="Standard pressure", Default=1, DisplayUnit='bar');
     
    144158
    145159        VARIABLES
    146 out Outlet              as liquid_stream; # Outlet stream
     160out Outlet              as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    147161
    148162        G(NReac)        as enth_mol     (Brief="Gibbs free-energy of formation");
    149163        K(NReac)        as fraction             (Brief="Equillibrium constant");
    150         activ(NComp)as Real             (Brief="Activity");
     164        activ(NComp)as Real             (Brief="Activity", Symbol="\hat{a}");
    151165       
    152166        rate(NComp) as reaction_mol (Brief="Overall component rate of reaction");
    153         extent(NReac)as flow_mol        (Brief="Extent of reaction");
    154         conv(NComp) as Real             (Brief="Fractional conversion of component", Default=0);
     167        extent(NReac)as flow_mol        (Brief="Extent of reaction", Symbol="\xi");
     168        conv(NComp) as Real             (Brief="Fractional conversion of component", Symbol="X", Default=0);
    155169       
    156170        EQUATIONS
    157171        "Outlet stream"
    158         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     172        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    159173       
    160174        "Mechanical equilibrium"
     
    171185
    172186#       "Gibbs free-energy of formation without Cp correction"
    173 #       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To);
     187#       G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To
     188#               + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To);
    174189
    175190        "Gibbs free energy of reaction"
    176 #       sumt(G*stoic) = -Rg*Outlet.T*ln(K);
    177         K = exp(-sumt(G*stoic)/(Rg*Outlet.T));
     191        sumt(G*stoic) = -Rg*Outlet.T*ln(K);
     192#       K = exp(-sumt(G*stoic)/(Rg*Outlet.T));
    178193       
    179194        for j in [1:NReac]
  • 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
  • trunk/eml/reactors/stoic.mso

    r419 r421  
    2121*
    2222*   Assumptions:
     23*               * single- and two-phases involved
    2324*               * steady-state
    2425*
     
    4041*--------------------------------------------------------------------*#
    4142Model stoic_vap as tank_vap
     43        ATTRIBUTES
     44        Brief   = "Basic model for a vapour-phase stoichiometric CSTR";
     45        Info    = "
     46== Assumptions ==
     47* only vapour-phase
     48* steady-state
     49";
     50       
    4251        PARAMETERS
    4352        NReac           as Integer (Brief="Number of reactions", Default=1);
    44     stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix");
    45 
    46         VARIABLES
    47 out Outlet              as vapour_stream; # Outlet stream
     53    stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu");
     54
     55        VARIABLES
     56out Outlet              as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    4857
    4958        rate(NComp) as reaction_mol (Brief="Overall component rate of reaction");
    50         conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);
     59        conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0);
    5160       
    5261        EQUATIONS
    5362        "Outlet stream"
    54         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     63        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    5564       
    5665        "Mechanical equilibrium"
     
    8392*--------------------------------------------------------------------*#
    8493Model stoic_liq as tank_liq
     94        ATTRIBUTES
     95        Brief   = "Basic model for a liquid-phase stoichiometric CSTR";
     96        Info    = "
     97== Assumptions ==
     98* only liquid-phase
     99* steady-state
     100";
     101
    85102        PARAMETERS
    86103        NReac           as Integer (Brief="Number of reactions", Default=1);
    87     stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix");
    88        
    89         VARIABLES
    90 out Outlet              as liquid_stream; # Outlet stream
     104    stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu");
     105       
     106        VARIABLES
     107out Outlet              as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    91108
    92109        rate(NComp) as reaction_mol (Brief="Overall component rate of reaction");
    93         conv(NComp)     as Real (Brief="Fractional conversion of component", Default=0);
     110        conv(NComp)     as Real (Brief="Fractional conversion of component", Symbol="X", Default=0);
    94111       
    95112        EQUATIONS
    96113        "Outlet stream"
    97         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     114        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    98115       
    99116        "Mechanical equilibrium"
     
    131148        Brief   = "Model of a generic vapour-phase stoichiometric CSTR based on extent of reaction";
    132149        Info    = "
    133 Requires the information of:
     150== Specify ==
     151* inlet stream
    134152* extent of reactions
    135153";
    136154
    137155        VARIABLES
    138         extent(NReac)   as flow_mol (Brief="Extent of reaction");
     156        extent(NReac)   as flow_mol (Brief="Extent of reaction", Symbol="\xi");
    139157       
    140158        EQUATIONS
    141159        "Rate of reaction"
    142         rate*V = sumt(stoic*extent);
     160        rate*Vr = sumt(stoic*extent);
    143161end
    144162
     
    149167        Brief   = "Model of a generic liquid-phase stoichiometric CSTR based on extent of reaction";
    150168        Info    = "
    151 Requires the information of:
     169== Specify ==
     170* inlet stream
    152171* extent of reactions
    153172";
    154173
    155174        VARIABLES
    156         extent(NReac)   as flow_mol (Brief="Extent of reaction");
     175        extent(NReac)   as flow_mol (Brief="Extent of reaction", Symbol="\xi");
    157176       
    158177        EQUATIONS
    159178        "Rate of reaction"
    160         rate*V = sumt(stoic*extent);
     179        rate*Vr = sumt(stoic*extent);
    161180end
    162181
     
    171190        Brief   = "Model of a generic vapour-phase stoichiometric CSTR based on conversion of a key component";
    172191        Info    = "
    173 Requires the information of:
     192== Specify ==
     193* inlet stream
    174194* conversion of a key component
    175195";
     
    179199
    180200        VARIABLES
    181         kconv as Real   (Brief="Molar conversion of key component");
     201        kconv as Real   (Brief="Molar conversion of key component", Symbol="X_k");
    182202
    183203        EQUATIONS
    184204        "Reaction rate"
    185         rate*V = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;
     205        rate*Vr = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;
    186206end
    187207
     
    192212        Brief   = "Model of a generic liquid-phase stoichiometric CSTR based on conversion of a key component";
    193213        Info    = "
    194 Requires the information of:
     214== Specify ==
     215* inlet stream
    195216* conversion of a key component
    196217";
     
    200221
    201222        VARIABLES
    202         kconv as Real   (Brief="Molar conversion of key component");
     223        kconv as Real   (Brief="Molar conversion of key component", Symbol="X_k");
    203224
    204225        EQUATIONS
    205226        "Reaction rate"
    206         rate*V = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;
    207 end
     227        rate*Vr = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;
     228end
  • trunk/eml/reactors/tank_basic.mso

    r403 r421  
    1717*----------------------------------------------------------------------
    1818*
     19*   Description:
     20*       Generic model for a dynamic tank.
    1921*
     22*   Assumptions:
     23*               * single- and two-phases involved
     24*       * dynamic
    2025*
    2126*----------------------------------------------------------------------
     
    2833
    2934Model tank_basic
     35        ATTRIBUTES
     36        Brief   = "Basic model for a dynamic tank";
     37       
    3038        PARAMETERS
    31 outer PP                as Plugin (Brief="External physical properties", Type="PP");
    32 outer   NComp   as Integer (Brief="Number of components", Default=1);
     39outer PP        as Plugin       (Brief="External physical properties", Type="PP");
     40outer NComp as Integer  (Brief="Number of components", Default=1);
    3341       
    3442        VARIABLES
    35 in      Inlet   as stream;              # Inlet stream
    36 out     Outletm as stream;              # Intermediary outlet stream
     43in      Inlet   as stream       (Brief="Inlet stream", PosX=0, PosY=0, Symbol="_{in}");
     44out     Outletm as stream       (Brief="Intermediary outlet stream", Symbol="_{outm}");
    3745
    3846        M(NComp)as mol          (Brief="Component molar holdup");
    3947        Mt              as mol          (Brief="Total component molar holdup");
    40         V               as volume       (Brief="Volume of reactional mixture");
     48        Vr              as volume       (Brief="Volume of reactional mixture");
    4149        E               as energy       (Brief="Internal energy");
    4250        Q               as heat_rate(Brief="Reactor duty", Default=0);
     
    5361       
    5462        "Mole fraction normalisation"
    55         sum(Outletm.z) = 1.0;
     63        sum(Outletm.z) = 1;
    5664       
    5765        "Energy balance"
     
    5967       
    6068        "Geometry"
    61         V = Across*Level;
    62 end
    63 
    64 
    65 #*---------------------------------------------------------------------
    66 *       only liquid phase
    67 *--------------------------------------------------------------------*#
    68 
    69 Model tank_liq as tank_basic
    70         EQUATIONS
    71         "Vapourisation fraction"
    72         Outletm.v = 0.0;
    73 
    74         "Liquid Enthalpy"
    75         Outletm.h = PP.LiquidEnthalpy(Outletm.T,Outletm.P,Outletm.z);
    76        
    77         "Volume constraint"
    78         V = Mt*PP.LiquidVolume(Outletm.T,Outletm.P,Outletm.z);
    79        
    80         "Total internal energy"
    81         E = Mt*Outletm.h - Outletm.P*V;
     69        Vr = Across*Level;
    8270end
    8371
     
    8674*       only vapour phase
    8775*--------------------------------------------------------------------*#
    88 
    8976Model tank_vap as tank_basic
     77        ATTRIBUTES
     78        Brief   = "Model of a generic vapour-phase tank";
     79       
    9080        EQUATIONS
    9181        "Vapourisation fraction"
    92         Outletm.v = 1.0;
     82        Outletm.v = 1;
    9383
    9484        "Vapour Enthalpy"
     
    9686
    9787        "Volume constraint"
    98         V = Mt*PP.VapourVolume(Outletm.T,Outletm.P,Outletm.z);
     88        Vr = Mt*PP.VapourVolume(Outletm.T,Outletm.P,Outletm.z);
    9989
    10090        "Total internal energy"
     
    10494
    10595#*---------------------------------------------------------------------
     96*       only liquid phase
     97*--------------------------------------------------------------------*#
     98Model tank_liq as tank_basic
     99        ATTRIBUTES
     100        Brief   = "Model of a generic liquid-phase tank";
     101       
     102        EQUATIONS
     103        "Vapourisation fraction"
     104        Outletm.v = 0;
     105
     106        "Liquid Enthalpy"
     107        Outletm.h = PP.LiquidEnthalpy(Outletm.T,Outletm.P,Outletm.z);
     108       
     109        "Volume constraint"
     110        Vr = Mt*PP.LiquidVolume(Outletm.T,Outletm.P,Outletm.z);
     111       
     112        "Total internal energy"
     113        E = Mt*Outletm.h - Outletm.P*Vr;
     114end
     115
     116
     117#*---------------------------------------------------------------------
    106118*       liquid and vapour phases
    107119*--------------------------------------------------------------------*#
    108 
    109120Model tank_liqvap
     121        ATTRIBUTES
     122        Brief   = "Model of a generic two-phase tank";
     123       
    110124        PARAMETERS
    111125outer PP                as Plugin(Brief="External physical properties", Type="PP");
     
    113127
    114128        VARIABLES
    115 in      Inlet    as stream;                     # Inlet stream
    116 out     OutletmL as liquid_stream;      # Intermediary liquid outlet stream
    117 out     OutletV  as vapour_stream;      # Outlet vapour stream
     129in      Inlet    as stream                      (Brief="Inlet stream", PosX=0, PosY=0, Symbol="_{in}");
     130out     OutletmL as liquid_stream       (Brief="Intermediary liquid outlet stream", Symbol="_{outmL}");
     131out     OutletV  as vapour_stream       (Brief="Outlet vapour stream", Symbol="_{outV}");
    118132
    119133        M(NComp)as mol                  (Brief="Component molar holdup");
    120134        ML              as mol                  (Brief="Molar liquid holdup");
    121135        MV              as mol                  (Brief="Molar vapour holdup");
    122         V               as volume               (Brief="Volume of reactional mixture");
     136        Vr              as volume               (Brief="Volume of reactional mixture");
    123137        E               as energy               (Brief="Internal energy");
    124138        Q               as heat_rate    (Brief="Reactor duty", Default=0);
     
    137151       
    138152        "Mole fraction normalisation"
    139         sum(OutletmL.z) = 1.0;
     153        sum(OutletmL.z) = 1;
    140154       
    141155        "Mole fraction normalisation"
     
    144158       
    145159        "Vapourisation fraction"
    146         OutletV.v = 1.0;
     160        OutletV.v = 1;
    147161       
    148162        "Vapourisation fraction"
    149         OutletmL.v = 0.0;
     163        OutletmL.v = 0;
    150164       
    151165       
     
    157171       
    158172        "Geometry constraint"
    159         V = ML*vL + MV*PP.VapourVolume(OutletV.T,OutletV.P,OutletV.z);
     173        Vr = ML*vL + MV*PP.VapourVolume(OutletV.T,OutletV.P,OutletV.z);
    160174       
    161175       
  • trunk/eml/reactors/vol_tank.mso

    r411 r421  
    4040        Pallete = false;
    4141        Brief = "Routine to calculate tank volume";
    42         Info = "Based in 2 geometry and 2 configurations/orientations";
     42        Info = "
     43Based in 2 geometry and 2 configurations/orientations
     44
     45== Geometry ==
     46* Flat (no head) (default)
     47* Spherical
     48
     49== Orientation ==
     50* Vertical (default)
     51* Horizontal
     52";
    4353       
    4454        PARAMETERS
    45         pi      as positive     (Brief="Pi value", Default=3.141593);
     55        pi              as positive     (Brief="Pi value", Default=3.141593, Symbol="\pi");
    4656        Geometry        as Switcher     (Brief="Tank head type", Valid=["flat","spherical"], Default="flat");
    4757        Orientation     as Switcher(Brief="Tank orientation", Valid=["vertical","horizontal"], Default="vertical");
     
    6474                                case "flat":
    6575                                "Tank volume"
    66                                         Vt = pi*(D^2)*L/4;
     76                                        Vt = pi/4*(D^2)*L;
    6777                                "Level tank volume"
    68                                         V = pi*(D^2)*Level/4;
     78                                        V = pi/4*(D^2)*Level;
    6979       
    7080                                case "spherical":
    7181                                "Tank volume"
    72                                         Vt = pi*D^3/6;
     82                                        Vt = pi/6*D^3;
    7383                                "Level tank volume"
    7484                                        V = pi/3*Level^2*(3*D/2 - Level);
     
    7888                                case "flat":
    7989                                "Tank volume"
    80                                         Vt = pi*(D^2)*L/4;
     90                                        Vt = pi/4*(D^2)*L;
    8191                                "Level tank volume"
    8292                                        V = ((D^2)*acos((D - 2*Level)/D)/4/"rad" -
     
    8595                                case "spherical":
    8696                                "Tank volume"
    87                                         Vt = pi*D^3/6;
     97                                        Vt = pi/6*D^3;
    8898                                "Level tank volume"
    8999                                        V = pi/3*Level^2*(3*D/2 - Level);
  • trunk/eml/reactors/yield.mso

    r417 r421  
    2121*
    2222*   Assumptions:
     23*               * single- and two-phases involved
    2324*       * steady-state
    2425*
     
    4546        Brief   = "Model of a generic vapour-phase yield CSTR";
    4647        Info    = "
    47 Requires the information of:
     48== Assumptions ==
     49* only vapour-phase
     50* steady-state
     51
     52== Specify ==
     53* inlet stream
    4854* component yield or
    4955* reaction yield
     
    5561       
    5662        VARIABLES
    57 out Outlet                as vapour_stream; # Outlet stream
     63out Outlet                as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    5864        rate(NComp)   as reaction_mol (Brief="Overall component rate of reaction");
    59         conv(NComp)   as Real (Brief="Fractional conversion of component", Default=0);
     65        conv(NComp)   as Real (Brief="Fractional conversion of component", Symbol="X", Default=0);
    6066       
    61         yield(NComp)  as Real (Brief="Molar component yield");  # global yield
    62         yield_(NComp) as Real (Brief="Molar reaction yield");   # instantaneous yield
     67        yield(NComp)  as Real (Brief="Molar component yield (global)", Symbol="Y_G");
     68        yield_(NComp) as Real (Brief="Molar reaction yield (instantaneous)", Symbol="Y_I");
    6369
    6470        EQUATIONS
    6571        "Outlet stream"
    66         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     72        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    6773       
    6874        "Rate of reaction"
    69         rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);
     75        rate*Vr = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);
    7076       
    7177        "Instantaneous yield"
     
    103109        Brief   = "Model of a generic liquid-phase yield CSTR";
    104110        Info    = "
    105 Requires the information of:
     111== Assumptions ==
     112* only liquid-phase
     113* steady-state
     114
     115== Specify ==
     116* inlet stream
    106117* component yield or
    107118* reaction yield
     
    109120
    110121        PARAMETERS
    111         NReac   as Integer (Brief="Number of reactions", Default=1);
     122        NReac   as Integer      (Brief="Number of reactions", Default=1);
    112123        KComp   as Integer      (Brief="Key component", Lower=1, Default=1);
    113124       
    114125        VARIABLES
    115 out Outlet                as liquid_stream; # Outlet stream
     126out Outlet                as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}");
    116127        rate(NComp)   as reaction_mol (Brief="Overall component rate of reaction");
    117         conv(NComp)   as Real (Brief="Fractional conversion of component", Default=0);
     128        conv(NComp)   as Real (Brief="Fractional conversion of component", Symbol="X", Default=0);
    118129       
    119         yield(NComp)  as Real (Brief="Molar component yield");  # global yield
    120         yield_(NComp) as Real (Brief="Molar reaction yield");   # instantaneous yield
     130        yield(NComp)  as Real (Brief="Molar component yield (global)", Symbol="Y_G");
     131        yield_(NComp) as Real (Brief="Molar reaction yield (instantaneous)", Symbol="Y_I");
    121132
    122133        EQUATIONS
    123134        "Outlet stream"
    124         Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V;
     135        Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr;
    125136       
    126137        "Rate of reaction"
    127         rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);
     138        rate*Vr = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);
    128139       
    129140        "Molar reaction yield"
  • trunk/sample/reactors/sample_stoic.mso

    r419 r421  
    129129        R.Across = 5*'m^2';
    130130
    131         INITIAL
    132     R.Outletm.T = 500*'K';
    133         R.M = [25, 75, 0, 0, 0]*'kmol';
    134        
    135131        OPTIONS
    136132        Dynamic = false;
Note: See TracChangeset for help on using the changeset viewer.