modelDynamicPipe
Extends from Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe (Base class for straight pipe models), BaseClasses.PartialTwoPortFlow (Base class for distributed flow models).
Information
Model of a straight pipe with distributed mass, energy and momentum balances. It provides the complete balance equations for one-dimensional fluid flow as formulated in UsersGuide.ComponentDefinition.BalanceEquations.
This generic model offers a large number of combinations of possible parameter settings. In order to reduce model complexity, consider defining and/or using a tailored model for the application at hand, such as HeatExchanger.
DynamicPipe treats the partial differential equations with the finite volume method and a staggered grid scheme for momentum balances. The pipe is split into nNodes equally spaced segments along the flow path. The default value is nNodes=2. This results in two lumped mass and energy balances and one lumped momentum balance across the dynamic pipe.
Note that this generally leads to high-index DAEs for pressure states if dynamic pipes are directly connected to each other, or generally to models with storage exposing a thermodynamic state through the port. This may not be valid if the dynamic pipe is connected to a model with non-differentiable pressure, like a Sources.Boundary_pT with prescribed jumping pressure. The modelStructure can be configured as appropriate in such situations, in order to place a momentum balance between a pressure state of the pipe and a non-differentiable boundary condition.
The default modelStructure is av_vb (see Advanced tab). The simplest possible alternative symmetric configuration, avoiding potential high-index DAEs at the cost of the potential introduction of nonlinear equation systems, is obtained with the setting nNodes=1, modelStructure=a_v_b. Depending on the configured model structure, the first and the last pipe segment, or the flow path length of the first and the last momentum balance, are of half size. See the documentation of the base class Pipes.BaseClasses.PartialTwoPortFlow, also covering asymmetric configurations.
The HeatTransfer component specifies the source term Qb_flows of the energy balance. The default component uses a constant coefficient for the heat transfer between the bulk flow and the segment boundaries exposed through the heatPorts. The HeatTransfer model is replaceable and can be exchanged with any model extended from BaseClasses.HeatTransfer.PartialFlowHeatTransfer.
The intended use is for complex networks of pipes and other flow devices, like valves. See, e.g.,
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Volume | V (from PartialStraightPipe) | crossArea*length*nParallel | Volume size |
| Integer | n (from PartialDistributedVolume) | 2 | Number of discrete volumes |
| Medium.AbsolutePressure | ps_start (from PartialDistributedVolume) | if n > 1 then linspace(p_a_start, p_b_start, n) else {(p_a_start + p_b_start)/2} | Start value of pressure |
| Integer | nFM (from PartialTwoPortFlow) | if useLumpedPressure then nFMLumped else nFMDistributed | Number of flow models in flowModel |
| Integer | nFMDistributed (from PartialTwoPortFlow) | if modelStructure == Types.ModelStructure.a_v_b then n + 1 else if (modelStructure == Types.ModelStructure.a_vb or modelStructure == Types.ModelStructure.av_b) then n else n - 1 | Number of distributed flow models |
| Integer | nFMLumped (from PartialTwoPortFlow) | if modelStructure == Types.ModelStructure.a_v_b then 2 else 1 | Number of lumped flow models |
| Integer | iLumped (from PartialTwoPortFlow) | integer(n/2) + 1 | Index of control volume with representative state if useLumpedPressure |
| Real | dxs | lengths/sum(lengths) | Normalized lengths |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | system.allowFlowReversal | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
| Geometry | |||
| Real | nParallel (from PartialStraightPipe) | 1 | Number of identical parallel pipes |
| SI.Diameter | diameter (from PartialStraightPipe) | Diameter of circular pipe | |
| Modelica.Fluid.Types.Roughness | roughness (from PartialStraightPipe) | 2.5e-5 | Average height of surface asperities (default: smooth steel pipe) |
| SI.Length | lengths (from PartialTwoPortFlow) | Lengths of flow segments | |
| SI.Area | crossAreas (from PartialTwoPortFlow) | Cross flow areas of flow segments | |
| SI.Length | dimensions (from PartialTwoPortFlow) | Hydraulic diameters of flow segments | |
| Modelica.Fluid.Types.Roughness | roughnesses (from PartialTwoPortFlow) | Average heights of surface asperities | |
| General › Geometry | |||
| SI.Length | length (from PartialStraightPipe) | Length | |
| Boolean | isCircular (from PartialStraightPipe) | true | = true, if cross sectional area is circular |
| SI.Area | crossArea (from PartialStraightPipe) | Modelica.Constants.pi*diameter*diameter/4 | Inner cross section area |
| SI.Length | perimeter (from PartialStraightPipe) | Modelica.Constants.pi*diameter | Inner perimeter |
| Static head | |||
| SI.Length | height_ab (from PartialStraightPipe) | 0 | Height(port_b) - Height(port_a) |
| SI.Length | dheights (from PartialTwoPortFlow) | zeros(n) | Differences in heights of flow segments |
| Assumptions › Dynamics | |||
| Types.Dynamics | energyDynamics (from PartialDistributedVolume) | system.energyDynamics | Formulation of energy balances |
| Types.Dynamics | massDynamics (from PartialDistributedVolume) | system.massDynamics | Formulation of mass balances |
| Types.Dynamics | substanceDynamics (from PartialDistributedVolume) | massDynamics | Formulation of substance balances |
| Types.Dynamics | traceDynamics (from PartialDistributedVolume) | massDynamics | Formulation of trace substance balances |
| Types.Dynamics | momentumDynamics (from PartialTwoPortFlow) | system.momentumDynamics | Formulation of momentum balances |
| Initialization | |||
| Medium.AbsolutePressure | p_a_start (from PartialDistributedVolume) | system.p_start | Start value of pressure at port a |
| Medium.AbsolutePressure | p_b_start (from PartialDistributedVolume) | p_a_start | Start value of pressure at port b |
| Boolean | use_T_start (from PartialDistributedVolume) | true | Use T_start if true, otherwise h_start |
| Medium.Temperature | T_start (from PartialDistributedVolume) | if use_T_start then system.T_start else Medium.temperature_phX((p_a_start + p_b_start)/2, h_start, X_start) | Start value of temperature |
| Medium.SpecificEnthalpy | h_start (from PartialDistributedVolume) | if use_T_start then Medium.specificEnthalpy_pTX((p_a_start + p_b_start)/2, T_start, X_start) else Medium.h_default | Start value of specific enthalpy |
| Medium.MassFraction[Medium.nX] | X_start (from PartialDistributedVolume) | Medium.X_default | Start value of mass fractions m_i/m |
| Medium.ExtraProperty[Medium.nC] | C_start (from PartialDistributedVolume) | Medium.C_default | Start value of trace substances |
| Medium.MassFlowRate | m_flow_start (from PartialTwoPortFlow) | system.m_flow_start | Start value for mass flow rate |
| Advanced | |||
| Integer | nNodes (from PartialTwoPortFlow) | 2 | Number of discrete flow volumes |
| Types.ModelStructure | modelStructure (from PartialTwoPortFlow) | Types.ModelStructure.av_vb | Determines whether flow or volume models are present at the ports |
| Boolean | useLumpedPressure (from PartialTwoPortFlow) | false | = true to lump pressure states together |
| Boolean | useInnerPortProperties (from PartialTwoPortFlow) | false | = true to take port properties for flow models from internal control volumes |
| Assumptions › Heat transfer | |||
| Boolean | use_HeatTransfer | false | = true to use the HeatTransfer model |
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) | |
| Interfaces.HeatPorts_a | heatPorts |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.System | system (from PartialTwoPort) | System wide properties | |
| SI.Volume | fluidVolumes (from PartialDistributedVolume) | Discretized volume, determine in inheriting class | |
| SI.Energy | Us (from PartialDistributedVolume) | Internal energy of fluid | |
| SI.Mass | ms (from PartialDistributedVolume) | Fluid mass | |
| SI.Mass | mXis (from PartialDistributedVolume) | Substance mass | |
| SI.Mass | mCs (from PartialDistributedVolume) | Trace substance mass | |
| SI.Mass | mCs_scaled (from PartialDistributedVolume) | Scaled trace substance mass | |
| Medium.ExtraProperty[n,Medium.nC] | Cs (from PartialDistributedVolume) | Trace substance mixture content | |
| Medium.BaseProperties | mediums (from PartialDistributedVolume) | ||
| Medium.MassFlowRate | mb_flows (from PartialDistributedVolume) | Mass flow rate, source or sink | |
| Medium.MassFlowRate | mbXi_flows (from PartialDistributedVolume) | Independent mass flow rates, source or sink | |
| Medium.ExtraPropertyFlowRate | mbC_flows (from PartialDistributedVolume) | Trace substance mass flow rates, source or sink | |
| SI.EnthalpyFlowRate | Hb_flows (from PartialDistributedVolume) | Enthalpy flow rate, source or sink | |
| SI.HeatFlowRate | Qb_flows (from PartialDistributedVolume) | Heat flow rate, source or sink | |
| SI.Power | Wb_flows (from PartialDistributedVolume) | Mechanical power, p*der(V) etc. | |
| Medium.ThermodynamicState | state_a (from PartialTwoPortFlow) | State defined by volume outside port_a | |
| Medium.ThermodynamicState | state_b (from PartialTwoPortFlow) | State defined by volume outside port_b | |
| Medium.ThermodynamicState | statesFM (from PartialTwoPortFlow) | State vector for flowModel model | |
| FlowModel | flowModel (from PartialTwoPortFlow) | Flow model | |
| Medium.MassFlowRate | m_flows (from PartialTwoPortFlow) | Mass flow rates of fluid across segment boundaries | |
| Medium.MassFlowRate | mXi_flows (from PartialTwoPortFlow) | Independent mass flow rates across segment boundaries | |
| Medium.MassFlowRate | mC_flows (from PartialTwoPortFlow) | Trace substance mass flow rates across segment boundaries | |
| Medium.EnthalpyFlowRate | H_flows (from PartialTwoPortFlow) | Enthalpy flow rates of fluid across segment boundaries | |
| SI.Velocity | vs (from PartialTwoPortFlow) | {0.5*(m_flows[i] + m_flows[i + 1])/mediums[i].d/crossAreas[i] for i in 1:n}/nParallel | Mean velocities in flow segments |
| HeatTransfer | heatTransfer | Heat transfer model |
Contents
| Name | Description |
|---|---|