modelPartialResistance

Partial model for a hydraulic resistance

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Information

Partial model for a flow resistance, possible with variable flow coefficient. Models that extend this class need to implement an equation that relates m_flow and dp, and they need to assign the parameter m_flow_turbulent.

See for example Buildings.Fluid.FixedResistances.PressureDrop for a model that extends this base class.

Parameters

TypeNameDefaultDescription
BooleanhomotopyInitializationtrue= true, use homotopy method
Modelica.Units.SI.MassFlowRatem_flow_turbulentTurbulent flow if |m_flow| >= m_flow_turbulent
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialTwoPortInterface)Nominal mass flow rate
Modelica.Units.SI.PressureDifferencedp_nominalPressure drop at nominal mass flow rate
Advanced
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialTwoPortInterface)1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
Realn2Flow exponent, n=1 for laminar, n=2 for turbulent
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Advanced › Diagnostics
Booleanshow_T (from PartialTwoPortInterface)false= true, if actual temperature at port is computed

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPort)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPort)Fluid connector b (positive design flow direction is from port_a to port_b)

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow (from PartialTwoPortInterface)port_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp (from PartialTwoPortInterface)port_a.p - port_b.pPressure difference between port_a and port_b
Medium.ThermodynamicStatesta_a (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow)))Medium properties in port_a
Medium.ThermodynamicStatesta_b (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow))Medium properties in port_b

Revisions

  • June 17, 2026, by Michael Wetter:
    Updated implementation to allow a flow coefficient n that is different from 2. This allows use of the model for not fully turbulent flow.
    This is for Buildings, #4620.
  • April 14, 2020, by Michael Wetter:
    Changed homotopyInitialization to a constant.
    This is for IBPSA, #1341.
  • February 26, 2020, by Michael Wetter:
    Changed icon to display its operating state.
    This is for #1294.
  • October 25, 2019, by Jianjun Hu:
    Improved icon graphics annotation. This is for #1225.
  • November 3, 2016, by Michael Wetter:
    Removed start value for pressure difference to simplify the parameter window.
    This is for #552.
  • January 26, 2016, by Michael Wetter:
    Avoided assignment of dp(nominal=0) if dp_nominal_pos = 0 and of m_flow(nominal=0) if m_flow_nominal_pos = 0 as nominal values are not allowed to be zero.
  • January 22, 2016, by Michael Wetter:
    Corrected type declaration of pressure difference. This is for #404.
  • August 15, 2015, by Filip Jorissen:
    Implemented more efficient computation of port_a.Xi_outflow, port_a.h_outflow and port_a.C_outflow when allowFlowReversal=false. This is for #281.
  • January 13, 2015, by Marcus Fuchs:
    Revised revisions section (there were two revisions statements)
  • November 20, 2014 by Michael Wetter:
    Removed start attribute for m_flow as this is already set in its base class.
  • October 8, 2013 by Michael Wetter:
    Removed propagation of show_V_flow to base class as it has no longer this parameter.
  • December 14, 2012 by Michael Wetter:
    Renamed protected parameters for consistency with the naming conventions.
  • February 12, 2012, by Michael Wetter:
    Removed duplicate declaration of m_flow_nominal.
  • February 3, 2012, by Michael Wetter:
    Made assignment of m_flow_small final as it is no longer used in the base class.
  • January 16, 2012, by Michael Wetter:
    To simplify object inheritance tree, revised base classes Buildings.Fluid.BaseClasses.PartialResistance, Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve, Buildings.Fluid.Actuators.BaseClasses.PartialDamperExponential, Buildings.Fluid.Actuators.BaseClasses.PartialActuator and model Buildings.Fluid.FixedResistances.PressureDrop.
  • August 5, 2011, by Michael Wetter:
    Moved linearized pressure drop equation from the function body to the equation section. With the previous implementation, the symbolic processor may not rearrange the equations, which can lead to coupled equations instead of an explicit solution.
  • June 20, 2011, by Michael Wetter:
    Set start values for m_flow and dp to zero, since most HVAC systems start at zero flow. With this change, the start values appear in the GUI and can be set by the user.
  • April 2, 2011 by Michael Wetter:
    Added m_flow_nominal_pos and dp_nominal_pos to allow providing negative nominal values which will be used, for example, to set start values of flow splitters which may have negative flow rates and pressure drop at the initial condition.
  • March 27, 2011, by Michael Wetter:
    Added homotopy operator.
  • March 23, 2011 by Michael Wetter:
    Added homotopy operator.
  • March 30, 2010 by Michael Wetter:
    Changed base classes to allow easier initialization.
  • April 13, 2009, by Michael Wetter:
    Extracted pressure drop computation and implemented it in the new model Buildings.Fluid.BaseClasses.FlowModels.BasicFlowModel.
  • September 18, 2008, by Michael Wetter:
    Added equations for the mass balance of extra species flow, i.e., C and mC_flow.
  • July 20, 2007 by Michael Wetter:
    First implementation.