modelBasicFlowFunction_dp_inv_DerivativeCheck2
Model that checks the correct implementation of the 1st and 2nd order derivative of the inverse of the flow function
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv and its first and second order derivatives Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv_der and Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv_der2. If the derivative implementation is wrong, the simulation will stop with an error.
Implementation
The mass flow rate m_flow is increased non-linearly in order
for the first and second derivatives in
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv_der2
to be non-zero during part of the simulation.
The input sweeps through the laminar and the turbulent region.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | k | 0.35 | Flow coefficient |
| Modelica.Units.SI.MassFlowRate | m_flow_turbulent | 0.36 | Mass flow rate where transition to turbulent flow occurs |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.PressureDifference | dp | Pressure difference | |
| Modelica.Units.SI.PressureDifference | dp_comp | Comparison value for dp | |
| Real | der_dp | 1st order derivative of pressure difference | |
| Real | der_dp_comp | 1st order derivative of comparison value for dp | |
| Modelica.Units.SI.MassFlowRate | m_flow | Mass flow rate | |
| Modelica.Units.SI.PressureDifference | err_dp | Integration error for dp | |
| Real | err_der_dp | Integration error for der_dp |
Revisions
-
October 22, 2026, by Martin Sjölund:
First implementation.
This is for Buildings, #4798.