Buildings.Fluid.BaseClasses.FlowModels.Validation
Collection of validation models
Information
This package contains validation models for the classes in Buildings.Fluid.BaseClasses.FlowModels.
Note that most validation models contain simple input data which may not be realistic, but for which the correct output can be obtained through an analytic solution. The examples plot various outputs, which have been verified against these solutions. These model outputs are stored as reference data and used for continuous validation whenever models in the library change.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name | Description |
---|---|
BasicFlowFunction_dp_DerivativeCheck | Model that checks the correct implementation of the 1st order derivative of the flow function |
BasicFlowFunction_dp_DerivativeCheck2 | Model that checks the correct implementation of the 2nd order derivative of the flow function |
BasicFlowFunction_m_flow_DerivativeCheck | Model that checks the correct implementation of the 1st order derivative of the flow function |
BasicFlowFunction_m_flow_DerivativeCheck2 | Model that checks the correct implementation of the 2nd order derivative of the flow function |
InverseFlowFunctions | Test model for flow function and its inverse |
InvertingBasicFlowFunction_dp | Test model that inverts basicFlowFunction_dp |
InvertingBasicFlowFunction_m_flow | Test model that inverts basicFlowFunction_m_flow |
Buildings.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_dp_DerivativeCheck
Model that checks the correct implementation of the 1st order derivative of the flow function
Information
This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp and its first order derivative Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der. If the derivative implementation is wrong, the simulation will stop with an error.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.35 | Flow coefficient |
MassFlowRate | m_flow_turbulent | 0.36 | Mass flow rate where transition to turbulent flow occurs [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_dp_DerivativeCheck2
Model that checks the correct implementation of the 2nd order derivative of the flow function
Information
This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp and its second order derivative Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der2. If the derivative implementation is wrong, the simulation will stop with an error.
Implementation
The pressure drop dp
is increased non-linearly in order
for the first and second derivatives in
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der2
to be non-zero during part of the simulation. This will ensure
full code coverage of this function.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.35 | Flow coefficient |
MassFlowRate | m_flow_turbulent | 0.36 | Mass flow rate where transition to turbulent flow occurs [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_m_flow_DerivativeCheck
Model that checks the correct implementation of the 1st order derivative of the flow function
Information
This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow and its first order derivative Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_der. If the derivative implementation is wrong, the simulation will stop with an error.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.35 | Flow coefficient |
MassFlowRate | m_flow_turbulent | 0.36 | Mass flow rate where transition to turbulent flow occurs [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_m_flow_DerivativeCheck2
Model that checks the correct implementation of the 2nd order derivative of the flow function
Information
This model validates the implementation of Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow and its second order derivative Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_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_m_flow_der2
to be non-zero during part of the simulation. This will ensure
full code coverage of this function.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.35 | Flow coefficient |
MassFlowRate | m_flow_turbulent | 0.36 | Mass flow rate where transition to turbulent flow occurs [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.InverseFlowFunctions
Test model for flow function and its inverse
Information
This model tests the inverse formulation of the flow functions.
The pressure difference dp
and dpCalc
need to
be equal up to the solver tolerance, except for a small neighborhood
around the origin. In this neighborhood around the origin, the functions
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp
and
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow
are not invertible.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.5 | |
MassFlowRate | m_flow_nominal | 1 | Nominal flow rate [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.InvertingBasicFlowFunction_dp
Test model that inverts basicFlowFunction_dp
Information
This model tests whether the Modelica translator substitutes the
inverse function for
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp.
Specifically, this function declares in its annotation
section
that its inverse is provided by
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow.
Translating this model should therefore give no nonlinear equations
after the symbolic manipulation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.5 | Flow coefficient |
MassFlowRate | m_flow_nominal | 1.5 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.BaseClasses.FlowModels.Validation.InvertingBasicFlowFunction_m_flow
Test model that inverts basicFlowFunction_m_flow
Information
This model tests whether the Modelica translator substitutes the
inverse function for
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow.
Specifically, this function declares in its annotation
section
that its inverse is provided by
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp.
Translating this model should therefore give no nonlinear equations
after the symbolic manipulation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | k | 0.5 | Flow coefficient |
MassFlowRate | m_flow_nominal | 0.5 | Nominal mass flow rate [kg/s] |