Buildings.Fluid.MixingVolumes.Validation
Collection of validation models
Information
This package contains validation models for the classes in Buildings.Fluid.MixingVolumes.
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 |
---|---|
CoupledVolumesAir | Validation model for two coupled volumes with air |
CoupledVolumesGlycol47 | Validation model for two coupled volumes with glycol |
CoupledVolumesSpecializedAirPerfectGas | Validation model for two coupled volumes with air as a perfect gas |
CoupledVolumesSpecializedWaterConstantProperties_pT | Validation model for two coupled volumes with water with constant properties |
CoupledVolumesSpecializedWaterTemperatureDependentDensity | Validation model for two coupled volumes with water with temperature dependent density |
CoupledVolumesWater | Validation model for two coupled volumes with water |
MixingVolume | Test model for mixing volumes |
MixingVolumeAdiabaticCooling | Validation model for mixing volume with adiabatic cooling |
MixingVolumeHeatReverseFlow | Validation model for mixing volume with heat input and flow reversal |
MixingVolumeHeatReverseFlowPrescribedHeatFlowRate | Validation model for mixing volume with heat input and flow reversal and prescribed heat flow rate |
MixingVolumeInitialization | Test model for mixing volume initialization |
MixingVolumeMFactor | A check for verifying the implementation of the parameter mSenFac |
MixingVolumeMassFlow | Test model for mass flow into and out of volume |
MixingVolumeMoistureReverseFlow | Validation model for mixing volume with moisture input and flow reversal |
MixingVolumeMoistureReverseFlowPrescribedHeatFlowRate | Validation model for mixing volume with moisture input and flow reversal and prescribed heat flow rate |
MixingVolumeSteadyStateMass | Test model for steady state mass dynamics |
MixingVolumeTraceSubstance | Test model for mixing volume with trace substance input |
MixingVolumeTraceSubstanceReverseFlow | Validation model for mixing volume with trace substance input and flow reversal |
MixingVolumeTraceSubstanceReverseFlowPrescribedHeatFlowRate | Validation model for mixing volume with trace substance input and flow reversal, and prescribed heat flow rate |
MixingVolumeZeroFlow | Mixing volume verification around zero flow with heat exchange |
MoistureMixingConservationDynamicBalance | This test checks if mass and energy is conserved when mixing fluid streams using dynamic balances |
MoistureMixingConservationSteadyState | This test checks if mass and energy is conserved when mixing fluid streams using steady state balances |
TraceSubstanceConservationDynamicBalance | This test checks if trace substance mass flow rates are conserved when a dynamic balance is used |
TraceSubstanceConservationSteadyState | This test checks if trace substance mass flow rates are conserved when steady state |
BaseClasses | Baseclasses package |
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesAir
Validation model for two coupled volumes with air
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater (Validation model for two coupled volumes with water).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesGlycol47
Validation model for two coupled volumes with glycol
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater (Validation model for two coupled volumes with water).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedAirPerfectGas
Validation model for two coupled volumes with air as a perfect gas
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater (Validation model for two coupled volumes with water).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedWaterConstantProperties_pT
Validation model for two coupled volumes with water with constant properties
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater (Validation model for two coupled volumes with water).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedWaterTemperatureDependentDensity
Validation model for two coupled volumes with water with temperature dependent density
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater (Validation model for two coupled volumes with water).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.CoupledVolumesWater
Validation model for two coupled volumes with water
Information
Validation model for two directly coupled volumes.
This tests whether a Modelica translator can perform the index reduction.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Buildings.Media.Water | Medium model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolume
Test model for mixing volumes
Information
This model tests the implementation of the mixing volumes.
It compares the results from the mixing volume of the Modelica
Standard Library with the implementation in the Buildings
library.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeAdiabaticCooling
Validation model for mixing volume with adiabatic cooling
Information
This model validates the use of the mixing volume with adiabatic cooling.
Water in liquid form at room temperature is added to the volume,
which decreases its temperature.
The instance volSim
uses a simplified implementation of the
mass balance that ignores the mass of the water added to the volume,
whereas the instance volExa
uses the exact formulation.
The output of the instance relErr
shows that the relative error on the temperature difference between these
two options is less than 0.1%.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeHeatReverseFlow
Validation model for mixing volume with heat input and flow reversal
Information
This model validates the use of the mixing volume with air flowing into and out of the volume and sensible heat added to the volume.
The model volDyn
uses a dynamic balance,
whereas the model volSte
uses a steady-state balance.
The mass flow rate starts positive and reverses its direction at t=5 seconds.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow (Test model for mixing volume with flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
MixingVolume | volDyn | redeclare Buildings.Fluid.Mi... | Volume with dynamic balance |
MixingVolume | volSte | redeclare Buildings.Fluid.Mi... | Volume with steady-state balance |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeHeatReverseFlowPrescribedHeatFlowRate
Validation model for mixing volume with heat input and flow reversal and prescribed heat flow rate
Information
This model is identical to
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeHeatReverseFlow,
except that the steady state volume volSte
is configured to have a prescribed heat flow rate,
which is in this case zero as the heat port is not connected.
This configures volSte
to use the two port
steady state heat and mass balance model
Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation.
Extends from MixingVolumeHeatReverseFlow (Validation model for mixing volume with heat input and flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
MixingVolume | volDyn | redeclare Buildings.Fluid.Mi... | Volume with dynamic balance |
MixingVolume | volSte | redeclare Buildings.Fluid.Mi... | Volume with steady-state balance |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeInitialization
Test model for mixing volume initialization
Information
This model tests the initialization of the mixing volume.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMFactor
A check for verifying the implementation of the parameter mSenFac
Information
This model contains two verifications for the implementation of mSenFac
:
-
The mixingVolume temperature
vol.T
should be constant. This is to check the correct implementation of the parametermSenFac
for moist air media. -
The temperature response of
volMFactor.T
andvol1.T
should be nearly identical. Furthermore the response of the species concentrationXi
demonstrates the difference between using anmSenFac = 10
and multiplying volume by 10.
See Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMassFlow for the rational of the selected initial conditions for the volumes.
Extends from Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMassFlow (Test model for mass flow into and out of volume).
Parameters
Type | Name | Default | Description |
---|---|---|---|
PressureDifference | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 0.5 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMassFlow
Test model for mass flow into and out of volume
Information
This model demonstrates the use of the mixing volume with air flowing into and out of the volume.
The initial conditions for the volume is declared as fixed initial
values for the energy dynamics, but free initial conditions
for the mass dynamics. The reason for leaving the initial conditions
unspecified for the mass dynamics is that the sink bou
declares the pressure of the fluid. As there is no flow resistance
between that boundary condition and the volume,
the volume has the same pressure. Therefore, specifying an
initial condition for the mass dynamics would yield to an overspecified
initial value problem for the pressure of the medium.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
PressureDifference | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 0.5 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMoistureReverseFlow
Validation model for mixing volume with moisture input and flow reversal
Information
This model validates the use of the mixing volume with air flowing into and out of the volume and moisture added to the volume.
The model volDyn
uses a dynamic balance,
whereas the model volSte
uses a steady-state balance.
The mass flow rate starts positive and reverses its direction at t=5 seconds.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow (Test model for mixing volume with flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMoistureReverseFlowPrescribedHeatFlowRate
Validation model for mixing volume with moisture input and flow reversal and prescribed heat flow rate
Information
This model is identical to
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeMoistureReverseFlow,
except that the steady state volume volSte
is configured to have a prescribed heat flow rate,
which is in this case zero as the heat port is not connected.
This configures volSte
to use the two port
steady state heat and mass balance model
Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation.
Extends from MixingVolumeMoistureReverseFlow (Validation model for mixing volume with moisture input and flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeSteadyStateMass
Test model for steady state mass dynamics
Information
This model shows that steady state mass dynamics are correctly simulated. A change in pressure does not lead to an exchange and/or creation of mass. The mixing volume temperature is also unaffected by a pressure change.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstance
Test model for mixing volume with trace substance input
Information
This model demonstrates the use of the mixing volume with air flowing into and out of the volume and trace substances added to the volume.
The model volDyn
uses a dynamic balance,
whereas the model volSte
uses a steady-state balance.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 0.5 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstanceReverseFlow
Validation model for mixing volume with trace substance input and flow reversal
Information
This model validates the use of the mixing volume with air flowing into and out of the volume and trace substances added to the volume.
The model volDyn
uses a dynamic balance,
whereas the model volSte
uses a steady-state balance.
The mass flow rate starts positive and reverses its direction at t=5 seconds.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow (Test model for mixing volume with flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstanceReverseFlowPrescribedHeatFlowRate
Validation model for mixing volume with trace substance input and flow reversal, and prescribed heat flow rate
Information
This model is identical to
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstanceReverseFlow,
except that the steady state volume volSte
is configured to have a prescribed heat flow rate,
which is in this case zero as the heat port is not connected.
This configures volSte
to use the two port
steady state heat and mass balance model
Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation.
Extends from MixingVolumeTraceSubstanceReverseFlow (Validation model for mixing volume with trace substance input and flow reversal).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Pressure | dp_nominal | 10 | Nominal pressure drop [Pa] |
MassFlowRate | m_flow_nominal | 2.0 | Nominal mass flow rate [kg/s] |
MixingVolume | volDyn | volDyn(use_C_flow=true) | Volume with dynamic balance |
MixingVolume | volSte | volSte(use_C_flow=true) | Volume with steady-state balance |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeZeroFlow
Mixing volume verification around zero flow with heat exchange
Information
This model verifies whether the equations in
Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation
are consisent for all foreseeable cases.
All MixingVolume
instances contain the correct
setting for prescribedHeatFlowRate
.
Switching the value will result in an error in each case.
This error either is a non-physical solution to the (non-)linear system
or a division by zero, which halts the simulation.
If you use Dymola, set Advanced.Define.AimForHighAccuracy = false
to
increase the chance of the error being produced for this simple example.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MoistureMixingConservationDynamicBalance
This test checks if mass and energy is conserved when mixing fluid streams using dynamic balances
Information
This model verifies if mass and energy are conserved, using a dynamic balance. Two air streams with different mass flow rate are humidified by a mixing volume with two different vapor mass flow rates. These flows are then mixed. Boundary integrals are used to verify if air mass, vapour mass and internal energy are conserved.
Note, however, that there is some approximation error because in its default configuration, the conservation balance models simplify the treatment of the water that is added to the fluid. See Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation and Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation for a discussion.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation (Partial for checking conservation of mass for independent mass fraction).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Mass | m_start[3] | m_start( ... | Initial mass of the mixing volumes [kg] |
InternalEnergy | U_start[3] | U_start( ... | Initial energy of the mixing volumes [J] |
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.MoistureMixingConservationSteadyState
This test checks if mass and energy is conserved when mixing fluid streams using steady state balances
Information
This test checks if water vapour mass is conserved. Two air streams with different mass flow rate are humidified by a mixing volume with two different vapor mass flow rates. These flows are then mixed. Afterwards the added water is removed again. The final water concentration, mass flow rate and enthalpy flow rate should then be equal to the initial values.
Note, however, that there is some approximation error because in its default configuration, the conservation balance models simplify the treatment of the water that is added to the fluid. See Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation and Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation for a discussion.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation (Partial for checking conservation of mass for independent mass fraction).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.TraceSubstanceConservationDynamicBalance
This test checks if trace substance mass flow rates are conserved when a dynamic balance is used
Information
This test checks if the trace substance flow rate is
conserved when adding moisture to a mixing volume that is configured to steady state.
The trace substance flow rate at the inlet and outlet should be equal
since the trace substance concentration should not
be affected by the independent mass fraction concentration.
Note, however, that there is some approximation error because in its default configuration, the conservation balance models simplify the treatment of the water that is added to the fluid. See Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation and Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation for a discussion.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation (This test checks if trace substance mass flow rates are conserved).
Modelica definition
Buildings.Fluid.MixingVolumes.Validation.TraceSubstanceConservationSteadyState
This test checks if trace substance mass flow rates are conserved when steady state
Information
This test checks if the trace substance flow rate is conserved
when adding moisture to a mixing volume that is configured to steady state.
The trace substance flow rate at the inlet and outlet should be equal
since the trace substance concentration should not
be affected by the independent mass fraction concentration.
Note, however, that there is some approximation error because in its default configuration, the conservation balance models simplify the treatment of the water that is added to the fluid. See Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation and Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation for a discussion.
Extends from Buildings.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation (This test checks if trace substance mass flow rates are conserved).