diff --git a/Buildings/Experimental/DHC/CentralPlants/BaseClasses/PartialPlant.mo b/Buildings/Experimental/DHC/CentralPlants/BaseClasses/PartialPlant.mo index 68bd76cda72..ab918a3ffe3 100644 --- a/Buildings/Experimental/DHC/CentralPlants/BaseClasses/PartialPlant.mo +++ b/Buildings/Experimental/DHC/CentralPlants/BaseClasses/PartialPlant.mo @@ -1,8 +1,6 @@ within Buildings.Experimental.DHC.CentralPlants.BaseClasses; partial model PartialPlant "Partial class for modeling a central plant" - import TypDisSys=Buildings.Experimental.DHC.Types.DistrictSystemType - "District system type enumeration"; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Service side medium"; @@ -12,7 +10,8 @@ partial model PartialPlant annotation(Dialog(enable= typ == TypDisSys.CombinedGeneration1 or typ == TypDisSys.HeatingGeneration1)); - parameter TypDisSys typ=TypDisSys.CombinedGeneration2to4 + parameter Buildings.Experimental.DHC.Types.DistrictSystemType + typ=Buildings.Experimental.DHC.Types.DistrictSystemType.CombinedGeneration2to4 "Type of district system" annotation (Evaluate=true, Dialog(group="Configuration")); parameter Boolean have_fan=false @@ -45,7 +44,7 @@ partial model PartialPlant redeclare package Medium = Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if - typ == TypDisSys.CombinedGeneration5 + have_serAmb "Fluid connector for ambient water service supply line" annotation ( Placement(transformation(extent={{-310,30},{-290,50}}), @@ -54,7 +53,7 @@ partial model PartialPlant redeclare package Medium = Medium, m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if - typ == TypDisSys.CombinedGeneration5 + have_serAmb "Fluid connector for ambient water service return line" annotation ( Placement(transformation(extent={{290,30},{310,50}}), @@ -62,9 +61,7 @@ partial model PartialPlant Modelica.Fluid.Interfaces.FluidPort_a port_aSerHea( redeclare package Medium = Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if - typ <> TypDisSys.Cooling and - typ <> TypDisSys.CombinedGeneration5 + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if have_hea "Fluid connector for heating service supply line" annotation (Placement( transformation(extent={{-310,-10},{-290,10}}), iconTransformation( @@ -72,9 +69,7 @@ partial model PartialPlant Modelica.Fluid.Interfaces.FluidPort_b port_bSerHea( redeclare package Medium = MediumHea_b, m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), - h_outflow(start=MediumHea_b.h_default, nominal=MediumHea_b.h_default)) if - typ <> TypDisSys.Cooling and - typ <> TypDisSys.CombinedGeneration5 + h_outflow(start=MediumHea_b.h_default, nominal=MediumHea_b.h_default)) if have_hea "Fluid connector for heating service return line" annotation (Placement( transformation(extent={{290,-10},{310,10}}), iconTransformation( @@ -83,18 +78,14 @@ partial model PartialPlant redeclare package Medium = Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if - typ == TypDisSys.CombinedGeneration1 or - typ == TypDisSys.CombinedGeneration2to4 or - typ == TypDisSys.Cooling + have_coo "Fluid connector for cooling service supply line" annotation (Placement(transformation(extent={{-310,-50},{-290,-30}}))); Modelica.Fluid.Interfaces.FluidPort_b port_bSerCoo( redeclare package Medium = Medium, m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if - typ == TypDisSys.CombinedGeneration1 or - typ == TypDisSys.CombinedGeneration2to4 or - typ == TypDisSys.Cooling + have_coo "Fluid connector for cooling service return line" annotation (Placement( transformation(extent={{290,-50},{310,-30}}), iconTransformation( @@ -129,6 +120,16 @@ partial model PartialPlant annotation ( Placement(transformation(extent={{300,100},{340,140}}), iconTransformation(extent={{300,80},{380,160}}))); +protected + final parameter Boolean have_hea=typ <> Buildings.Experimental.DHC.Types.DistrictSystemType.Cooling and + typ <> Buildings.Experimental.DHC.Types.DistrictSystemType.CombinedGeneration5 + "Boolean flag to enable fluid connectors for heating service line"; + final parameter Boolean have_coo=typ == Buildings.Experimental.DHC.Types.DistrictSystemType.CombinedGeneration1 or + typ == Buildings.Experimental.DHC.Types.DistrictSystemType.CombinedGeneration2to4 or + typ == Buildings.Experimental.DHC.Types.DistrictSystemType.Cooling + "Boolean flag to enable fluid connectors for cooling service line"; + final parameter Boolean have_serAmb=typ == Buildings.Experimental.DHC.Types.DistrictSystemType.CombinedGeneration5 + "Boolean flag to enable fluid connector for ambient water service line"; annotation ( defaultComponentName="plan", Documentation( @@ -150,6 +151,10 @@ return. revisions="
if
statement to correctly enable and disable the fluid connector under different system types.
+