Buildings.Fluid.BaseClasses.FlowModels

Flow models for pressure drop calculations

Information


This package contains a basic flow model that is used by the 
various models that compute pressure drop.
Because the density does not change signficantly in heating,
ventilation and air conditioning systems for buildings,
this model computes the pressure drop based on the mass flow
rate and not the volume flow rate. This typically leads to simpler
equations because it does not require
the mass density, which changes when the flow is reversed. 
Although, for conceptual design of building energy system, there is
in general not enough information available that would warrant a more
detailed pressure drop calculation.
If a more detailed computation of the flow resistance is needed,
then a user can use models from the 
Modelica.Fluid library.

Package Content

NameDescription
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp basicFlowFunction_dp Basic class for flow models
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow basicFlowFunction_m_flow Basic class for flow models
Buildings.Fluid.BaseClasses.FlowModels.Examples Examples Collection of models that illustrate model use and test models


Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp

Basic class for flow models

Information


Function that computes the pressure drop of flow elements as

  m_flow = sign(dp) * k * sqrt(|dp|),
with regularization near the origin. The variable m_flow_turbulent determines the location of the regularization.

Inputs

TypeNameDefaultDescription
Pressuredp Pressure difference between port_a and port_b (= port_a.p - port_b.p) [Pa]
Realk Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)
MassFlowRatem_flow_turbulent Mass flow rate [kg/s]
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate

Outputs

TypeNameDescription
MassFlowRatem_flowMass flow rate in design flow direction [kg/s]

Modelica definition

function basicFlowFunction_dp "Basic class for flow models"

  input Modelica.SIunits.Pressure dp(displayUnit="Pa") 
    "Pressure difference between port_a and port_b (= port_a.p - port_b.p)";
  input Real k(unit="") 
    "Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)";
  input Modelica.SIunits.MassFlowRate m_flow_turbulent(min=0) "Mass flow rate";
  input Boolean linearized = false 
    "= true, use linear relation between m_flow and dp for any flow rate";
   output Modelica.SIunits.MassFlowRate m_flow 
    "Mass flow rate in design flow direction";
protected 
  Modelica.SIunits.Pressure dp_turbulent(displayUnit="Pa") 
    "Turbulent flow if |dp| >= dp_small, not a parameter because k can be a function of time";
protected 
 Real kSqu(unit="kg.m") "Flow coefficient, kSqu=k^2=m_flow^2/|dp|";
 constant Real conv(unit="m.s2/kg") = 1 "Factor, needed to satisfy unit check";
 constant Real conv2 = sqrt(conv) "Factor, needed to satisfy unit check";
algorithm 
  // if dp==0, we avoid a computation
  if (dp == 0 or k==0) then
      m_flow := 0;
  else
     kSqu:=k*k;
     dp_turbulent :=m_flow_turbulent^2/kSqu;
     if linearized then
        m_flow :=k*dp*conv2;
     else
        m_flow :=Modelica.Fluid.Utilities.regRoot2(x=dp, x_small=dp_turbulent, k1=kSqu, k2=kSqu);
     end if;
  end if;
end basicFlowFunction_dp;

Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow

Basic class for flow models

Information


Function that computes the pressure drop of flow elements as

  dp = 1/k^2 * sign(m_flow) m_flow^2
with regularization near the origin. The variable m_flow_turbulent determines the location of the regularization.

Inputs

TypeNameDefaultDescription
MassFlowRatem_flow Mass flow rate in design flow direction [kg/s]
Realk Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)
MassFlowRatem_flow_turbulent Mass flow rate [kg/s]
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate

Outputs

TypeNameDescription
PressuredpPressure difference between port_a and port_b (= port_a.p - port_b.p) [Pa]

Modelica definition

function basicFlowFunction_m_flow "Basic class for flow models"

  input Modelica.SIunits.MassFlowRate m_flow 
    "Mass flow rate in design flow direction";
  input Real k(unit="") 
    "Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)";
  input Modelica.SIunits.MassFlowRate m_flow_turbulent(min=0) "Mass flow rate";
  input Boolean linearized = false 
    "= true, use linear relation between m_flow and dp for any flow rate";
  output Modelica.SIunits.Pressure dp(displayUnit="Pa") 
    "Pressure difference between port_a and port_b (= port_a.p - port_b.p)";
protected 
 Real kSquInv(unit="1/(kg.m)") "Flow coefficient";
 constant Real conv(unit="m.s2/kg") = 1 "Factor, needed to satisfy unit check";
 constant Real conv2 = sqrt(conv) "Factor, needed to satisfy unit check";
algorithm 
  // if m_flow == 0, we avoid a computation
  if (m_flow == 0) then
    dp := 0;
  else
    if linearized then
       dp := m_flow/k/conv2;
    else
       kSquInv:=1/k^2;
       dp :=Modelica.Fluid.Utilities.regSquare2(x=m_flow, x_small=m_flow_turbulent, k1=kSquInv, k2=kSquInv);
    end if;
  end if;
end basicFlowFunction_m_flow;

HTML-documentation generated by Dymola Thu Jun 24 16:55:11 2010.