Package with component models
Information
This package contains component models that are used to construct
the models within
Buildings.Fluid.HydronicConfigurations.
Those components are "wrapper" or "container" classes that
conditionally instantiate models from
Buildings.Fluid
and enable switching from one model to another by a simple
parameter assignment.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name |
Description |
Pump
|
Container class for circulating pumps |
ThreeWayValve
|
Container class for three-way valves |
TwoWayValve
|
Container class for two-way valves |
Container class for circulating pumps
Information
This is a container class for pump models from
Buildings.Fluid.Movers.
Two parameters allow configuring the model.
The model takes the following input variables that are conditional
to the parameter typ
.
Variable |
Type (unit) |
Condition |
Description |
y1 |
Boolean |
Only available if typ<>None |
Start signal |
y |
Real (-) |
Only available if typ==VariableInput |
Analog control signal. Whatever the type of pump model (specified with typMod ) the container class takes a non-dimensional input between 0 and 1. |
Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Generic | per | redeclare parameter Building... | Record with performance data |
Boolean | addPowerToMedium | true | Set to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations) |
Configuration |
Pump | typ | Buildings.Fluid.HydronicConf... | Type of secondary pump |
PumpModel | typMod | Buildings.Fluid.HydronicConf... | Type of pump model |
Nominal condition |
PressureDifference | dp_nominal | | Pump head at design conditions [Pa] |
Control |
InputType | inputType | Buildings.Fluid.Types.InputT... | Control input type |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Filtered speed |
Boolean | use_inputFilter | true | = true, if speed is filtered with a 2nd order CriticalDamping filter |
Time | riseTime | 30 | Rise time of the filter (time to reach 99.6 % of the speed) [s] |
Init | init | Modelica.Blocks.Types.Init.I... | Type of initialization (no init/steady state/initial state/initial output) |
Advanced |
Dynamics |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | y | Analog control signal [1] |
input BooleanInput | y1 | Start signal |
output RealOutput | y_actual | Actual pump input value that is used for computations [1] |
output RealOutput | P | Electrical power consumed [W] |
HeatPort_a | heatPort | Heat dissipation to environment |
Modelica definition
model Pump
extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations(
final massDynamics=energyDynamics,
final mSenFac=1);
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
m_flow_nominal(
final min=Modelica.Constants.small),
show_T=false,
port_a(
h_outflow(start=h_outflow_start)),
port_b(
h_outflow(start=h_outflow_start),
p(start=p_start),
final m_flow(max =
if allowFlowReversal
then +Modelica.Constants.inf
else 0)));
parameter Buildings.Fluid.HydronicConfigurations.Types.Pump typ=
Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput
;
parameter Buildings.Fluid.HydronicConfigurations.Types.PumpModel typMod=
Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Speed
;
parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")
;
replaceable parameter Buildings.Fluid.Movers.Data.Generic per
constrainedby Buildings.Fluid.Movers.Data.Generic(
pressure(
V_flow={0, 1, 2} * m_flow_nominal / rho_default,
dp={1.14, 1, 0.42} * dp_nominal))
;
parameter Buildings.Fluid.Types.InputType inputType=
Buildings.Fluid.Types.InputType.Continuous
;
parameter Boolean addPowerToMedium=true
;
parameter Boolean use_inputFilter=true
;
parameter Modelica.Units.SI.Time riseTime=30
;
parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput
;
Modelica.Units.SI.VolumeFlowRate VMachine_flow = V_flow.V_flow
;
Modelica.Units.SI.PressureDifference dpMachine(displayUnit="Pa") = port_b.p - port_a.p
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput y(
final unit="1")
if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual(
final unit="1")
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput P(
quantity="Power",
final unit="W")
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Movers.FlowControlled_dp pumDp(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final m_flow_nominal=m_flow_nominal,
final m_flow_small=m_flow_small,
final show_T=show_T,
final inputType=Buildings.Fluid.Types.InputType.Continuous,
final addPowerToMedium=addPowerToMedium,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final per=per)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Head
;
Movers.SpeedControlled_y pumSpe(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final m_flow_small=m_flow_small,
final show_T=show_T,
final inputType=Buildings.Fluid.Types.InputType.Continuous,
final addPowerToMedium=addPowerToMedium,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final per=per)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Speed
;
Movers.FlowControlled_m_flow pumFlo(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final m_flow_small=m_flow_small,
final show_T=show_T,
final inputType=Buildings.Fluid.Types.InputType.Continuous,
final addPowerToMedium=addPowerToMedium,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final per=per)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.MassFlowRate
;
Sensors.VolumeFlowRate V_flow(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaHea(
final k=dp_nominal)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaSpe(
final k=per.speed_nominal)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaFlo(
final k=m_flow_nominal)
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(
final k=0.0)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi
if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant One(
final k=1.0)
if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.NoVariableInput
;
FixedResistances.LosslessPipe noPum(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal)
if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.None
;
protected
final parameter Modelica.Units.SI.Density rho_default=
Medium.density_pTX(
p=Medium.p_default,
T=Medium.T_default,
X=Medium.X_default) ;
final parameter Medium.ThermodynamicState sta_start=
Medium.setState_pTX(
T=T_start,
p=p_start,
X=X_start) ;
final parameter Modelica.Units.SI.SpecificEnthalpy h_outflow_start=
Medium.specificEnthalpy(sta_start) ;
equation
connect(pumDp.port_b, port_b);
connect(pumSpe.port_b, port_b);
connect(pumDp.heatPort, heatPort);
connect(pumSpe.heatPort, heatPort);
connect(pumFlo.heatPort, heatPort);
connect(pumFlo.port_b, port_b);
connect(pumDp.P, P);
connect(pumDp.y_actual, y_actual);
connect(pumSpe.P, P);
connect(pumSpe.y_actual, y_actual);
connect(pumFlo.P, P);
connect(pumFlo.y_actual, y_actual);
connect(port_a, V_flow.port_a);
connect(V_flow.port_b, pumSpe.port_a);
connect(V_flow.port_b, pumDp.port_a);
connect(V_flow.port_b, pumFlo.port_a);
connect(scaHea.y, pumDp.dp_in);
connect(scaSpe.y, pumSpe.y);
connect(scaFlo.y, pumFlo.m_flow_in);
connect(zer.y, swi.u3);
connect(y, swi.u1);
connect(y1, swi.u2);
connect(swi.y, scaHea.u);
connect(swi.y, scaSpe.u);
connect(swi.y, scaFlo.u);
connect(One.y, swi.u1);
connect(V_flow.port_b, noPum.port_a);
connect(noPum.port_b, port_b);
end Pump;
Container class for three-way valves
Information
This is a container class for three-way valve models from
Buildings.Fluid.Actuators.Valves.
The parameter typCha
allows configuring the model
by selecting the valve characteristic to be used based on the enumeration
Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.
The default setting for the ratio of
the Kvs coefficient between the bypass branch and the
direct branch is fraK=1.0
, see
Buildings.Fluid.HydronicConfigurations.UsersGuide.ControlValves
for the justification.
Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Actuators.BaseClasses.ValveParameters (Model with parameters for valves).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Generic | flowCharacteristics1 | flowCharacteristics1(y={0,1}... | Table with flow characteristics for direct flow path at port_1 |
Generic | flowCharacteristics3 | flowCharacteristics3(y={0,1}... | Table with flow characteristics for bypass flow path at port_3 |
Real | R | 50 | Rangeability, R=50...100 typically |
Real | delta0 | 0.01 | Range of significant deviation from equal percentage law |
Real | fraK | 1.0 | Fraction Kv(port_3→port_2)/Kv(port_1→port_2) |
Real | l[2] | {0.0001,0.0001} | Valve leakage, l=Kv(y=0)/Kv(y=1) |
Flow Coefficient |
CvTypes | CvData | Buildings.Fluid.Types.CvType... | Selection of flow coefficient |
Real | Kv | | Kv (metric) flow coefficient [m3/h/(bar)^(1/2)] |
Real | Cv | | Cv (US) flow coefficient [USG/min/(psi)^(1/2)] |
Area | Av | | Av (metric) flow coefficient [m2] |
Pressure-flow linearization |
Real | deltaM | 0.02 | Fraction of nominal flow rate where linearization starts, if y=1 |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
PressureDifference | dpValve_nominal | | Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint [Pa] |
PressureDifference | dpFixed_nominal[2] | {0,0} | Nominal pressure drop of pipes and other equipment in flow legs at port_1 and port_3 [Pa] |
Configuration |
ValveCharacteristic | typCha | Buildings.Fluid.HydronicConf... | Valve characteristic |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Nominal condition |
Time | tau | 10 | Time constant at nominal flow for dynamic energy and momentum balance [s] |
Filtered opening |
Boolean | use_inputFilter | true | = true, if opening is filtered with a 2nd order CriticalDamping filter |
Time | riseTime | 120 | Rise time of the filter (time to reach 99.6 % of an opening step) [s] |
Init | init | Modelica.Blocks.Types.Init.I... | Type of initialization (no init/steady state/initial state/initial output) |
Real | y_start | 1 | Initial position of actuator |
Advanced |
Dynamics |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state |
Nominal condition |
Density | rhoStd | Medium.density_pTX(101325, 2... | Inlet density for which valve coefficients are defined [kg/m3] |
Boolean | linearized[2] | {false,false} | = true, use linear relation between m_flow and dp for any flow rate |
Boolean | from_dp | true | = true, use m_flow = f(dp) else dp = f(m_flow) |
PortFlowDirection | portFlowDirection_1 | Modelica.Fluid.Types.PortFlo... | Flow direction for port_1 |
PortFlowDirection | portFlowDirection_2 | Modelica.Fluid.Types.PortFlo... | Flow direction for port_2 |
PortFlowDirection | portFlowDirection_3 | Modelica.Fluid.Types.PortFlo... | Flow direction for port_3 |
Boolean | verifyFlowReversal | false | =true, to assert that the flow does not reverse when portFlowDirection_* does not equal Bidirectional |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Connectors
Type | Name | Description |
FluidPort_a | port_1 | First port, typically inlet |
FluidPort_b | port_2 | Second port, typically outlet |
FluidPort_a | port_3 | Third port, can be either inlet or outlet |
input RealInput | y | Input control signal [1] |
output RealOutput | y_actual | Actual actuator position |
Modelica definition
model ThreeWayValve
extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations(
final massDynamics=energyDynamics,
final mSenFac=1);
extends Buildings.Fluid.Actuators.BaseClasses.ValveParameters(
rhoStd=
Medium.density_pTX(101325, 273.15+4, Medium.X_default));
parameter Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic
typCha=Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage
;
parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics1(
y={0,1},
phi={0.0001,1})
;
parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics3(
y={0,1},
phi={0.0001,1})
;
parameter Modelica.Units.SI.PressureDifference dpFixed_nominal[2](
each displayUnit="Pa")={0,0}
;
parameter Real R = 50 ;
parameter Real delta0 = 0.01
;
parameter Real fraK(min=0, max=1) = 1.0
;
parameter Real[2] l(
each min=0,
each max=1) = {0.0001, 0.0001}
;
parameter Real deltaM = 0.02
;
parameter Boolean[2] linearized = {false, false}
;
parameter Modelica.Units.SI.Time tau=10
;
parameter Boolean from_dp = true
;
parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional
;
parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional
;
parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Bidirectional
;
parameter Boolean verifyFlowReversal = false
;
parameter Boolean use_inputFilter=true
;
parameter Modelica.Units.SI.Time riseTime=120
;
parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput
;
parameter Real y_start=1 ;
final parameter Modelica.Units.SI.PressureDifference dp3Valve_nominal(
displayUnit="Pa")=dpValve_nominal/fraK^2
;
final parameter Modelica.Units.SI.PressureDifference dp3Fixed_nominal(
displayUnit="Pa")=dpFixed_nominal[2]
;
final parameter Modelica.Units.SI.PressureDifference dp3_nominal(
displayUnit="Pa")=dp3Valve_nominal + dp3Fixed_nominal
;
Modelica.Units.SI.MassFlowRate m1_flow = port_1.m_flow
;
Modelica.Units.SI.MassFlowRate m2_flow = -1 * port_2.m_flow
;
Modelica.Units.SI.MassFlowRate m3_flow = port_3.m_flow
;
Modelica.Units.SI.PressureDifference dp1(displayUnit="Pa") = port_1.p - port_2.p
;
Modelica.Units.SI.PressureDifference dp3(displayUnit="Pa") = port_3.p - port_2.p
;
Modelica.Fluid.Interfaces.FluidPort_a port_1(
redeclare final package Medium =
Medium,
h_outflow(start=Medium.h_default, nominal=Medium.h_default),
m_flow(min=
if (portFlowDirection_1 == Modelica.Fluid.Types.PortFlowDirection.Entering)
then 0.0
else -Modelica.Constants.inf,
max=
if (portFlowDirection_1== Modelica.Fluid.Types.PortFlowDirection.Leaving)
then 0.0
else Modelica.Constants.inf))
;
Modelica.Fluid.Interfaces.FluidPort_b port_2(
redeclare final package Medium =
Medium,
h_outflow(start=Medium.h_default, nominal=Medium.h_default),
m_flow(min=
if (portFlowDirection_2 == Modelica.Fluid.Types.PortFlowDirection.Entering)
then 0.0
else -Modelica.Constants.inf,
max=
if (portFlowDirection_2 == Modelica.Fluid.Types.PortFlowDirection.Leaving)
then 0.0
else Modelica.Constants.inf))
;
Modelica.Fluid.Interfaces.FluidPort_a port_3(
redeclare final package Medium=
Medium,
h_outflow(start=Medium.h_default, nominal=Medium.h_default),
m_flow(min=
if (portFlowDirection_3==Modelica.Fluid.Types.PortFlowDirection.Entering)
then 0.0
else -Modelica.Constants.inf,
max=
if (portFlowDirection_3==Modelica.Fluid.Types.PortFlowDirection.Leaving)
then 0.0
else Modelica.Constants.inf))
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput y(
final unit="1")
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual
;
Actuators.Valves.ThreeWayEqualPercentageLinear valEquLin(
redeclare final package Medium =
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final R=R,
final delta0=delta0,
final l=l,
final fraK=fraK,
final deltaM=deltaM,
final tau=tau,
final from_dp=from_dp,
final portFlowDirection_1=portFlowDirection_1,
final portFlowDirection_2=portFlowDirection_2,
final portFlowDirection_3=portFlowDirection_3,
final verifyFlowReversal=verifyFlowReversal,
final linearized=linearized,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha==Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage
;
Actuators.Valves.ThreeWayLinear valLinLin(
redeclare final package Medium =
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final l=l,
final fraK=fraK,
final deltaM=deltaM,
final tau=tau,
final from_dp=from_dp,
final portFlowDirection_1=portFlowDirection_1,
final portFlowDirection_2=portFlowDirection_2,
final portFlowDirection_3=portFlowDirection_3,
final verifyFlowReversal=verifyFlowReversal,
final linearized=linearized,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha==Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Linear
;
Actuators.Valves.ThreeWayTable valTab(
redeclare final package Medium =
Medium,
final flowCharacteristics1=flowCharacteristics1,
final flowCharacteristics3=flowCharacteristics3,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final fraK=fraK,
final deltaM=deltaM,
final tau=tau,
final from_dp=from_dp,
final portFlowDirection_1=portFlowDirection_1,
final portFlowDirection_2=portFlowDirection_2,
final portFlowDirection_3=portFlowDirection_3,
final verifyFlowReversal=verifyFlowReversal,
final linearized=linearized,
final energyDynamics=energyDynamics,
final p_start=p_start,
final T_start=T_start,
final X_start=X_start,
final C_start=C_start,
final C_nominal=C_nominal,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Table
;
initial equation
assert(typCha<>Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.PressureIndependent,
"In " +
getInstanceName() +
": The pressure independent option is only available for two-way valves.");
equation
connect(y, valEquLin.y);
connect(valEquLin.y_actual, y_actual);
connect(port_3, valEquLin.port_3);
connect(valEquLin.port_2, port_2);
connect(port_1, valEquLin.port_1);
connect(port_1, valLinLin.port_1);
connect(y, valLinLin.y);
connect(valLinLin.port_3, port_3);
connect(y, valTab.y);
connect(valTab.port_1, port_1);
connect(port_3, valTab.port_3);
connect(valTab.port_2, port_2);
connect(valTab.y_actual, y_actual);
connect(valLinLin.y_actual, y_actual);
connect(valLinLin.port_2, port_2);
end ThreeWayValve;
Container class for two-way valves
Information
This is a container class for two-way valve models from
Buildings.Fluid.Actuators.Valves.
Note that the models
Buildings.Fluid.Actuators.Valves.TwoWayPolynomial
and
Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening
are not represented.
The parameter typCha
allows configuring the model
by selecting the valve characteristic to be used based on the enumeration
Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Actuators.BaseClasses.ValveParameters (Model with parameters for valves).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Real | l | 0.0001 | Valve leakage, l=Kv(y=0)/Kv(y=1) |
Generic | flowCharacteristics | flowCharacteristics(y={0,1},... | Table with flow characteristics |
Real | R | 50 | Rangeability, R=50...100 typically |
Real | delta0 | 0.01 | Range of significant deviation from equal percentage law |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
PressureDifference | dpValve_nominal | | Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint [Pa] |
PressureDifference | dpFixed_nominal | 0 | Pressure drop of pipe and other resistances that are in series [Pa] |
Flow Coefficient |
CvTypes | CvData | Buildings.Fluid.Types.CvType... | Selection of flow coefficient |
Real | Kv | | Kv (metric) flow coefficient [m3/h/(bar)^(1/2)] |
Real | Cv | | Cv (US) flow coefficient [USG/min/(psi)^(1/2)] |
Area | Av | | Av (metric) flow coefficient [m2] |
Pressure-flow linearization |
Real | deltaM | 0.02 | Fraction of nominal flow rate where linearization starts, if y=1 |
Configuration |
ValveCharacteristic | typCha | Buildings.Fluid.HydronicConf... | Valve characteristic |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Dynamics |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state |
Nominal condition |
Density | rhoStd | Medium.density_pTX(101325, 2... | Inlet density for which valve coefficients are defined [kg/m3] |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Filtered opening |
Boolean | use_inputFilter | true | = true, if opening is filtered with a 2nd order CriticalDamping filter |
Time | riseTime | 120 | Rise time of the filter (time to reach 99.6 % of an opening step) [s] |
Init | init | Modelica.Blocks.Types.Init.I... | Type of initialization (no init/steady state/initial state/initial output) |
Real | y_start | 1 | Initial position of actuator |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | y | Input control signal [1] |
output RealOutput | y_actual | Actual actuator position |
Modelica definition
model TwoWayValve
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface;
extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations(
final massDynamics=energyDynamics,
final mSenFac=1);
extends Buildings.Fluid.Actuators.BaseClasses.ValveParameters(
rhoStd=
Medium.density_pTX(101325, 273.15+4, Medium.X_default));
parameter Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic
typCha=Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage
;
parameter Modelica.Units.SI.PressureDifference dpFixed_nominal(
displayUnit="Pa",
min=0) = 0 ;
parameter Real l(min=1e-10, max=1) = 0.0001
;
parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics(
y={0,1},
phi={0.0001,1})
;
parameter Real R=50
;
parameter Real delta0=0.01
;
parameter Boolean from_dp = false
;
parameter Boolean linearized = false
;
parameter Boolean use_inputFilter=true
;
parameter Modelica.Units.SI.Time riseTime=120
;
parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput
;
parameter Real y_start=1 ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput y(
final unit="1")
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual
;
Actuators.Valves.TwoWayEqualPercentage valEqu(
redeclare final package Medium=
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final R=R,
final delta0=delta0,
final l=l,
final deltaM=deltaM,
final from_dp=from_dp,
final allowFlowReversal=allowFlowReversal,
final linearized=linearized,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage
;
Actuators.Valves.TwoWayLinear valLin(
redeclare final package Medium =
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final l=l,
final deltaM=deltaM,
final from_dp=from_dp,
final allowFlowReversal=allowFlowReversal,
final linearized=linearized,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Linear
;
Actuators.Valves.TwoWayTable valTab(
redeclare final package Medium =
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final deltaM=deltaM,
final from_dp=from_dp,
final allowFlowReversal=allowFlowReversal,
final linearized=linearized,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start,
final flowCharacteristics=flowCharacteristics)
if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Table
;
Actuators.Valves.TwoWayPressureIndependent valPre(
redeclare final package Medium=
Medium,
final CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
final m_flow_nominal=m_flow_nominal,
final dpValve_nominal=dpValve_nominal,
final rhoStd=rhoStd,
final dpFixed_nominal=dpFixed_nominal,
final l=l,
final deltaM=deltaM,
final from_dp=from_dp,
final allowFlowReversal=allowFlowReversal,
final use_inputFilter=use_inputFilter,
final riseTime=riseTime,
final init=init,
final y_start=y_start)
if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.PressureIndependent
;
initial equation
assert(dpFixed_nominal > -Modelica.Constants.eps, "In " +
getInstanceName() +
": Model requires dpFixed_nominal >= 0 but received dpFixed_nominal = "
+
String(dpFixed_nominal) + " Pa.");
equation
connect(y, valEqu.y);
connect(valEqu.y_actual, y_actual);
connect(port_a, valEqu.port_a);
connect(valEqu.port_b, port_b);
connect(port_a, valTab.port_a);
connect(port_a, valLin.port_a);
connect(valLin.port_b, port_b);
connect(valLin.y_actual, y_actual);
connect(y, valLin.y);
connect(y, valTab.y);
connect(valTab.port_b, port_b);
connect(valTab.y_actual, y_actual);
connect(port_a, valPre.port_a);
connect(valPre.port_b, port_b);
connect(y, valPre.y);
connect(valPre.y_actual, y_actual);
end TwoWayValve;