modelHydraulicDiameter
Extends from Buildings.Fluid.FixedResistances.PressureDrop (Fixed flow resistance with dp and m_flow as parameter).
Information
This is a model of a flow resistance with a fixed flow coefficient. The mass flow rate is computed as
ṁ = k √Δp,
where
k is a constant and
Δp is the pressure drop.
The constant k is equal to
k=m_flow_nominal/sqrt(dp_nominal),
where m_flow_nominal is a parameter.
Assumptions
In the region
abs(m_flow) < m_flow_turbulent,
the square root is replaced by a differentiable function
with finite slope.
The value of m_flow_turbulent is
computed as
m_flow_turbulent = eta_nominal*dh/4*π*ReC,
where
eta_nominal is the dynamic viscosity, obtained from
the medium model. The parameter
dh is the hydraulic diameter and
ReC=4000 is the critical Reynolds number, which both
can be set by the user.
Important parameters
By default, the pressure drop at nominal flow rate is computed as
dp_nominal = fac * dpStraightPipe_nominal,
where dpStraightPipe_nominal is a parameter that is automatically computed
based on the
nominal mass flow rate, hydraulic diameter, pipe roughness and medium properties.
The hydraulic diameter dh is by default
computed based on the flow velocity v_nominal and the nominal
mass flow rate m_flow_nominal. Hence, users should change the
default values of dh or v_nominal
if they are not applicable for their model.
The factor fac takes into account additional resistances such as
for bends. The default value of 2 can be changed by the user.
The parameter from_dp is used to determine
whether the mass flow rate is computed as a function of the
pressure drop (if from_dp=true), or vice versa.
This setting can affect the size of the nonlinear system of equations.
If the parameter linearized is set to true,
then the pressure drop is computed as a linear function of the
mass flow rate.
If the parameter disableComputeFlowResistance is set to true,
then the pressure drop is not computed. This allows to aggregate dp_nominal
in other components such as in an actuator using its parameter dpFixed_nominal.
See Buildings.Fluid.Actuators.UsersGuide
for further information on dpFixed_nominal.
Setting allowFlowReversal=false can lead to simpler
equations. However, this should only be set to false
if one can guarantee that the flow never reverses its direction.
This can be difficult to guarantee, as pressure imbalance after
the initialization, or due to medium expansion and contraction,
can lead to reverse flow.
If the parameter
show_T is set to true,
then the model will compute the
temperature at its ports. Note that this can lead to state events
when the mass flow rate approaches zero,
which can increase computing time.
Notes
For more detailed models that compute the actual flow friction,
models from the package
Modelica.Fluid
can be used and combined with models from the
Buildings library.
For a model that uses dp_nominal as a parameter rather than
geoemetric data, use
Buildings.Fluid.FixedResistances.PressureDrop.
Implementation
The pressure drop is computed by calling a function in the package Buildings.Fluid.BaseClasses.FlowModels, This package contains regularized implementations of the equation
ṁ = sign(Δp) k √ Δp
and its inverse function.
To decouple the energy equation from the mass equations, the pressure drop is a function of the mass flow rate, and not the volume flow rate. This leads to simpler equations.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | homotopyInitialization (from PartialResistance) | true | = true, use homotopy method |
| Modelica.Units.SI.MassFlowRate | m_flow_turbulent (from PartialResistance) | Turbulent flow if |m_flow| >= m_flow_turbulent | |
| Real | k (from PressureDrop) | if computeFlowResistance and not (linearized or fullyLaminar) then m_flow_nominal_pos/dp_nominal_pos^(1/n) else 0 | Flow coefficient, k=m_flow/dp^(1/n) |
| Modelica.Units.SI.Length | dh | sqrt(4*m_flow_nominal/rho_default/v_nominal/Modelica.Constants.pi) | Hydraulic diameter (assuming a round cross section area) |
| Modelica.Units.SI.Length | length | Length of the pipe | |
| Real | ReC | 4000 | Reynolds number where transition to turbulence starts |
| Modelica.Units.SI.Length | roughness | 2.5e-5 | Absolute roughness of pipe, with a default for a smooth steel pipe (dummy if use_roughness = false) |
| Real | fac | 2 | Factor to take into account resistance of bends etc., fac=dp_nominal/dpStraightPipe_nominal |
| Modelica.Units.SI.PressureDifference | dpStraightPipe_nominal | Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow(m_flow = m_flow_nominal, rho_a = rho_default, rho_b = rho_default, mu_a = mu_default, mu_b = mu_default, length = length, diameter = dh, roughness = roughness, m_flow_small = m_flow_small) | Pressure loss of a straight pipe at m_flow_nominal |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal (from PartialTwoPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.PressureDifference | dp_nominal (from PartialResistance) | Pressure drop at nominal mass flow rate | |
| Modelica.Units.SI.Velocity | v_nominal | if rho_default < 500 then 1.5 else 0.15 | Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh) |
| Advanced | |||
| Modelica.Units.SI.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) |
| Real | n (from PartialResistance) | 2 | Flow exponent, n=1 for laminar, n=2 for turbulent |
| Boolean | linearized (from PartialResistance) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Boolean | disableComputeFlowResistance | false | =false to disable computation of flow resistance |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialTwoPortInterface) | false | = true, if actual temperature at port is computed |
| Transition to laminar | |||
| Real | deltaM (from PressureDrop) | 0.3 | Fraction of nominal mass flow rate where transition to turbulent occurs |
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) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.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.Units.SI.PressureDifference | dp (from PartialTwoPortInterface) | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_a (from PartialTwoPortInterface) | if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow))) | Medium properties in port_a |
| Medium.ThermodynamicState | sta_b (from PartialTwoPortInterface) | if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow)) | Medium properties in port_b |
| Modelica.Units.SI.Velocity | v | m_flow/(rho_default*ARound) | Flow velocity (assuming a round cross section area) |