diff --git a/AixLib/Fluid/Storage/BufferStorage.mo b/AixLib/Fluid/Storage/BufferStorage.mo index 2df8a7f2ec..5016cd2639 100644 --- a/AixLib/Fluid/Storage/BufferStorage.mo +++ b/AixLib/Fluid/Storage/BufferStorage.mo @@ -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"; @@ -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}}, @@ -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), @@ -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, @@ -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, @@ -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, diff --git a/AixLib/Fluid/Storage/Examples/BufferStorage.mo b/AixLib/Fluid/Storage/Examples/BufferStorage.mo index 5241e65cdb..2fad30207e 100644 --- a/AixLib/Fluid/Storage/Examples/BufferStorage.mo +++ b/AixLib/Fluid/Storage/Examples/BufferStorage.mo @@ -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}})));