Skip to content

Commit

Permalink
Fix minor issue of missing dpDHW_nominal by adding bottom-up and top-…
Browse files Browse the repository at this point in the history
…down parameter for it
  • Loading branch information
FWuellhorst committed Jun 19, 2024
1 parent 156b96c commit 00ab622
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 13 deletions.
27 changes: 15 additions & 12 deletions BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ partial model PartialBuildingEnergySystem "Partial BES"
Demand.DHW.BaseClasses.PartialDHW(
redeclare final package Medium = MediumDHW,
final TDHW_nominal=systemParameters.TSetDHW,
final dpDHW_nominal=hydraulic.distribution.dpDHW_nominal,
final TDHWCold_nominal=systemParameters.TDHWWaterCold,
final subsystemDisabled=not systemParameters.use_dhw)
annotation (choicesAllMatching=true, Placement(
Expand Down Expand Up @@ -191,8 +192,8 @@ equation
color={255,204,51},
thickness=0.5));
connect(hydraulic.outBusHyd, outputs.hydraulic) annotation (Line(
points={{-124.516,-98.6857},{-124.516,-100},{-124,-100},{-124,-124},{244,
-124},{244,0},{285,0}},
points={{-124.516,-98.6857},{-124.516,-100},{-124,-100},{-124,-124},{
244,-124},{244,0},{285,0}},
color={175,175,175},
thickness=0.5), Text(
string="%second",
Expand All @@ -207,8 +208,8 @@ equation
points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color=
{191,0,0}));
connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line(
points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{-157.358,
-2}},
points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{
-157.358,-2}},
color={0,127,0},
thickness=0.5));
connect(control.sigBusHyd, hydraulic.sigBusHyd) annotation (Line(
Expand All @@ -220,13 +221,15 @@ equation
points={{-225.167,150.775},{-32,150.775},{-32,-36},{60.9,-36},{60.9,-42}},
color={0,127,0},
thickness=0.5));
connect(hydraulic.portDHW_out, DHW.port_a) annotation (Line(points={{-42.8211,
-72.6286},{-2,-72.6286},{-2,-57.2},{2,-57.2}}, color={0,127,255}));
connect(hydraulic.portDHW_in, DHW.port_b) annotation (Line(points={{-42.8211,
-86.3429},{-2,-86.3429},{-2,-102.8},{2,-102.8}}, color={0,127,255}));
connect(hydraulic.portDHW_out, DHW.port_a) annotation (Line(points={{
-42.8211,-72.6286},{-2,-72.6286},{-2,-57.2},{2,-57.2}},
color={0,127,255}));
connect(hydraulic.portDHW_in, DHW.port_b) annotation (Line(points={{
-42.8211,-86.3429},{-2,-86.3429},{-2,-102.8},{2,-102.8}},
color={0,127,255}));
connect(DHW.internalElectricalPin, electrical.internalElectricalPin[3]) annotation (Line(
points={{66.6,-117.24},{66.6,-126},{72,-126},{72,-140},{-210,-140},{-210,118},
{-198,118},{-198,118.171}},
points={{66.6,-117.24},{66.6,-126},{72,-126},{72,-140},{-210,-140},{-210,
118},{-198,118},{-198,118.171}},
color={0,0,0},
thickness=1));
connect(DHW.outBusDHW, outputs.DHW) annotation (Line(
Expand All @@ -240,8 +243,8 @@ equation

connect(electrical.internalElectricalPin[1], hydraulic.internalElectricalPin)
annotation (Line(
points={{-198,118.171},{-198,118},{-210,118},{-210,-140},{-56,-140},{-56,-124},
{-54.3158,-124},{-54.3158,-98}},
points={{-198,118.171},{-198,118},{-210,118},{-210,-140},{-56,-140},{-56,
-124},{-54.3158,-124},{-54.3158,-98}},
color={0,0,0},
thickness=1));
else
Expand Down
3 changes: 3 additions & 0 deletions BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)"
parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal(min=1e-60)
"Nominal mass flow rate"
annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem"));
parameter Modelica.Units.SI.PressureDifference dpDHW_nominal=0
"Nominal pressure drop" annotation (Dialog(group=
"Design - Top Down: Parameters are given by the parent system"));
parameter Modelica.Units.SI.Temperature TDHW_nominal
"Nominal DHW temperature"
annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC
final m_flow_small=1E-4*abs(mDHW_flow_nominal),
final show_T=show_T,
final m_flow_nominal=mDHW_flow_nominal,
final dp_nominal(displayUnit="Pa") = 100,
final dp_nominal(displayUnit="Pa") = if dpDHW_nominal <> 0 then
dpDHW_nominal else 100,
final addPowerToMedium=parPum.addPowerToMedium,
final tau=parPum.tau,
final use_inputFilter=parPum.use_inputFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ model PartialDHWParameters
parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal(min=Modelica.Constants.eps)
"Nominal mass flow rate" annotation (Dialog(group=
"Design - Top Down: Parameters are given by the parent system"));
parameter Modelica.Units.SI.PressureDifference dpDHW_nominal=0
"Nominal pressure drop of DHW" annotation (Dialog(group=
"Design - Bottom Up: Parameters are defined by the subsystem"));
parameter Modelica.Units.SI.HeatFlowRate QDHW_flow_nominal(min=Modelica.Constants.eps)
"Nominal heat flow rate to DHW" annotation (Dialog(group="Design - Top Down: Parameters are given by the parent system"));
parameter Modelica.Units.SI.HeatFlowRate QDHWBefSto_flow_nominal(min=Modelica.Constants.eps) = max(Modelica.Constants.eps, if designType==BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage then QDHW_flow_nominal elseif designType==BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage then (((QCrit - (VStoDHW * 4184 * 1000 / 3600000) * (TDHW_nominal - 313.15)) / (tCrit/3600)) * 1000 + QDHWStoLoss_flow) elseif designType == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage then (VStoDHW * 4184 * 1000 / 3600000 / tCrit) * (TDHW_nominal - TDHWCold_nominal) else Modelica.Constants.eps)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
within BESMod.Systems.Hydraulical.Distribution.BaseClasses;
partial model PartialTwoStorageParallel "Partial model to later extent"
extends BaseClasses.PartialDistribution(
final dpDHW_nominal=0,
final dpDem_nominal={0},
final dpSup_nominal={parThrWayVal.dpValve_nominal + max(parThrWayVal.dp_nominal)},
final dTTraDHW_nominal=parStoDHW.dTLoadingHC1,
Expand Down
1 change: 1 addition & 0 deletions BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ within BESMod.Systems.Hydraulical.Distribution;
model BuildingOnly "Only loads building"
extends BaseClasses.PartialDistribution(
use_dhw=false,
final dpDHW_nominal=0,
final fFullSto=0,
final QDHWBefSto_flow_nominal=Modelica.Constants.eps,
final VStoDHW=0,
Expand Down
1 change: 1 addition & 0 deletions BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ within BESMod.Systems.Hydraulical.Distribution;
model CombiStorage
"Combi Storage for heating, dhw and solar assitance"
extends BaseClasses.PartialDistribution(
final dpDHW_nominal=sum(bufSto.heatingCoil1.pipe.res.dp_nominal),
dpSup_nominal={0,sum(bufSto.heatingCoil2.pipe.res.dp_nominal)},
final dpDem_nominal={0},
final VStoDHW=parameters.V,
Expand Down
1 change: 1 addition & 0 deletions BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ model DHWOnly "only loads DHW"
extends BaseClasses.PartialDistribution(
final VStoDHW=0,
final fFullSto=0,
final dpDHW_nominal=0,
final QDHWStoLoss_flow=0,
final designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage,
nParallelDem=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ within BESMod.Systems.Hydraulical.Distribution;
model DistributionTwoStorageParallel
"Buffer storage and DHW storage"
extends BaseClasses.PartialDistribution(
final dpDHW_nominal=0,
final VStoDHW=parStoDHW.V,
final QDHWStoLoss_flow=parStoDHW.QLoss_flow,
designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage,
Expand Down

0 comments on commit 00ab622

Please sign in to comment.