Modelica.Fluid.Fittings.GenericResistances

Flow models for generic resistances

Information


The geometry parameters of energy devices necessary for the pressure loss calculations are often not exactly known. Therefore the modelling of the detailed pressure loss calculation has to be simplified. In this package components are present that provide different forms of such approximations.

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

Package Content

NameDescription
Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate VolumeFlowRate Flow model for generic resistance parameterized with the volume flow rate


Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate

Flow model for generic resistance parameterized with the volume flow rate

Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate

Information


This component models a generic resistance parameterized with the volume flow rate:

    dp     = a*V_flow^2 + b*V_flow
    m_flow = rho*V_flow

with

a as quadratic coefficient [Pa*s^2/m^6],
b as linear coefficient [Pa*s/m3],
dp as pressure loss [Pa],
m_flow as mass flow rate [kg/s],
rho as density of fluid [kg/m3],
V_flow as volume flow rate [m3/s].

The geometry parameters of energy devices necessary for the pressure loss calculations are often not exactly known. Therefore the modelling of the detailed pressure loss calculation has to be simplified. This components use a linear and a quadratic dependence of the pressure loss on the volume flow rate. It is assumed that neither mass nor energy is stored in this component. In the model basically a function is called to compute the mass flow rate as a function of pressure loss. Also the inverse of this function is defined, and a tool might use this inverse function instead, in order to avoid the solution of a nonlinear equation.

The details of the model are described in the documentation of the underlying function.

Extends from Modelica.Fluid.Dissipation.Utilities.Icons.PressureLoss.General_i (Icon for general pressure drop), Modelica.Fluid.Interfaces.PartialTwoPortTransport (Partial element transporting fluid between two ports without storage of mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
dp = a*V_flow^2 + b*V_flow
Reala Coefficient for quadratic term [(Pa.s2)/m6]
Realb Coefficient for linear term [(Pa.s)/m3]
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
AbsolutePressuredp_start0.01*system.p_startGuess value of dp = port_a.p - port_b.p [Pa]
MassFlowRatem_flow_startsystem.m_flow_startGuess value of m_flow = port_a.m_flow [kg/s]
MassFlowRatem_flow_smallsystem.m_flow_smallSmall mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Ttrue= true, if temperatures at port_a and port_b are computed
Booleanshow_V_flowtrue= true, if volume flow rate at inflowing port is computed

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 VolumeFlowRate 
  "Flow model for generic resistance parameterized with the volume flow rate"

  extends Modelica.Fluid.Dissipation.Utilities.Icons.PressureLoss.General_i;
  extends Modelica.Fluid.Interfaces.PartialTwoPortTransport;

  parameter Real a(unit="(Pa.s2)/m6") "Coefficient for quadratic term";
  parameter Real b(unit="(Pa.s)/m3") "Coefficient for linear term";

protected 
  parameter Medium.ThermodynamicState state_dp_small=Medium.setState_pTX(
                       Medium.reference_p,
                       Medium.reference_T,
                       Medium.reference_X) "Medium state to compute dp_small";
  parameter Medium.AbsolutePressure dp_small=
             Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_DP(
               Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_IN_con(
                   a=a,
                   b=b,
                   dp_min=1e-10),
                Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_IN_var(
                  rho=Medium.density(state_dp_small)),
                m_flow_small) 
    "Default small pressure drop for regularization of laminar and zero flow (calculated from m_flow_small)";
  Medium.Density d_a 
    "Density at port_a when fluid is flowing from port_a to port_b";
  Medium.Density d_b 
    "If allowFlowReversal=true then Density at port_b when fluid is flowing from port_b to port_a else d_a";

equation 
  // 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);

  // Medium properties
  d_a = Medium.density(state_a);
  if allowFlowReversal then
    d_b = Medium.density(state_b);
  else
    d_b = d_a;
  end if;

  if allowFlowReversal then
     m_flow = Modelica.Fluid.Fittings.BaseClasses.GenericResistances.VolumeFlowRate.massFlowRate(
                dp, a, b, d_a, d_b, dp_small, m_flow_small);
  else
     m_flow = Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_MFLOW(
               Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_IN_con(
                   a=a,
                   b=b,
                   dp_min=dp_small),
                Modelica.Fluid.Dissipation.PressureLoss.General.dp_volumeFlowRate_IN_var(rho=d_a), dp);
  end if;

end VolumeFlowRate;

Automatically generated Fri Nov 12 16:31:18 2010.