Skip to content

Commit

Permalink
added thermal mass scaling factor in mixing volume and propagated it …
Browse files Browse the repository at this point in the history
…to LumpedVolumeDeclarations
  • Loading branch information
Mathadon committed Oct 21, 2014
1 parent 6f82841 commit 93fbe3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Annex60/Fluid/Interfaces/ConservationEquation.mo
Expand Up @@ -8,6 +8,8 @@ model ConservationEquation "Lumped volume with mass and energy balance"
annotation(Evaluate=true, Dialog(connectorSizing=true, tab="General",group="Ports"));
parameter Boolean initialize_p = not Medium.singleState
"= true to set up initial equations for pressure";
parameter Real mFactor = 1
"Optional factor for scaling the thermal mass of the mixing volume";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b ports[nPorts](
redeclare each final package Medium = Medium) "Fluid inlets and outlets"
annotation (Placement(transformation(extent={{-40,-10},{40,10}},
Expand Down Expand Up @@ -155,7 +157,7 @@ equation
// Total quantities
m = fluidVolume*medium.d;
mXi = m*medium.Xi;
U = m*medium.u;
U = m*medium.u*mFactor;
mC = m*C;

hOut = medium.h;
Expand Down
3 changes: 3 additions & 0 deletions Annex60/Fluid/Interfaces/LumpedVolumeDeclarations.mo
Expand Up @@ -36,6 +36,9 @@ record LumpedVolumeDeclarations "Declarations for lumped volumes"
quantity=Medium.extraPropertiesNames) = fill(1E-2, Medium.nC)
"Nominal value of trace substances. (Set to typical order of magnitude.)"
annotation (Dialog(tab="Initialization", enable=Medium.nC > 0));
parameter Real mFactor=1
"Optional factor for scaling the thermal mass of the mixing volume"
annotation(Dialog(tab="Advanced"));

annotation (preferredView="info",
Documentation(info="<html>
Expand Down
Expand Up @@ -60,7 +60,8 @@ protected
m(start=V*rho_start),
U(start=V*rho_start*Medium.specificInternalEnergy(
state_start)),
nPorts=nPorts) if
nPorts=nPorts,
mFactor=mFactor) if
not useSteadyStateTwoPort "Model for dynamic energy balance"
annotation (Placement(transformation(extent={{40,0},{60,20}})));

Expand Down Expand Up @@ -98,6 +99,7 @@ protected
Modelica.Blocks.Sources.RealExpression QSen_flow(y=heatPort.Q_flow)
"Block to set sensible heat input into volume"
annotation (Placement(transformation(extent={{-60,78},{-40,98}})));

equation
///////////////////////////////////////////////////////////////////////////
// asserts
Expand Down

0 comments on commit 93fbe3e

Please sign in to comment.