Buildings.Templates.Components.Interfaces

Interface classes

Information

This package contains interface classes.

Extends from Modelica.Icons.InterfacesPackage (Icon for packages containing interfaces).

Package Content

Name Description
Buildings.Templates.Components.Interfaces.Bus Bus Control bus
Buildings.Templates.Components.Interfaces.PartialCoil PartialCoil Interface class for coil
Buildings.Templates.Components.Interfaces.PartialDamper PartialDamper Interface class for damper
Buildings.Templates.Components.Interfaces.PartialFan PartialFan Interface class for fan
Buildings.Templates.Components.Interfaces.PartialSensor PartialSensor Interface class for sensor
Buildings.Templates.Components.Interfaces.PartialValve PartialValve Interface class for valve

Buildings.Templates.Components.Interfaces.Bus Buildings.Templates.Components.Interfaces.Bus

Control bus

Buildings.Templates.Components.Interfaces.Bus

Information

This expandable connector provides a standard interface for all control signals of the component models.

Extends from Modelica.Icons.SignalBus (Icon for signal bus).

Modelica definition

expandable connector Bus "Control bus" extends Modelica.Icons.SignalBus; end Bus;

Buildings.Templates.Components.Interfaces.PartialCoil Buildings.Templates.Components.Interfaces.PartialCoil

Interface class for coil

Buildings.Templates.Components.Interfaces.PartialCoil

Information

This partial class provides a standard interface for coil models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
replaceable package MediumAirBuildings.Media.AirAir medium
replaceable package MediumSouBuildings.Media.WaterSource-side medium
Coildatdat(final have_sou=have_sou,...Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominalmAir_flow_nominalNominal mass flow rate [kg/s]
Configuration
Coiltyp Equipment type
ValvetypVal Type of valve
Assumptions
BooleanallowFlowReversalallowFlowReversalAir= false to simplify equations, assuming, but not enforcing, no flow reversal
BooleanallowFlowReversalAirtrue= true to allow flow reversal, false restricts to design direction - Air side
BooleanallowFlowReversalLiqtrue= true to allow flow reversal, false restricts to design direction - CHW and HW side
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Nominal condition
Timetau20Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
replaceable package MediumAirAir medium
replaceable package MediumSouSource-side medium
FluidPort_aport_aSouFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bSouFluid connector b (positive design flow direction is from port_a to port_b)
BusbusWeaWeather bus
BusbusControl bus

Modelica definition

partial model PartialCoil "Interface class for coil" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( redeclare final package Medium=MediumAir, final m_flow_nominal=mAir_flow_nominal, final allowFlowReversal=allowFlowReversalAir); replaceable package MediumAir=Buildings.Media.Air "Air medium"; /* The following definition is needed only for Dymola that does not allow port_aSou and port_bSou to be instantiated without redeclaring their medium to a non-partial class (which is done only in the derived class). */ replaceable package MediumSou=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Source-side medium"; parameter Buildings.Templates.Components.Types.Coil typ "Equipment type"; parameter Buildings.Templates.Components.Types.Valve typVal "Type of valve"; final parameter Boolean have_sou= typ==Buildings.Templates.Components.Types.Coil.WaterBasedHeating or typ==Buildings.Templates.Components.Types.Coil.WaterBasedCooling "Set to true for fluid ports on the source side"; final parameter Boolean have_weaBus= typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed "Set to true to use a weather bus"; parameter Buildings.Templates.Components.Data.Coil dat( final have_sou=have_sou, final typ=typ, final typVal=typVal) "Design and operating parameters"; final parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal( final min=0) = dat.mAir_flow_nominal "Air mass flow rate"; final parameter Modelica.Units.SI.PressureDifference dpAir_nominal( final min=0, displayUnit="Pa") = dat.dpAir_nominal "Air pressure drop"; final parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal= dat.Q_flow_nominal "Nominal heat flow rate"; parameter Modelica.Units.SI.Time tau=20 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversalAir=true "= true to allow flow reversal, false restricts to design direction - Air side"; parameter Boolean allowFlowReversalLiq=true "= true to allow flow reversal, false restricts to design direction - CHW and HW side"; Modelica.Fluid.Interfaces.FluidPort_a port_aSou( redeclare final package Medium = MediumSou, m_flow(min=if allowFlowReversalLiq then -Modelica.Constants.inf else 0), h_outflow(start=MediumSou.h_default, nominal=MediumSou.h_default)) if have_sou "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_bSou( redeclare final package Medium = MediumSou, m_flow(max=if allowFlowReversalLiq then +Modelica.Constants.inf else 0), h_outflow(start = MediumSou.h_default, nominal = MediumSou.h_default)) if have_sou "Fluid connector b (positive design flow direction is from port_a to port_b)"; Buildings.BoundaryConditions.WeatherData.Bus busWea if have_weaBus "Weather bus"; Buildings.Templates.Components.Interfaces.Bus bus if typ <> Buildings.Templates.Components.Types.Coil.None "Control bus"; protected parameter Buildings.Templates.Components.Data.Valve datVal( final typ=typVal, final m_flow_nominal=dat.mWat_flow_nominal, final dpValve_nominal=dat.dpValve_nominal, final dpFixed_nominal=if typVal <> Buildings.Templates.Components.Types.Valve.None then dat.dpWat_nominal else 0) "Local record for control valve with lumped flow resistance"; initial equation if typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed then assert(mAir_flow_nominal<=dat.datCoi.sta[dat.datCoi.nSta].nomVal.m_flow_nominal, "In "+ getInstanceName() + ": "+ "The coil design airflow ("+String(mAir_flow_nominal)+ ") exceeds the maximum airflow provided in the performance data record ("+ String(dat.datCoi.sta[dat.datCoi.nSta].nomVal.m_flow_nominal)+").", level=AssertionLevel.warning); assert(abs(Q_flow_nominal)<=abs(dat.datCoi.sta[dat.datCoi.nSta].nomVal.Q_flow_nominal), "In "+ getInstanceName() + ": "+ "The coil design capacity ("+String(Q_flow_nominal)+ ") exceeds the maximum capacity provided in the performance data record ("+ String(dat.datCoi.sta[dat.datCoi.nSta].nomVal.Q_flow_nominal)+").", level=AssertionLevel.warning); end if; end PartialCoil;

Buildings.Templates.Components.Interfaces.PartialDamper Buildings.Templates.Components.Interfaces.PartialDamper

Interface class for damper

Buildings.Templates.Components.Interfaces.PartialDamper

Information

This partial class provides a standard interface for damper models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Damperdatdat(final typ=typ)Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominaldat.m_flow_nominalNominal mass flow rate [kg/s]
Configuration
Dampertyp Equipment type
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Filtered opening
Booleanuse_inputFiltertrue= true, if opening is filtered with a 2nd order CriticalDamping filter
TimeriseTime120Rise time of the filter (time to reach 99.6 % of an opening step) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial position of actuator
Graphics
DamperBladestypBlaBuildings.Templates.Componen...Type of blades
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
BusbusControl bus

Modelica definition

partial model PartialDamper "Interface class for damper" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=dat.m_flow_nominal); parameter Buildings.Templates.Components.Types.Damper typ "Equipment type"; parameter Buildings.Templates.Components.Data.Damper dat(final typ=typ) "Design and operating parameters"; final parameter Modelica.Units.SI.PressureDifference dp_nominal= dat.dp_nominal "Damper pressure drop"; parameter Boolean use_inputFilter=true "= true, if opening is filtered with a 2nd order CriticalDamping filter"; parameter Modelica.Units.SI.Time riseTime=120 "Rise time of the filter (time to reach 99.6 % of an opening step)"; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; parameter Real y_start=1 "Initial position of actuator"; parameter Buildings.Templates.Components.Types.DamperBlades typBla= Buildings.Templates.Components.Types.DamperBlades.Parallel "Type of blades"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; Buildings.Templates.Components.Interfaces.Bus bus if typ <> Buildings.Templates.Components.Types.Damper.None and typ <> Buildings.Templates.Components.Types.Damper.Barometric and typ <> Buildings.Templates.Components.Types.Damper.NoPath "Control bus"; end PartialDamper;

Buildings.Templates.Components.Interfaces.PartialFan Buildings.Templates.Components.Interfaces.PartialFan

Interface class for fan

Buildings.Templates.Components.Interfaces.PartialFan

Information

This partial class provides a standard interface for fan models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Fandatdat(final typ=typ, final nFa...Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominaldat.m_flow_nominalNominal mass flow rate [kg/s]
Configuration
Fantyp Equipment type
Booleanhave_senFlofalseSet to true for air flow measurement
IntegernFan Number of fans
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Graphics
FanSingletypSinBuildings.Templates.Componen...Type of single fan
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
BusbusControl bus

Modelica definition

partial model PartialFan "Interface class for fan" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=dat.m_flow_nominal); parameter Buildings.Templates.Components.Types.Fan typ "Equipment type"; parameter Boolean have_senFlo = false "Set to true for air flow measurement"; parameter Modelica.Units.SI.Time tau=1 "Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Buildings.Templates.Components.Types.FanSingle typSin= Buildings.Templates.Components.Types.FanSingle.Housed "Type of single fan"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; parameter Buildings.Templates.Components.Data.Fan dat( final typ=typ, final nFan=nFan) "Design and operating parameters"; parameter Integer nFan( final min=0, start=0) "Number of fans"; final parameter Modelica.Units.SI.PressureDifference dp_nominal=dat.dp_nominal "Total pressure rise"; Buildings.Templates.Components.Interfaces.Bus bus if typ <> Buildings.Templates.Components.Types.Fan.None "Control bus"; Buildings.Templates.Components.Sensors.VolumeFlowRate V_flow( redeclare final package Medium = Medium, final have_sen=have_senFlo, final m_flow_nominal=m_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.AFMS) "Air volume flow rate sensor"; equation /* Control point connection - start */ connect(V_flow.y, bus.V_flow); /* Control point connection - stop */ connect(port_b, V_flow.port_b); end PartialFan;

Buildings.Templates.Components.Interfaces.PartialSensor Buildings.Templates.Components.Interfaces.PartialSensor

Interface class for sensor

Buildings.Templates.Components.Interfaces.PartialSensor

Information

This partial class provides a standard interface for sensor models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value

Modelica definition

partial model PartialSensor "Interface class for sensor" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface; parameter Boolean have_sen=true "Set to true for sensor, false for direct pass through"; parameter Boolean isDifPreSen=false "Set to true for differential pressure sensor, false for any other sensor"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y if have_sen "Connector for measured value"; equation if isDifPreSen and (not have_sen) then // Zero flow equations for connectors port_a.m_flow = 0; port_b.m_flow = 0; // No contribution of specific quantities port_a.h_outflow = 0; port_b.h_outflow = 0; port_a.Xi_outflow = zeros(Medium.nXi); port_b.Xi_outflow = zeros(Medium.nXi); port_a.C_outflow = zeros(Medium.nC); port_b.C_outflow = zeros(Medium.nC); end if; end PartialSensor;

Buildings.Templates.Components.Interfaces.PartialValve Buildings.Templates.Components.Interfaces.PartialValve

Interface class for valve

Buildings.Templates.Components.Interfaces.PartialValve

Information

This partial class provides a standard interface for valve models.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Valvedatdat(final typ=typ)Design and operating parameters
Nominal condition
MassFlowRatem_flow_nominaldat.m_flow_nominalNominal mass flow rate [kg/s]
Configuration
Valvetyp Equipment type
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Dynamics
Filtered opening
Booleanuse_inputFiltertrue= true, if opening is filtered with a 2nd order CriticalDamping filter
TimeriseTime120Rise time of the filter (time to reach 99.6 % of an opening step) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial position of actuator
Nominal condition
Timetau10Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
FluidPort_aportByp_aFluid connector with bypass line
BusbusControl bus

Modelica definition

partial model PartialValve "Interface class for valve" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=dat.m_flow_nominal); parameter Buildings.Templates.Components.Types.Valve typ "Equipment type"; parameter Buildings.Templates.Components.Data.Valve dat(final typ=typ) "Design and operating parameters"; final parameter Modelica.Units.SI.PressureDifference dpValve_nominal= dat.dpValve_nominal "Nominal pressure drop of fully open valve"; final parameter Modelica.Units.SI.PressureDifference dpFixed_nominal= dat.dpFixed_nominal "Nominal pressure drop of pipes and other equipment in flow leg"; final parameter Modelica.Units.SI.PressureDifference dpFixedByp_nominal= dat.dpFixedByp_nominal "Nominal pressure drop in the bypass line"; parameter Boolean use_inputFilter=true "= true, if opening is filtered with a 2nd order CriticalDamping filter"; parameter Modelica.Units.SI.Time riseTime=120 "Rise time of the filter (time to reach 99.6 % of an opening step)"; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; parameter Real y_start=1 "Initial position of actuator"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Integer text_rotation = 0 "Text rotation angle in icon layer"; parameter Boolean text_flip = false "True to flip text horizontally in icon layer"; Modelica.Fluid.Interfaces.FluidPort_a portByp_a( redeclare final package Medium = Medium, p(start=Medium.p_default), m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if typ==Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition or typ==Buildings.Templates.Components.Types.Valve.ThreeWayModulating "Fluid connector with bypass line"; Buildings.Templates.Components.Interfaces.Bus bus if typ<>Buildings.Templates.Components.Types.Valve.None "Control bus"; end PartialValve;