modelPowerLaw_m_flow_DerivativeCheck

Model that checks the correct implementation of the 1st order derivative of the power law function

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.powerLaw_m_flow and its first order derivative Buildings.Fluid.BaseClasses.FlowModels.powerLaw_m_flow_der. If the derivative implementation is wrong, the simulation will stop with an error.

Parameters

TypeNameDefaultDescription
Realgain0.5Gain for computing the mass flow rate
Realk0.5Flow coefficient, k = m_flow/ dp^(1/n)
Realn1.5Flow exponent, n=1 for laminar, n=2 for turbulent
Modelica.Units.SI.MassFlowRatem_flow_turbulent0.1Mass flow rate where transition to turbulent flow occurs

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flowMass flow rate
Modelica.Units.SI.PressureDifferencedpPressure drop
Modelica.Units.SI.PressureDifferencedp_compComparison value for dp
Modelica.Units.SI.PressureDifferenceerrIntegration error

Revisions

  • May 30, 2026, by Michael Wetter:
    First implementation.
    This is for Buildings, #4620.