#*-------------------------------------------------------------------
* Model of tanks
*--------------------------------------------------------------------
* Streams:
* * an inlet stream
* * an outlet stream
*
* Specify:
* * the Inlet stream
* * the Outlet flow
* * the tank Q
*
* Initial:
* * the tank temperature (OutletL.T)
* * the tank level (h)
* * (NoComps - 1) Outlet compositions
*----------------------------------------------------------------------
* Author: Paula B. Staudt
* $Id: tank.mso 64 2006-11-24 02:48:08Z arge $
*--------------------------------------------------------------------*#
using "streams";
Model tank
PARAMETERS
ext PP as CalcObject;
ext NComp as Integer;
Across as area (Brief="Tank cross section area", Default=2);
VARIABLES
in Inlet as stream;
out Outlet as stream_therm;
in Q as heat_rate (Brief="Rate of heat supply");
Level as length(Brief="Tank level");
M(NComp) as mol (Brief="Molar Holdup in the tank");
E as energy (Brief="Total Energy Holdup on tank");
vL as volume_mol (Brief="Liquid Molar Volume");
EQUATIONS
"Mass balance"
diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
"Energy balance"
diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
"Energy Holdup"
E = sum(M)*Outlet.h;
"Mechanical Equilibrium"
Inlet.P = Outlet.P;
"Liquid Volume"
vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
"Composition"
M = Outlet.z*sum(M);
"Level of liquid phase"
Level = sum(M)*vL/Across;
"Vapourisation Fraction"
Outlet.v = Inlet.v;
end
Model tank_cylindrical
PARAMETERS
ext PP as CalcObject;
ext NComp as Integer;
radius as length(Brief="Tank radius");
L as length(Brief="Tank length");
VARIABLES
in Inlet as stream;
out Outlet as stream_therm;
in Q as heat_rate (Brief="Rate of heat supply");
Level as length(Brief="Tank level");
Across as area (Brief="Tank cross section area", Default=2);
M(NComp) as mol (Brief="Molar Holdup in the tank");
E as energy (Brief="Total Energy Holdup on tank");
vL as volume_mol (Brief="Liquid Molar Volume");
EQUATIONS
"Mass balance"
diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
"Energy balance"
diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
"Energy Holdup"
E = sum(M)*Outlet.h;
"Mechanical Equilibrium"
Inlet.P = Outlet.P;
"Liquid Volume"
vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
"Composition"
M = Outlet.z*sum(M);
"Cylindrical Area"
Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) +
(Level-radius)*sqrt(Level*(2*radius - Level));
"Level of liquid phase"
Level = sum(M)*vL/Across;
"Vapourisation Fraction"
Outlet.v = Inlet.v;
end
Model tank_simplified
PARAMETERS
k as Real (Brief="Valve Constant", Unit = "m^2.5/h", Default=4);
A as area (Brief="Tank area", Default=2);
VARIABLES
h as length(Brief="Tank level");
in Fin as flow_vol(Brief="Input flow");
out Fout as flow_vol(Brief="Output flow");
EQUATIONS
"Mass balance"
diff(A*h) = Fin - Fout;
"Valve equation"
Fout = k*sqrt(h);
end
Model tank_feed
PARAMETERS
ext PP as CalcObject;
ext NComp as Integer;
Across as area (Brief="Tank cross section area", Default=2);
VARIABLES
in Feed as stream;
in Inlet as stream;
out Outlet as stream_therm;
in Q as heat_rate (Brief="Rate of heat supply");
Level as length(Brief="Tank level");
M(NComp) as mol (Brief="Molar Holdup in the tank");
E as energy (Brief="Total Energy Holdup on tank");
vL as volume_mol (Brief="Liquid Molar Volume");
EQUATIONS
"Mass balance"
diff(M) = Feed.F*Feed.z + Inlet.F*Inlet.z - Outlet.F*Outlet.z;
"Energy balance"
diff(E) = Feed.F*Feed.h + Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
"Energy Holdup"
E = sum(M)*Outlet.h;
"Mechanical Equilibrium"
Inlet.P = Outlet.P;
"Liquid Volume"
vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
"Composition"
M = Outlet.z*sum(M);
"Level of liquid phase"
Level = sum(M)*vL/Across;
"Vapourisation Fraction"
Outlet.v = Inlet.v;
end