Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1005 nopropagationofm flow small #1007

Merged
merged 3 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions AixLib/Fluid/Storage/BufferStorage.mo
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ model BufferStorage

parameter SI.Temperature TStart=298.15 "Start Temperature of fluid" annotation (Dialog(tab="Initialization", group="Storage specific"));

replaceable parameter DataBase.Storage.BufferStorageBaseDataDefinition data constrainedby DataBase.Storage.BufferStorageBaseDataDefinition "Data record for Storage"
replaceable parameter DataBase.Storage.BufferStorageBaseDataDefinition data constrainedby
DataBase.Storage.BufferStorageBaseDataDefinition "Data record for Storage"
annotation (choicesAllMatching);

parameter Integer n(min=3)=5 " Model assumptions Number of Layers";
Expand Down Expand Up @@ -126,17 +127,20 @@ model BufferStorage
extent={{-5,5},{5,-5}},
rotation=0,
origin={-80,-80})));
Modelica.Fluid.Interfaces.FluidPort_a fluidportTop1( redeclare final package Medium =
Modelica.Fluid.Interfaces.FluidPort_a fluidportTop1( redeclare final package
Medium =
Medium)
"Fluid connector a (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{-38,92},{-18,110}},rotation=
0), iconTransformation(extent={{-38,92},{-18,110}})));
Modelica.Fluid.Interfaces.FluidPort_a fluidportBottom2(redeclare final package Medium =
Modelica.Fluid.Interfaces.FluidPort_a fluidportBottom2(redeclare final
package Medium =
Medium)
"Fluid connector a (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{14,-110},{32,-92}},rotation=
0), iconTransformation(extent={{14,-110},{32,-92}})));
Modelica.Fluid.Interfaces.FluidPort_b fluidportBottom1( redeclare final package Medium =
Modelica.Fluid.Interfaces.FluidPort_b fluidportBottom1( redeclare final
package Medium =
Medium)
"Fluid connector b (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{-36,-112},{-18,-92}},
Expand All @@ -161,6 +165,7 @@ model BufferStorage
each final C_start=C_start,
each final C_nominal=C_nominal,
each final mSenFac=mSenFac,
m_flow_small=m_flow_small,
final V=fill(data.hTank/n*Modelica.Constants.pi/4*data.dTank^2,n),
final nPorts = portsLayer,
final T_start=fill(TStart,n),
Expand Down Expand Up @@ -277,6 +282,7 @@ model BufferStorage
origin={6,-44})));

AixLib.Fluid.Storage.BaseClasses.HeatingCoil heatingCoil1(
m_flow_small=m_flow_small_HC1,
disHC=disHC1,
hConHC=hConHC1,
redeclare package Medium = MediumHC1,
Expand All @@ -290,6 +296,7 @@ model BufferStorage
rotation=270,
origin={-58,29})));
AixLib.Fluid.Storage.BaseClasses.HeatingCoil heatingCoil2(
m_flow_small=m_flow_small_HC2,
disHC=disHC2,
lengthHC=data.lengthHC2,
hConHC=hConHC2,
Expand All @@ -303,6 +310,12 @@ model BufferStorage
rotation=270,
origin={-56,-39})));

parameter SI.MassFlowRate m_flow_small_HC1=1E-4*abs(mHC1_flow_nominal)
"Small mass flow rate for regularization of zero flow" annotation(Dialog(tab="Advanced"));
parameter SI.MassFlowRate m_flow_small_HC2=1E-4*abs(mHC1_flow_nominal)
"Small mass flow rate for regularization of zero flow" annotation(Dialog(tab="Advanced"));
parameter SI.MassFlowRate m_flow_small=1E-4*abs(m1_flow_nominal + m2_flow_nominal)
"Small mass flow rate for regularization of zero flow" annotation(Dialog(tab="Advanced"));
initial equation
assert(data.hHC1Up<=data.hTank and data.hHC1Up>=0.0 and
data.hHC1Low<=data.hTank and data.hHC1Low>=0.0,
Expand Down
3 changes: 2 additions & 1 deletion AixLib/Fluid/Storage/Examples/BufferStorage.mo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ model BufferStorage
upToDownHC1=false,
upToDownHC2=false,
useHeatingRod=false,
redeclare model HeatTransfer = AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter,
redeclare model HeatTransfer =
AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter,
redeclare package MediumHC1 = Medium,
redeclare package MediumHC2 = Medium,
TStart=303.15) annotation (Placement(transformation(extent={{0,0},{-20,24}})));
Expand Down