modelTwoWayTable
Extends from BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).
Information
Two way valve with opening characteristic that is configured through a table.
The mass flow rate for the fully open valve is determined based
on the value of the parameter CvData.
For the different valve positions y ∈ [0, 1], this nominal flow rate is
scaled by the values of the parameter
flowCharacteristics.
The parameter flowCharacteristics declares a table of the form
| y | 0 | ... | 1 |
| φ | l | ... | 1 |
where l = Kv(y=0)/Kv(y=1) > 0 is the valve leakage. The first row is the valve opening, and the second row is the mass flow rate, relative to the mass flow rate of the fully open valve, under the assumption of a constant pressure difference across the valve. A suggested value for the valve leakage is l=0.0001. If l = 0, then this model will replace it with l = 10-8 for numerical reasons. For example, if a valve has Kv=0.5 [m3/h/bar1/2] and a linear opening characteristics and a valve leakage of l=0.0001, then one would set
CvData=IBPSA.Fluid.Types.CvTypes.Kv
Kv = 0.5
flowCharacteristics(y={0,1}, phi={0.0001,1})
Note, however, that IBPSA.Fluid.Actuators.Valves.TwoWayLinear provides a more efficient implementation for this simple case.
The parameter flowCharacteristics must meet the following
requirements, otherwise the model stops with an error:
-
The arrays in
flowCharacteristics.yandflowCharacteristics.phimust be strictly monotonic increasing. -
The first value must satisfy
flowCharacteristics.y[1]=0, andflowCharacteristics.phi[1]must be equal to the leakage flow rate, which must be bigger than zero. Otherwise, a default value of1E-8is used. -
The last values must satisfy
flowCharacteristics.y[end]=1andflowCharacteristics.phi[end]=1.
This model is based on the partial valve model IBPSA.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.
For an example that specifies an opening characteristics, see IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValveTable.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.MassFlowRate | m_flow_turbulent (from PartialResistance) | Turbulent flow if |m_flow| >= m_flow_turbulent | |
| Real | l (from PartialTwoWayValve) | 0.0001 | Valve leakage, l=Kv(y=0)/Kv(y=1) |
| Real | kFixed (from PartialTwoWayValve) | if dpFixed_nominal > Modelica.Constants.eps then m_flow_nominal/sqrt(dpFixed_nominal) else 0 | Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2). |
| Data.Generic | flowCharacteristics | Table with flow characteristics | |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.SIunits.MassFlowRate | m_flow_nominal (from PartialTwoPortInterface) | Nominal mass flow rate | |
| Modelica.SIunits.PressureDifference | dp_nominal (from PartialResistance) | Pressure drop at nominal mass flow rate | |
| Modelica.SIunits.PressureDifference | dpValve_nominal (from ValveParameters) | Nominal pressure drop of fully open valve, used if CvData=IBPSA.Fluid.Types.CvTypes.OpPoint | |
| Modelica.SIunits.PressureDifference | dpFixed_nominal (from PartialTwoWayValve) | 0 | Pressure drop of pipe and other resistances that are in series |
| Advanced | |||
| Modelica.SIunits.MassFlowRate | m_flow_small (from PartialTwoPortInterface) | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Boolean | from_dp (from PartialResistance) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Boolean | homotopyInitialization (from PartialResistance) | true | = true, use homotopy method |
| Boolean | linearized (from PartialResistance) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialTwoPortInterface) | false | = true, if actual temperature at port is computed |
| Flow Coefficient | |||
| IBPSA.Fluid.Types.CvTypes | CvData (from ValveParameters) | IBPSA.Fluid.Types.CvTypes.OpPoint | Selection of flow coefficient |
| Real | Kv (from ValveParameters) | Kv (metric) flow coefficient [m3/h/(bar)^(1/2)] | |
| Real | Cv (from ValveParameters) | Cv (US) flow coefficient [USG/min/(psi)^(1/2)] | |
| Modelica.SIunits.Area | Av (from ValveParameters) | Av (metric) flow coefficient | |
| Pressure-flow linearization | |||
| Real | deltaM (from ValveParameters) | 0.02 | Fraction of nominal flow rate where linearization starts, if y=1 |
| Advanced › Nominal condition | |||
| Modelica.SIunits.Density | rhoStd (from ValveParameters) | Inlet density for which valve coefficients are defined | |
| Dynamics › Filtered opening | |||
| Boolean | use_inputFilter (from ActuatorSignal) | true | = true, if opening is filtered with a 2nd order CriticalDamping filter |
| Modelica.SIunits.Time | riseTime (from ActuatorSignal) | 120 | Rise time of the filter (time to reach 99.6 % of an opening step) |
| Integer | order (from ActuatorSignal) | 2 | Order of filter |
| Modelica.Blocks.Types.Init | init (from ActuatorSignal) | Modelica.Blocks.Types.Init.InitialOutput | Type of initialization (no init/steady state/initial state/initial output) |
| Real | y_start (from ActuatorSignal) | 1 | Initial value of output |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Blocks.Interfaces.RealInput | y (from ActuatorSignal) | Actuator position (0: closed, 1: open) | |
| Modelica.Blocks.Interfaces.RealOutput | y_actual (from ActuatorSignal) | Actual valve position |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.MassFlowRate | m_flow (from PartialTwoPortInterface) | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.SIunits.PressureDifference | dp (from PartialTwoPortInterface) | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_a (from PartialTwoPortInterface) | Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) | Medium properties in port_a |
| Medium.ThermodynamicState | sta_b (from PartialTwoPortInterface) | Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) | Medium properties in port_b |
| Real | phi (from PartialTwoWayValve) | Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1) | |
| Real | kVal (from PartialTwoWayValve) | Flow coefficient of valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2). | |
| Real | k (from PartialTwoWayValve) | Flow coefficient of valve and pipe in series, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2). |
Revisions
-
January 26, 2016, by Michael Wetter:
Removed equality comparison forRealin theassertstatements as this is not allowed in Modelica. -
August 12, 2014, by Michael Wetter:
Removed theendkeyword when accessing array elements, as this language construct caused an error in OpenModelica. -
April 4, 2014, by Michael Wetter:
Moved the assignment of the flow functionphito the model instantiation because in its base class, the keywordinputhas been added to the variablephi. -
March 26, 2014 by Michael Wetter:
First implementation.