diff --git a/AixLib/Fluid/Storage/BufferStorage.mo b/AixLib/Fluid/Storage/BufferStorage.mo index 36fd01940b..05ea5c01b0 100644 --- a/AixLib/Fluid/Storage/BufferStorage.mo +++ b/AixLib/Fluid/Storage/BufferStorage.mo @@ -65,29 +65,42 @@ model BufferStorage parameter Modelica.SIunits.Temperature TStartIns=293.15 "Starting Temperature of insulation in K" annotation(Dialog(tab="Initialization", group="Storage specific")); +//////////////////////////////////////////////////////////////////////////////////////////////////// +////////////Advanced parameters///////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////// + parameter Integer nLowerPortSupply=integer(max(AixLib.Utilities.Math.Functions.round(data.hLowerPortSupply/(data.hTank/n) + 0.5,0),1)) "Layer number lower end of supply is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nUpperPortSupply=integer(min(AixLib.Utilities.Math.Functions.round(data.hUpperPortSupply/(data.hTank/n) + 0.5,0),n)) "Layer number upper end of supply is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nLowerPortDemand=integer(max(AixLib.Utilities.Math.Functions.round(data.hLowerPortDemand/(data.hTank/n) + 0.5,0),1)) "Layer number lower end of demand is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nUpperPortDemand=integer(min(AixLib.Utilities.Math.Functions.round(data.hUpperPortDemand/(data.hTank/n) + 0.5,0),n)) "Layer number upper end of demand is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nTS1=integer(AixLib.Utilities.Math.Functions.round(data.hTS1/(data.hTank/n) + 0.5,0)) "Layer number lower temperature sensor is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nTS2=integer(AixLib.Utilities.Math.Functions.round(data.hTS2/(data.hTank/n) + 0.5,0)) "Layer number upper temperature sensor is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + + parameter Integer nHC1Up=integer(ceil(data.hHC1Up/(data.hTank/n))) "Layer number upper end of heating coil 1 is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nHC1Low=integer(floor(data.hHC1Low/(data.hTank/n))+1) "Layer number lower end of heating coil 1 is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nHC2Up=integer(ceil(data.hHC2Up/(data.hTank/n))) "Layer number upper end of heating coil 2 is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nHC2Low=integer(floor(data.hHC2Low/(data.hTank/n))+1) "Layer number lower end of heating coil 2 is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + parameter Integer nHR=integer(AixLib.Utilities.Math.Functions.round(data.hHR/(data.hTank/n) + 0.5,0)) "Layer number heating rod is connected to" + annotation (Dialog(tab="Advanced", group="Connection Layers: !Any modification will overwrite the data record behaviour!", descriptionLabel = true)); + //////////////////////////////////////////////////////////////////////////////////////////////////// ////////////final parameters//////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// - final parameter Integer nHC1Up=integer(ceil(data.hHC1Up/(data.hTank/n))); - final parameter Integer nHC1Low=integer(floor(data.hHC1Low/(data.hTank/n))+1); final parameter Integer disHC1 = nHC1Up-nHC1Low+1; - - final parameter Integer nHC2Up=integer(ceil(data.hHC2Up/(data.hTank/n))); - final parameter Integer nHC2Low=integer(floor(data.hHC2Low/(data.hTank/n))+1); final parameter Integer disHC2 = nHC2Up-nHC2Low+1; - final parameter Integer nHR=integer(AixLib.Utilities.Math.Functions.round(data.hHR/(data.hTank/n) + 0.5,0)); - - final parameter Integer nTS1=integer(AixLib.Utilities.Math.Functions.round(data.hTS1/(data.hTank/n) + 0.5,0)); - final parameter Integer nTS2=integer(AixLib.Utilities.Math.Functions.round(data.hTS2/(data.hTank/n) + 0.5,0)); - - final parameter Integer nLowerPortDemand=integer(max(AixLib.Utilities.Math.Functions.round(data.hLowerPortDemand/(data.hTank/n) + 0.5,0),1)); - final parameter Integer nUpperPortDemand=integer(min(AixLib.Utilities.Math.Functions.round(data.hUpperPortDemand/(data.hTank/n) + 0.5,0),n)); final parameter Boolean inpLowLayDemand=(nLowerPortDemand == 1); //if there is an input at the lowest layer final parameter Boolean inpHigLayDemand=(nUpperPortDemand == n); - final parameter Integer nLowerPortSupply=integer(max(AixLib.Utilities.Math.Functions.round(data.hLowerPortSupply/(data.hTank/n) + 0.5,0),1)); - final parameter Integer nUpperPortSupply=integer(min(AixLib.Utilities.Math.Functions.round(data.hUpperPortSupply/(data.hTank/n) + 0.5,0),n)); final parameter Boolean inpLowLaySupply=(nLowerPortSupply == 1); //if there is an input at the lowest layer final parameter Boolean inpHigLaySupply=(nUpperPortSupply == n); @@ -126,7 +139,7 @@ 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= @@ -136,7 +149,7 @@ model BufferStorage "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}},