Package Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels
Flow models for pipes, including wall friction, static head and momentum flow

Information

Standard package icon.

Extends from Modelica.​Icons.​Package (Icon for standard packages).

Package Contents

NameDescription
DetailedPipeFlowDetailedPipeFlow: Detailed characteristic for laminar and turbulent flow
NominalLaminarFlowNominalLaminarFlow: Linear laminar flow for given nominal values
NominalTurbulentPipeFlowNominalTurbulentPipeFlow: Quadratic turbulent flow in circular tubes for given nominal values
PartialGenericPipeFlowGenericPipeFlow: Pipe flow pressure loss and gravity with replaceable WallFriction package
PartialStaggeredFlowModelBase class for momentum balances in flow models
TurbulentPipeFlowTurbulentPipeFlow: Quadratic turbulent flow in circular tubes (using mu to regularize laminar region)

Partial Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialStaggeredFlowModel
Base class for momentum balances in flow models

Information

This partial model defines a common interface for m=n-1 flow models between n device segments. The flow models provide a steady-state or dynamic momentum balance using an upwind discretization scheme per default. Extending models must add pressure loss terms for friction and gravity.

The fluid is specified in the interface with the thermodynamic states[n] for a given Medium model. The geometry is specified with the pathLengths[n-1] between the device segments as well as with the crossAreas[n] and the roughnesses[n] of the device segments. Moreover the fluid flow is characterized for different types of devices by the characteristic dimensions[n] and the average velocities vs[n] of fluid flow in the device segments. See Pipes.BaseClasses.CharacteristicNumbers.ReynoldsNumber for example definitions.

The parameter Re_turbulent can be specified for the least mass flow rate of the turbulent regime. It defaults to 4000, which is appropriate for pipe flow. The m_flows_turbulent[n-1] resulting from Re_turbulent can optionally be calculated together with the Reynolds numbers Res[n] of the device segments (show_Res=true).

Using the thermodynamic states[n] of the device segments, the densities rhos[n] and the dynamic viscosities mus[n] of the segments as well as the actual densities rhos_act[n-1] and the actual viscosities mus_act[n-1] of the flows are predefined in this base model. Note that no events are raised on flow reversal. This needs to be treated by an extending model, e.g., with numerical smoothing or by raising events as appropriate.

Extends from Modelica.​Fluid.​Interfaces.​PartialDistributedFlow (Base class for a distributed momentum balance).

Parameters

TypeNameDefaultDescription
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemetrue= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting

Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​NominalLaminarFlow
NominalLaminarFlow: Linear laminar flow for given nominal values

Information

This model defines a simple linear pressure loss assuming laminar flow for specified dp_nominal and m_flow_nominal.

Select show_Res = true to analyze the actual flow and the lengths of a pipe that would fulfill the specified nominal values for given geometry parameters crossAreas, dimensions and roughnesses.

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialStaggeredFlowModel (Base class for momentum balances in flow models).

Parameters

TypeNameDefaultDescription
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemetrue= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting
AbsolutePressuredp_nominal Nominal pressure loss
MassFlowRatem_flow_nominal Mass flow rate for dp_nominal

Partial Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialGenericPipeFlow
GenericPipeFlow: Pipe flow pressure loss and gravity with replaceable WallFriction package

Information

This model describes pressure losses due to wall friction in a pipe and due to gravity. Correlations of different complexity and validity can be selected via the replaceable package WallFriction (see parameter menu below). The details of the pipe wall friction model are described in the UsersGuide. Basically, different variants of the equation

   dp = λ(Re,D)*(L/D)*ρ*v*|v|/2.

By default, the correlations are computed with media data at the actual time instant. In order to reduce non-linear equation systems, the parameters use_mu_nominal and use_rho_nominal provide the option to compute the correlations with constant media values at the desired operating point. This might speed-up the simulation and/or might give a more robust simulation.

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialStaggeredFlowModel (Base class for momentum balances in flow models).

Parameters

TypeNameDefaultDescription
Booleanfrom_dpTypes.Dynamics.SteadyStateInitial <= momentumDynamics= true, use m_flow = f(dp), otherwise dp = f(m_flow)
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemetrue= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
final ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting
AbsolutePressuredp_nominal Nominal pressure loss (only for nominal models)
MassFlowRatem_flow_nominal Nominal mass flow rate
MassFlowRatem_flow_smallif system.use_eps_Re then system.eps_m_flow * m_flow_nominal else system.m_flow_smallWithin regularization if |m_flows| < m_flow_small (may be wider for large discontinuities in static head)

Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​NominalTurbulentPipeFlow
NominalTurbulentPipeFlow: Quadratic turbulent flow in circular tubes for given nominal values

Information

This model defines the pressure loss assuming turbulent flow for specified dp_nominal and m_flow_nominal. It takes into account the fluid density of each flow segment and obtains appropriate pathLengths_nominal values for an inverse parameterization of the TurbulentPipeFlow model. Per default the upstream and downstream densities are averaged with the setting useUpstreamScheme = false, in order to avoid discontinuous pathLengths_nominal values in the case of flow reversal.

The geometry parameters crossAreas, diameters and roughnesses do not effect simulation results of this nominal pressure loss model. As the geometry is specified however, the optionally calculated Reynolds number as well as m_flows_turbulent and dps_fg_turbulent become meaningful and can be related to m_flow_small and dp_small.

Optional Variables if show_Res

TypeNameDescription
ReynoldsNumberRes[n] Reynolds numbers of pipe flow per flow segment
MassFlowRatem_flows_turbulent[n-1] mass flow rates at start of turbulent region for Re_turbulent=4000
AbsolutePressuredps_fg_turbulent[n-1] pressure losses due to friction and gravity corresponding to m_flows_turbulent

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialGenericPipeFlow (GenericPipeFlow: Pipe flow pressure loss and gravity with replaceable WallFriction package).

Parameters

TypeNameDefaultDescription
Booleanfrom_dpTypes.Dynamics.SteadyStateInitial <= momentumDynamics= true, use m_flow = f(dp), otherwise dp = f(m_flow)
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemefalse= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
final ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting
AbsolutePressuredp_nominal Nominal pressure loss (only for nominal models)
MassFlowRatem_flow_nominal Nominal mass flow rate
MassFlowRatem_flow_smallif system.use_eps_Re then system.eps_m_flow * m_flow_nominal else system.m_flow_smallWithin regularization if |m_flows| < m_flow_small (may be wider for large discontinuities in static head)
MassFlowRatem_flow_turbulentif system.use_eps_Re then 0.1 * m_flow_nominal else system.m_flow_smallTurbulent flow starting from |m_flows| > m_flow_turbulent (may be wider for large discontinuities in static head)

Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​TurbulentPipeFlow
TurbulentPipeFlow: Quadratic turbulent flow in circular tubes (using mu to regularize laminar region)

Information

This model defines only the quadratic turbulent regime of wall friction: dp = k*m_flow*|m_flow|, where "k" depends on density and the roughness of the pipe and is not a function of the Reynolds number. This relationship is only valid for large Reynolds numbers. The turbulent pressure loss correlation might be useful to optimize models that are only facing turbulent flow.

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialGenericPipeFlow (GenericPipeFlow: Pipe flow pressure loss and gravity with replaceable WallFriction package).

Parameters

TypeNameDefaultDescription
Booleanfrom_dpTypes.Dynamics.SteadyStateInitial <= momentumDynamics= true, use m_flow = f(dp), otherwise dp = f(m_flow)
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemetrue= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
final ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting
AbsolutePressuredp_nominal Nominal pressure loss (only for nominal models)
MassFlowRatem_flow_nominalif system.use_eps_Re then system.m_flow_nominal else 100 * m_flow_smallNominal mass flow rate
MassFlowRatem_flow_smallif system.use_eps_Re then system.eps_m_flow * m_flow_nominal else system.m_flow_smallWithin regularization if |m_flows| < m_flow_small (may be wider for large discontinuities in static head)
Booleanuse_Resystem.​use_eps_Re= true, if turbulent region is defined by Re, otherwise by m_flow_small

Model Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​DetailedPipeFlow
DetailedPipeFlow: Detailed characteristic for laminar and turbulent flow

Information

This component defines the complete regime of wall friction. The details are described in the UsersGuide. The functional relationship of the friction loss factor λ is displayed in the next figure. Function massFlowRate_dp() defines the "red curve" ("Swamee and Jain"), where as function pressureLoss_m_flow() defines the "blue curve" ("Colebrook-White"). The two functions are inverses from each other and give slightly different results in the transition region between Re = 1500 .. 4000, in order to get explicit equations without solving a non-linear equation.

PipeFriction1.png

Additionally to wall friction, this component properly implements static head. With respect to the latter, two cases can be distinguished. In the case shown next, the change of elevation with the path from a to b has the opposite sign of the change of density.

PipeFrictionStaticHead_case-a.png

In the case illustrated second, the change of elevation with the path from a to b has the same sign of the change of density.

PipeFrictionStaticHead_case-b.png

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​FlowModels.​PartialGenericPipeFlow (GenericPipeFlow: Pipe flow pressure loss and gravity with replaceable WallFriction package).

Parameters

TypeNameDefaultDescription
Booleanfrom_dpTypes.Dynamics.SteadyStateInitial <= momentumDynamics= true, use m_flow = f(dp), otherwise dp = f(m_flow)
Integern2Number of discrete flow volumes
RealnParallel number of identical parallel flow devices
Accelerationgsystem.​gConstant gravity acceleration
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (states[1] -> states[n+1])
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balance
MassFlowRatem_flow_startsystem.​m_flow_startStart value of mass flow rates
AbsolutePressurep_a_start Start value for p[1] at design inflow
AbsolutePressurep_b_start Start value for p[n+1] at design outflow
final Integermn - 1Number of flow segments
BooleanuseUpstreamSchemetrue= false to average upstream and downstream properties across flow segments
Booleanuse_Ib_flowsmomentumDynamics <> Types.Dynamics.SteadyState= true to consider differences in flow of momentum through boundaries
final ReynoldsNumberRe_turbulent4000Start of turbulent regime, depending on type of flow device
Booleanshow_Resfalse= true, if Reynolds numbers are included for plotting
AbsolutePressuredp_nominal Nominal pressure loss (only for nominal models)
MassFlowRatem_flow_nominalif system.use_eps_Re then system.m_flow_nominal else 100 * m_flow_smallNominal mass flow rate
MassFlowRatem_flow_smallif system.use_eps_Re then system.eps_m_flow * m_flow_nominal else system.m_flow_smallWithin regularization if |m_flows| < m_flow_small (may be wider for large discontinuities in static head)

Generated 2018-12-12 12:13:24 EST by MapleSim.