Buildings.Fluid.DataCenters.CDUs.BaseClasses

Package with base classes

Information

This package contains base classes that are used to construct the classes in Buildings.Fluid.DataCenters.CDUs.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialCDU PartialCDU Partial model for a CDU
Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort PartialFourPort Partial model with four ports
Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface PartialFourPortInterface Partial model with four ports and declaration of quantities that are used by CDU models

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialCDU Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialCDU

Partial model for a CDU

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialCDU

Information

Model of a coolant distribution unit (CDU) with built in two-way valve on the chilled water side and pump on the IT side as shown in the figure below.

Schematic diagram of the CDU.

The two fluid streams are separated by a heat exchanger.

On the chilled water side is a two-way valve that controls the mass flow rate to track to set point for the leaving fluid temperature that goes to the IT racks. By default, the controller is configured as a PI-controller. The valve has an equal-percentage opening characteristics. By default, the valve pressure drop is set to the same value as the heat exchanger pressure drop, achieving a valve authority of 0.5. The valve is modeled using an instance of Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage.

On the IT side is a circulation pump that is controlled to track a set point for the head between the two fluid ports. Note that this head is not the pump head, but rather the head between the fluid ports of the CDU, and hence it takes into account the flow resistance of the heat exchanger. The controller for the pump is configured by default as a PI-controller.

Note that the head, specified through the parameter dpPum_nominal, is the head of the CDU. To properly size the pump, set dpPum_nominal to the flow resistance that is external to the CDU, plus the flow resistance of the heat exchanger dpHex_nominal and the filter.

The pump is modeled using an instance of Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y.

On the IT side, there is also an expansion vessel, modeled using an instance of Buildings.Fluid.Storage.ExpansionVessel. This component sets a reference static pressure, and if the medium model computes density as a function of temperature during the simulation, it provides a volume for the medium's thermal expansion. Note however that to improve computing performance, the medium Buildings.Media.Antifreeze.PropyleneGlycolWater assumes density as constant during the simulation.

Extends from Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by CDU models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPlaPartialMediumMedium in the plant-side component
replaceable package MediumRacPartialMediumMedium in the rack-side component
Generic_epsNTUdat Data record for performance characterization
BooleanaddPowerToMediumtrueSet to false to avoid any power from the pump (=heat and flow work) being added to medium (may give simpler equations)
PartialFourPortInterfacehexredeclare Buildings.Fluid.In...Heat exchanger
flowParameterspumpHeadMonotonepumpHeadMonotone(V_flow=dat....Actual head of the pump, corrected to impose a minimum descent of the pump curve
Nominal condition
MassFlowRatemPla_flow_nominaldat.mPla_flow_nominalNominal mass flow rate [kg/s]
MassFlowRatemRac_flow_nominaldat.mRac_flow_nominalNominal mass flow rate [kg/s]
Valve controller
SimpleControllercontrollerTypeValBuildings.Controls.OBC.CDL.T...Type of controller for valve
RealkVal1Gain of controller for valve
RealTiVal120Time constant of integrator block of valve controller
RealTdVal0.1Time constant of derivative block for valve controller
Pump controller
SimpleControllercontrollerTypePumBuildings.Controls.OBC.CDL.T...Type of controller for pump
RealkPum1Gain of controller for pump
RealTiPum120Time constant of integrator block of pump controller
RealTdPum0.1Time constant of derivative block for pump controller
Assumptions
BooleanallowFlowReversalPlatrue= false to simplify equations, assuming, but not enforcing, no flow reversal for plant-side medium
BooleanallowFlowReversalRactrue= false to simplify equations, assuming, but not enforcing, no flow reversal for rack-side medium
Advanced
MassFlowRatemPla_flow_small1E-4*abs(mPla_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatemRac_flow_small1E-4*abs(mRac_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
BooleancheckMediatrueSet to false to disable media consistency check
Flow resistance
Medium 1
BooleancomputeFlowResistancePlatrue=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dpPlafalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancePlafalse= true, use linear relation between m_flow and dp for any flow rate
Medium 2
BooleancomputeFlowResistanceRactrue=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dpRacfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistanceRacfalse= true, use linear relation between m_flow and dp for any flow rate
Dynamics
Valve
Booleanuse_strokeTimetrueSet to true to continuously open and close valve using strokeTime from instance dat
InitinitValModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
RealyVal_start1Initial position of actuator
Pump
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Booleanuse_riseTimetrueSet to true to continuously change motor speed using risetime from instance dat
RealyPum_start0Initial value of speed

Connectors

TypeNameDescription
FluidPort_aport_aPlaFluid connector aPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_bport_bPlaFluid connector bPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_aport_aRacFluid connector aRac (positive design flow direction is from port_aRac to port_bRac)
FluidPort_bport_bRacFluid connector bRac (positive design flow direction is from port_aRac to port_bRac)
input RealInputTSetSet point temperature for water leaving to the IT rack [K]
input RealInputdpSetSet point for static pressure provided by CDU [Pa]
output RealOutputPElectrical power consumed by pump [W]

Modelica definition

model PartialCDU "Partial model for a CDU" extends Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface( final mPla_flow_nominal=dat.mPla_flow_nominal, final mRac_flow_nominal=dat.mRac_flow_nominal); parameter Buildings.Fluid.DataCenters.CDUs.LiquidToLiquid.Data.Generic_epsNTU dat "Data record for performance characterization"; parameter Boolean checkMedia=true "Set to false to disable media consistency check"; // Flow resistance parameters parameter Boolean computeFlowResistancePla=true "=true, compute flow resistance. Set to false to assume no friction"; parameter Boolean from_dpPla=false "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Boolean linearizeFlowResistancePla=false "= true, use linear relation between m_flow and dp for any flow rate"; parameter Boolean computeFlowResistanceRac=true "=true, compute flow resistance. Set to false to assume no friction"; parameter Boolean from_dpRac=false "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Boolean linearizeFlowResistanceRac=false "= true, use linear relation between m_flow and dp for any flow rate"; // Valve parameter Boolean use_strokeTime=true "Set to true to continuously open and close valve using strokeTime from instance dat"; parameter Modelica.Blocks.Types.Init initVal=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; parameter Real yVal_start=1 "Initial position of actuator"; // Pump parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Modelica.Units.SI.Time tau=1 "Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic"; parameter Boolean use_riseTime=true "Set to true to continuously change motor speed using risetime from instance dat"; parameter Real yPum_start=0 "Initial value of speed"; parameter Boolean addPowerToMedium=true "Set to false to avoid any power from the pump (=heat and flow work) being added to medium (may give simpler equations)"; // Valve controller parameters parameter Controls.OBC.CDL.Types.SimpleController controllerTypeVal=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for valve"; parameter Real kVal=1 "Gain of controller for valve"; parameter Real TiVal=120 "Time constant of integrator block of valve controller"; parameter Real TdVal=0.1 "Time constant of derivative block for valve controller"; // Pump controller parameters parameter Controls.OBC.CDL.Types.SimpleController controllerTypePum=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for pump"; parameter Real kPum=1 "Gain of controller for pump"; parameter Real TiPum=120 "Time constant of integrator block of pump controller"; parameter Real TdPum=0.1 "Time constant of derivative block for pump controller"; // Connectors Buildings.Controls.OBC.CDL.Interfaces.RealInput TSet( final unit="K", displayUnit="degC") "Set point temperature for water leaving to the IT rack"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpSet(min=0, final unit="Pa") "Set point for static pressure provided by CDU"; Modelica.Blocks.Interfaces.RealOutput P( final unit="W") "Electrical power consumed by pump"; // Components Controls.OBC.CDL.Reals.PID conVal( u_s(final unit="K", displayUnit="degC"), u_m(final unit="K", displayUnit="degC"), final controllerType=controllerTypeVal, final k=kVal, final Ti=TiVal, final Td=TdVal, final reverseActing=false, r=10, xi_start=1) "Controller for valve"; Controls.OBC.CDL.Reals.PID conPum( u_s(final unit="Pa"), u_m(final unit="Pa"), final controllerType=controllerTypePum, final k=kPum, final Ti=TiPum, final Td=TdPum, final reverseActing=true, r=dat.dpPumpExt_nominal, xi_start=1) "Controller for pump"; replaceable Buildings.Fluid.Interfaces.PartialFourPortInterface hex constrainedby Buildings.Fluid.Interfaces.PartialFourPortInterface( redeclare final package Medium1 = MediumPla, redeclare final package Medium2 = MediumRac, final allowFlowReversal1=allowFlowReversalPla, final allowFlowReversal2=allowFlowReversalRac, final m1_flow_nominal=mPla_flow_nominal, final m2_flow_nominal=mRac_flow_nominal, final show_T=show_T) "Heat exchanger"; Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare final package Medium = MediumPla, final allowFlowReversal=allowFlowReversalPla, m_flow_nominal=dat.mPla_flow_nominal, final from_dp=from_dpPla, final linearized=linearizeFlowResistancePla, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, dpValve_nominal=dat.dpValve_nominal, final use_strokeTime=use_strokeTime, final strokeTime=dat.strokeTime, final init=initVal, final y_start=yVal_start) "Control valve on chilled water side"; // Use sqrt for efficiency because input is the total efficiency, but this is split up into a // motor and a hyraulic efficiency which are then multiplied with each other. Fluid.Movers.SpeedControlled_y pum( redeclare final package Medium = MediumRac, energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversalRac, addPowerToMedium=addPowerToMedium, final tau=tau, final use_riseTime=use_riseTime, final riseTime=dat.riseTime, final y_start=yPum_start, per( pressure=pumpHeadMonotone, powerOrEfficiencyIsHydraulic=true, etaHydMet=Buildings.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod.Efficiency_VolumeFlowRate, etaMotMet=Buildings.Fluid.Movers.BaseClasses.Types.MotorEfficiencyMethod.Efficiency_VolumeFlowRate, efficiency( V_flow=dat.pumpEfficiency.V_flow, eta={sqrt(dat.pumpEfficiency.eta[i]) for i in 1:size(dat.pumpEfficiency.eta, 1)}), motorEfficiency( V_flow=dat.pumpEfficiency.V_flow, eta={sqrt(dat.pumpEfficiency.eta[i]) for i in 1:size(dat.pumpEfficiency.eta, 1)})), final inputType=Buildings.Fluid.Types.InputType.Continuous, final init=Modelica.Blocks.Types.Init.InitialOutput) "Pump on IT side"; Fluid.FixedResistances.PressureDrop fil( redeclare final package Medium = MediumRac, final allowFlowReversal=allowFlowReversalRac, final m_flow_nominal=mRac_flow_nominal, final dp_nominal=dat.dpFilRac_nominal, final n=dat.nFilRac) "Filter"; Fluid.Storage.ExpansionVessel exp( redeclare package Medium = MediumRac, final V_start=dat.VExp) "Expansion vessel"; Fluid.Sensors.RelativePressure senRelPre( redeclare package Medium = MediumRac) "Differential pressure sensor"; Fluid.Sensors.TemperatureTwoPort senTemRacSup( redeclare final package Medium = MediumRac, final allowFlowReversal=allowFlowReversalRac, final m_flow_nominal=mRac_flow_nominal) "Temperature sensor for medium leaving towards IT racks"; parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters pumpHeadMonotone( V_flow=dat.pumpHead.V_flow, dp=if pumpDP_isMonotonicDecreasing then dat.pumpHead.dp else cat(1, {max(dat.pumpHead.dp[i], (1 + (nPumpDat-i)/nPumpDat/100) * max(dat.pumpHead.dp[i+1:nPumpDat])) for i in 1:nPumpDat-1}, {dat.pumpHead.dp[nPumpDat]})) "Actual head of the pump, corrected to impose a minimum descent of the pump curve"; protected final parameter Integer nPumpDat = size(dat.pumpHead.dp, 1) "Number of support point for pump data"; final parameter Boolean pumpDP_isMonotonicDecreasing = (dat.pumpHead.dp[1] > dat.pumpHead.dp[end]) and Buildings.Utilities.Math.Functions.isMonotonic( x=dat.pumpHead.dp, strict=false) "Flag, true if the pump pressure drop is monotonic"; initial equation if checkMedia then // Assert that the media are consistent with the medium types declared in the parameter record assert( (dat.medPla == Buildings.Fluid.DataCenters.CDUs.Types.Media.Water and Modelica.Utilities.Strings.find(MediumPla.mediumName, "Water") > 0) or (dat.medPla == Buildings.Fluid.DataCenters.CDUs.Types.Media.EthyleneGlycol and Modelica.Utilities.Strings.find(MediumPla.mediumName, "EthyleneGlycol") > 0) or (dat.medPla == Buildings.Fluid.DataCenters.CDUs.Types.Media.PropyleneGlycol and Modelica.Utilities.Strings.find(MediumPla.mediumName, "PropyleneGlycol") > 0), "In " + getInstanceName() + ": The plant-side medium '" + MediumPla.mediumName + "' does not match the medium type dat.medPla = " + String(dat.medPla) + " declared in the parameter record." + "\nSet the parameter checkMedia=false to avoid this check."); assert( (dat.medRac == Buildings.Fluid.DataCenters.CDUs.Types.Media.Water and Modelica.Utilities.Strings.find(MediumRac.mediumName, "Water") > 0) or (dat.medRac == Buildings.Fluid.DataCenters.CDUs.Types.Media.EthyleneGlycol and Modelica.Utilities.Strings.find(MediumRac.mediumName, "EthyleneGlycol") > 0) or (dat.medRac == Buildings.Fluid.DataCenters.CDUs.Types.Media.PropyleneGlycol and Modelica.Utilities.Strings.find(MediumRac.mediumName, "PropyleneGlycol") > 0), "In " + getInstanceName() + ": The rack-side medium '" + MediumRac.mediumName + "' does not match the medium type dat.medRac = " + String(dat.medRac) + " declared in the parameter record." + "\nSet the parameter checkMedia=false to avoid this check."); end if; assert(pumpDP_isMonotonicDecreasing, "In " + getInstanceName() + ": Parameter dat.pumpHead is not monotonic decreasing. This is usually if dat.dpHexRac_nominal + dat.dpFilRac_nominal are too large compared to the decrease in dat.pumpExtHead. The model will use pumpHeadMonotone instead of dat.pumpHead. Please check your data to avoid this warning. Model has the following parameters: dat.dpHexRac_nominal + dpFilRac_nominal = " + String(dat.dpHexRac_nominal) + " + " + String(dat.dpFilRac_nominal) + " = " + String(dat.dpHexRac_nominal + dat.dpFilRac_nominal) + " Pa dat.pumpExtHead.dp[1] - dat.pumpExtHead.dp[end] = " + String(dat.pumpExtHead.dp[1] - dat.pumpExtHead.dp[end]) + " Pa.", level=AssertionLevel.warning); equation connect(port_aPla, val.port_a); connect(val.port_b, hex.port_a1); connect(hex.port_b1, port_bPla); connect(pum.port_a, hex.port_b2); connect(pum.P, P); connect(pum.port_a, exp.port_a); connect(senRelPre.port_b, port_aRac); connect(senRelPre.port_a, port_bRac); connect(dpSet, conPum.u_s); connect(senRelPre.p_rel, conPum.u_m); connect(TSet, conVal.u_s); connect(senTemRacSup.T, conVal.u_m); connect(conVal.y, val.y); connect(conPum.y, pum.y); connect(senTemRacSup.port_b, port_bRac); connect(senTemRacSup.port_a, fil.port_b); connect(fil.port_a, pum.port_b); connect(hex.port_a2, port_aRac); end PartialCDU;

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort

Partial model with four ports

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort

Information

This model defines an interface for components with four ports. The parameters allowFlowReversalPla and allowFlowReversalRac may be used by models that extend this model to treat flow reversal.

This model is identical to Buildings.Fluid.Interfaces.PartialFourPort, except that instances have been renamed for use with CDUs.

Parameters

TypeNameDefaultDescription
replaceable package MediumPlaModelica.Media.Interfaces.Pa...Medium in the plant-side component
replaceable package MediumRacModelica.Media.Interfaces.Pa...Medium in the rack-side component
Assumptions
BooleanallowFlowReversalPlatrue= false to simplify equations, assuming, but not enforcing, no flow reversal for plant-side medium
BooleanallowFlowReversalRactrue= false to simplify equations, assuming, but not enforcing, no flow reversal for rack-side medium

Connectors

TypeNameDescription
replaceable package MediumPlaMedium in the plant-side component
replaceable package MediumRacMedium in the rack-side component
FluidPort_aport_aPlaFluid connector aPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_bport_bPlaFluid connector bPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_aport_aRacFluid connector aRac (positive design flow direction is from port_aRac to port_bRac)
FluidPort_bport_bRacFluid connector bRac (positive design flow direction is from port_aRac to port_bRac)

Modelica definition

partial model PartialFourPort "Partial model with four ports" replaceable package MediumPla = Modelica.Media.Interfaces.PartialMedium "Medium in the plant-side component"; replaceable package MediumRac = Modelica.Media.Interfaces.PartialMedium "Medium in the rack-side component"; parameter Boolean allowFlowReversalPla = true "= false to simplify equations, assuming, but not enforcing, no flow reversal for plant-side medium"; parameter Boolean allowFlowReversalRac = true "= false to simplify equations, assuming, but not enforcing, no flow reversal for rack-side medium"; Modelica.Fluid.Interfaces.FluidPort_a port_aPla( redeclare final package Medium = MediumPla, m_flow(min=if allowFlowReversalPla then -Modelica.Constants.inf else 0), h_outflow(start = MediumPla.h_default, nominal = MediumPla.h_default)) "Fluid connector aPla (positive design flow direction is from port_aPla to port_bPla)"; Modelica.Fluid.Interfaces.FluidPort_b port_bPla( redeclare final package Medium = MediumPla, m_flow(max=if allowFlowReversalPla then +Modelica.Constants.inf else 0), h_outflow(start = MediumPla.h_default, nominal = MediumPla.h_default)) "Fluid connector bPla (positive design flow direction is from port_aPla to port_bPla)"; Modelica.Fluid.Interfaces.FluidPort_a port_aRac( redeclare final package Medium = MediumRac, m_flow(min=if allowFlowReversalRac then -Modelica.Constants.inf else 0), h_outflow(start = MediumRac.h_default, nominal = MediumRac.h_default)) "Fluid connector aRac (positive design flow direction is from port_aRac to port_bRac)"; Modelica.Fluid.Interfaces.FluidPort_b port_bRac( redeclare final package Medium = MediumRac, m_flow(max=if allowFlowReversalRac then +Modelica.Constants.inf else 0), h_outflow(start = MediumRac.h_default, nominal = MediumRac.h_default)) "Fluid connector bRac (positive design flow direction is from port_aRac to port_bRac)"; end PartialFourPort;

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface

Partial model with four ports and declaration of quantities that are used by CDU models

Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPortInterface

Information

This component defines the interface for models with four fluid ports and two fluid streams. It is similar to Buildings.Fluid.Interfaces.PartialFourPortInterface, but it has four ports instead of two, and the ports are renamed for CDUs.

Extends from Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort (Partial model with four ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPlaPartialMediumMedium in the plant-side component
replaceable package MediumRacPartialMediumMedium in the rack-side component
Nominal condition
MassFlowRatemPla_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatemRac_flow_nominal Nominal mass flow rate [kg/s]
Assumptions
BooleanallowFlowReversalPlatrue= false to simplify equations, assuming, but not enforcing, no flow reversal for plant-side medium
BooleanallowFlowReversalRactrue= false to simplify equations, assuming, but not enforcing, no flow reversal for rack-side medium
Advanced
MassFlowRatemPla_flow_small1E-4*abs(mPla_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatemRac_flow_small1E-4*abs(mRac_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
FluidPort_aport_aPlaFluid connector aPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_bport_bPlaFluid connector bPla (positive design flow direction is from port_aPla to port_bPla)
FluidPort_aport_aRacFluid connector aRac (positive design flow direction is from port_aRac to port_bRac)
FluidPort_bport_bRacFluid connector bRac (positive design flow direction is from port_aRac to port_bRac)

Modelica definition

partial model PartialFourPortInterface "Partial model with four ports and declaration of quantities that are used by CDU models" extends Buildings.Fluid.DataCenters.CDUs.BaseClasses.PartialFourPort; parameter Modelica.Units.SI.MassFlowRate mPla_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mRac_flow_nominal(min=0) "Nominal mass flow rate"; parameter MediumPla.MassFlowRate mPla_flow_small(min=0) = 1E-4*abs(mPla_flow_nominal) "Small mass flow rate for regularization of zero flow"; parameter MediumRac.MassFlowRate mRac_flow_small(min=0) = 1E-4*abs(mRac_flow_nominal) "Small mass flow rate for regularization of zero flow"; // Diagnostics parameter Boolean show_T = false "= true, if actual temperature at port is computed"; MediumPla.MassFlowRate mPla_flow = port_aPla.m_flow "Mass flow rate from port_aPla to port_bPla (mPla_flow > 0 is design flow direction)"; Modelica.Units.SI.PressureDifference dpPla(displayUnit="Pa") = port_aPla.p - port_bPla.p "Pressure difference between port_aPla and port_bPla"; MediumRac.MassFlowRate mRac_flow = port_aRac.m_flow "Mass flow rate from port_aRac to port_bRac (mRac_flow > 0 is design flow direction)"; Modelica.Units.SI.PressureDifference dpRac(displayUnit="Pa") = port_aRac.p - port_bRac.p "Pressure difference between port_aRac and port_bRac"; MediumPla.ThermodynamicState sta_aPla= if allowFlowReversalPla then MediumPla.setState_phX(port_aPla.p, noEvent(actualStream(port_aPla.h_outflow)), noEvent(actualStream(port_aPla.Xi_outflow))) else MediumPla.setState_phX(port_aPla.p, inStream(port_aPla.h_outflow), inStream(port_aPla.Xi_outflow)) if show_T "Medium properties in port_aPla"; MediumPla.ThermodynamicState sta_bPla= if allowFlowReversalPla then MediumPla.setState_phX(port_bPla.p, noEvent(actualStream(port_bPla.h_outflow)), noEvent(actualStream(port_bPla.Xi_outflow))) else MediumPla.setState_phX(port_bPla.p, port_bPla.h_outflow, port_bPla.Xi_outflow) if show_T "Medium properties in port_bPla"; MediumRac.ThermodynamicState sta_aRac= if allowFlowReversalRac then MediumRac.setState_phX(port_aRac.p, noEvent(actualStream(port_aRac.h_outflow)), noEvent(actualStream(port_aRac.Xi_outflow))) else MediumRac.setState_phX(port_aRac.p, inStream(port_aRac.h_outflow), inStream(port_aRac.Xi_outflow)) if show_T "Medium properties in port_aRac"; MediumRac.ThermodynamicState sta_bRac= if allowFlowReversalRac then MediumRac.setState_phX(port_bRac.p, noEvent(actualStream(port_bRac.h_outflow)), noEvent(actualStream(port_bRac.Xi_outflow))) else MediumRac.setState_phX(port_bRac.p, port_bRac.h_outflow, port_bRac.Xi_outflow) if show_T "Medium properties in port_bRac"; protected MediumPla.ThermodynamicState state_aPla_inflow= MediumPla.setState_phX(port_aPla.p, inStream(port_aPla.h_outflow), inStream(port_aPla.Xi_outflow)) "state for medium inflowing through port_aPla"; MediumPla.ThermodynamicState state_bPla_inflow= MediumPla.setState_phX(port_bPla.p, inStream(port_bPla.h_outflow), inStream(port_bPla.Xi_outflow)) "state for medium inflowing through port_bPla"; MediumRac.ThermodynamicState state_aRac_inflow= MediumRac.setState_phX(port_aRac.p, inStream(port_aRac.h_outflow), inStream(port_aRac.Xi_outflow)) "state for medium inflowing through port_aRac"; MediumRac.ThermodynamicState state_bRac_inflow= MediumRac.setState_phX(port_bRac.p, inStream(port_bRac.h_outflow), inStream(port_bRac.Xi_outflow)) "state for medium inflowing through port_bRac"; end PartialFourPortInterface;