Buildings.Fluid.FixedResistances

Package with models for fixed flow resistances (pipes, diffusers etc.)

Information

This package contains components models for fixed flow resistances. By fixed flow resistance, we mean resistances that do not change the flow coefficient

k = m ⁄ √ΔP.

For models of valves and air dampers, see Buildings.Fluid.Actuators. For models of flow resistances as part of the building constructions, see Buildings.Airflow.Multizone.

The model Buildings.Fluid.FixedResistances.FixedResistanceDpM is a fixed flow resistance that takes as parameter a nominal flow rate and a nominal pressure drop. The actual resistance is scaled using the above equation.

The model Buildings.Fluid.FixedResistances.LosslessPipe is an ideal pipe segment with no pressure drop. It is primarily used in models in which the above pressure drop model need to be replaced by a model with no pressure drop.

The model Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM can be used to model flow splitters or flow merges.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

NameDescription
Buildings.Fluid.FixedResistances.FixedResistanceDpM FixedResistanceDpM Fixed flow resistance with dp and m_flow as parameter
Buildings.Fluid.FixedResistances.LosslessPipe LosslessPipe Pipe with no flow friction and no heat transfer
Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM SplitterFixedResistanceDpM Flow splitter with fixed resistance at each port
Buildings.Fluid.FixedResistances.Examples Examples Collection of models that illustrate model use and test models


Buildings.Fluid.FixedResistances.FixedResistanceDpM Buildings.Fluid.FixedResistances.FixedResistanceDpM

Fixed flow resistance with dp and m_flow as parameter

Buildings.Fluid.FixedResistances.FixedResistanceDpM

Information

This is a model of a resistance with a fixed flow coefficient

k = m ⁄ √ΔP.

Near the origin, the square root relation is regularized to ensure that the derivative is bounded.

Extends from Buildings.Fluid.BaseClasses.PartialResistance (Partial model for a hydraulic resistance).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Booleanuse_dhfalseSet to true to specify hydraulic diameter
Lengthdh1Hydraulic diameter [m]
RealReC4000Reynolds number where transition to turbulent starts
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Pressuredp_nominal Pressure drop at nominal mass flow rate [Pa]
Initialization
MassFlowRatem_flow.start0Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s]
Pressuredp.start0Pressure difference between port_a and port_b [Pa]
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Diagnostics
Booleanshow_V_flowfalse= true, if volume flow rate at inflowing port is computed
Booleanshow_Tfalse= true, if actual temperature at port is computed (may lead to events)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model FixedResistanceDpM 
  "Fixed flow resistance with dp and m_flow as parameter"
  extends Buildings.Fluid.BaseClasses.PartialResistance;
  parameter Boolean use_dh = false "Set to true to specify hydraulic diameter";
  parameter Modelica.SIunits.Length dh=1 "Hydraulic diameter";
  parameter Real ReC(min=0)=4000 
    "Reynolds number where transition to turbulent starts";
  parameter Real deltaM(min=0.01) = 0.3 
    "Fraction of nominal mass flow rate where transition to turbulent occurs";
initial equation 
 assert(m_flow_nominal_pos > 0, "m_flow_nominal_pos must be non-zero. Check parameters.");
 if ( m_flow_turbulent > m_flow_nominal_pos) then
   Modelica.Utilities.Streams.print("Warning: In FixedResistanceDpM, m_flow_nominal is smaller than m_flow_turbulent."
           + "\n"
           + "  m_flow_nominal = " + String(m_flow_nominal) + "\n"
           + "  dh      = " + String(dh) + "\n"
           + "  To fix, set dh < " +
                String(     4*m_flow_nominal/eta_nominal/Modelica.Constants.pi/ReC) + "\n"
           + "  Suggested value: dh = " +
                String(1/10*4*m_flow_nominal/eta_nominal/Modelica.Constants.pi/ReC));
 end if;

equation 
 // if computeFlowResistance = false, then equations of this model are disabled.
 if computeFlowResistance then
   m_flow_turbulent = if use_dh then 
                      eta_nominal*dh/4*Modelica.Constants.pi*ReC else 
                      deltaM * m_flow_nominal_pos;
   k = m_flow_nominal_pos / sqrt(dp_nominal_pos);
 else
   m_flow_turbulent = 0;
   k = 0;
 end if;
end FixedResistanceDpM;

Buildings.Fluid.FixedResistances.LosslessPipe Buildings.Fluid.FixedResistances.LosslessPipe

Pipe with no flow friction and no heat transfer

Buildings.Fluid.FixedResistances.LosslessPipe

Information

Model of a pipe with no flow resistance and no heat loss. This model can be used to replace a replaceable pipe model in flow legs in which no friction should be modeled, such as in the outlet port of a three way valve.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Initialization
MassFlowRatem_flow.start0Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s]
Pressuredp.start0Pressure difference between port_a and port_b [Pa]
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
BooleanhomotopyInitializationtrue= true, use homotopy method
Diagnostics
Booleanshow_V_flowfalse= true, if volume flow rate at inflowing port is computed
Booleanshow_Tfalse= true, if actual temperature at port is computed (may lead to events)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model LosslessPipe "Pipe with no flow friction and no heat transfer"
  extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
     show_T=false, show_V_flow=false);
  extends Buildings.BaseClasses.BaseIcon;
  final parameter Boolean from_dp=true "Used to satisfy replaceable models";
equation 
  dp=0;
  // Isenthalpic state transformation (no storage and no loss of energy)
  port_a.h_outflow = inStream(port_b.h_outflow);
  port_b.h_outflow = inStream(port_a.h_outflow);

  // Mass balance (no storage)
  port_a.m_flow + port_b.m_flow = 0;

  // Transport of substances
  port_a.Xi_outflow = inStream(port_b.Xi_outflow);
  port_b.Xi_outflow = inStream(port_a.Xi_outflow);

  port_a.C_outflow = inStream(port_b.C_outflow);
  port_b.C_outflow = inStream(port_a.C_outflow);
end LosslessPipe;

Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM

Flow splitter with fixed resistance at each port

Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM

Information

Model of a flow splitter or mixer with a fixed resistance in each flow leg.

Extends from Buildings.BaseClasses.BaseIcon (Base icon), Buildings.Fluid.BaseClasses.PartialThreeWayResistance (Flow splitter with partial resistance model at each port).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Booleanuse_dhfalseSet to true to specify hydraulic diameter
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Lengthdh[3]{1,1,1}Hydraulic diameter [m]
RealReC[3]{4000,4000,4000}Reynolds number where transition to turbulent starts
Nominal condition
MassFlowRatem_flow_nominal[3] Mass flow rate. Set negative at outflowing ports. [kg/s]
Pressuredp_nominal[3] Pressure. Set negative at outflowing ports. [Pa]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
DynamicsmassDynamicsenergyDynamicsFormulation of mass balance
BooleandynamicBalancetrueSet to true to use a dynamic balance, which often leads to smaller systems of equations
MassFlowRatemDyn_flow_nominalsum(abs(m_flow_nominal[:])/3)Nominal mass flow rate for dynamic momentum and energy balance [kg/s]
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances
ExtraPropertyC_nominal[Medium.nC]fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Advanced
Booleanfrom_dptrue= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate

Connectors

TypeNameDescription
FluidPort_aport_1 
FluidPort_bport_2 
FluidPort_aport_3 

Modelica definition

model SplitterFixedResistanceDpM 
  "Flow splitter with fixed resistance at each port"
    extends Buildings.BaseClasses.BaseIcon;
    extends Buildings.Fluid.BaseClasses.PartialThreeWayResistance(
    mDyn_flow_nominal = sum(abs(m_flow_nominal[:])/3),
      redeclare Buildings.Fluid.FixedResistances.FixedResistanceDpM res1(
         redeclare package Medium=Medium,
            final allowFlowReversal=true,
            from_dp=from_dp,
            final m_flow_nominal=m_flow_nominal[1],
            final dp_nominal=dp_nominal[1],
            final ReC=ReC[1],
            final dh=dh[1],
            linearized=linearized,
            homotopyInitialization=homotopyInitialization,
            deltaM=deltaM),
      redeclare Buildings.Fluid.FixedResistances.FixedResistanceDpM res2(
         redeclare package Medium=Medium,
            final allowFlowReversal=true,
            from_dp=from_dp,
            final m_flow_nominal=m_flow_nominal[2],
            final dp_nominal=dp_nominal[2],
            final ReC=ReC[2],
            final dh=dh[2],
            linearized=linearized,
            homotopyInitialization=homotopyInitialization,
            deltaM=deltaM),
      redeclare Buildings.Fluid.FixedResistances.FixedResistanceDpM res3(
         redeclare package Medium=Medium,
            final allowFlowReversal=true,
            from_dp=from_dp,
            final m_flow_nominal=m_flow_nominal[3],
            final dp_nominal=dp_nominal[3],
            final ReC=ReC[3],
            final dh=dh[3],
            linearized=linearized,
            homotopyInitialization=homotopyInitialization,
            deltaM=deltaM));

  parameter Boolean use_dh = false "Set to true to specify hydraulic diameter";
  parameter Modelica.SIunits.MassFlowRate[3] m_flow_nominal 
    "Mass flow rate. Set negative at outflowing ports.";
  parameter Modelica.SIunits.Pressure[3] dp_nominal(each displayUnit = "Pa") 
    "Pressure. Set negative at outflowing ports.";
  parameter Real deltaM(min=0) = 0.3 
    "Fraction of nominal mass flow rate where transition to turbulent occurs";

  parameter Modelica.SIunits.Length[3] dh={1, 1, 1} "Hydraulic diameter";
  parameter Real[3] ReC(each min=0)={4000, 4000, 4000} 
    "Reynolds number where transition to turbulent starts";
  parameter Boolean linearized = false 
    "= true, use linear relation between m_flow and dp for any flow rate";
  parameter Boolean homotopyInitialization = true "= true, use homotopy method";

end SplitterFixedResistanceDpM;

Automatically generated Fri Nov 4 08:27:24 2011.