IEA EBC Annex 60 EBC logo

Annex60.Fluid.MixingVolumes.Validation.BaseClasses

Baseclasses package

Information

This package contains base classes that are used to construct the models in Annex60.Fluid.MixingVolumes.Validation.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow MixingVolumeReverseFlow Test model for mixing volume with flow reversal
Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation MoistureMixingConservation Partial for checking conservation of mass for independent mass fraction
Annex60.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation TraceSubstanceConservation This test checks if trace substance mass flow rates are conserved

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow

Test model for mixing volume with flow reversal

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow

Information

This model is the base class to validate the mixing volume with air flowing into and out of the volume and heat, moisture or trace substance 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 Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Pressuredp_nominal10Nominal pressure drop [Pa]
MassFlowRatem_flow_nominal2.0Nominal mass flow rate [kg/s]
MixingVolumevolDynredeclare Annex60.Fluid.Mixi...Volume with dynamic balance
MixingVolumevolSteredeclare Annex60.Fluid.Mixi...Volume with steady-state balance

Modelica definition

partial model MixingVolumeReverseFlow "Test model for mixing volume with flow reversal" extends Modelica.Icons.Example; package Medium = Annex60.Media.Air "Medium model"; constant Boolean prescribedHeatFlowRate = false "Flag that affects what steady state balance is used in the volume"; parameter Modelica.SIunits.Pressure dp_nominal = 10 "Nominal pressure drop"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal = 2.0 "Nominal mass flow rate"; Modelica.Fluid.Sources.MassFlowSource_T sou( redeclare package Medium = Medium, nPorts=1, m_flow=m_flow_nominal, use_m_flow_in=true, T=313.15) "Flow source and sink"; Sources.Boundary_pT bou( redeclare package Medium = Medium, T=303.15, nPorts=2) "Boundary condition"; replaceable Annex60.Fluid.MixingVolumes.MixingVolume volDyn constrainedby Annex60.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume( redeclare package Medium = Medium, V=1, nPorts=2, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Volume with dynamic balance"; replaceable Annex60.Fluid.MixingVolumes.MixingVolume volSte constrainedby Annex60.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume( redeclare package Medium = Medium, final prescribedHeatFlowRate = prescribedHeatFlowRate, V=1, nPorts=2, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Volume with steady-state balance"; Modelica.Blocks.Math.Gain gain "Gain to add heat, moisture or trace substance flow rate"; Modelica.Fluid.Sources.MassFlowSource_T sou1( redeclare package Medium = Medium, nPorts=1, m_flow=m_flow_nominal, use_m_flow_in=true, T=313.15) "Flow source and sink"; Modelica.Blocks.Sources.Ramp m_flow( height=-2*m_flow_nominal, duration=10, offset=m_flow_nominal) "Mass flow rate"; equation connect(sou.ports[1], volDyn.ports[1]); connect(sou1.ports[1], volSte.ports[1]); connect(volSte.ports[2], bou.ports[1]); connect(volDyn.ports[2], bou.ports[2]); connect(sou.m_flow_in, m_flow.y); connect(m_flow.y, sou1.m_flow_in); connect(m_flow.y, gain.u); end MixingVolumeReverseFlow;

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation

Partial for checking conservation of mass for independent mass fraction

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation

Information

This is a partial model that is used in the validation tests of the mixing volume.

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

Modelica definition

partial model MoistureMixingConservation "Partial for checking conservation of mass for independent mass fraction" extends Modelica.Icons.Example; package Medium = Annex60.Media.Air "Medium model"; Annex60.Fluid.Sources.MassFlowSource_h sou1( redeclare package Medium = Medium, nPorts=1, m_flow=2, X={0,1}) "Air source"; Annex60.Fluid.Sources.MassFlowSource_h sou2( redeclare package Medium = Medium, nPorts=1, m_flow=1, X={0,1}) "Air source"; Annex60.Fluid.MixingVolumes.MixingVolumeMoistAir vol( redeclare package Medium = Medium, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=1, V=1, nPorts=2, allowFlowReversal=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Mixing volume for adding water"; Annex60.Fluid.MixingVolumes.MixingVolumeMoistAir vol1( redeclare package Medium = Medium, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=1, V=1, nPorts=2, allowFlowReversal=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Mixing volume for adding water"; Annex60.Fluid.Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Air sink"; Annex60.Fluid.MixingVolumes.MixingVolumeMoistAir vol2( redeclare package Medium = Medium, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=1, V=1, nPorts=2, allowFlowReversal=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Mixing volume for removing water"; Modelica.Blocks.Sources.Constant mWatFlo1(k=0.001) "Water mass flow rate 1"; Modelica.Blocks.Sources.Constant TWat(k=273.15) "Watter supply temperature"; Modelica.Blocks.Sources.Constant mWatFlo3(k=-(mWatFlo1.k + mWatFlo2.k)) "Withdrawn water rate"; Modelica.Blocks.Sources.Constant mWatFlo2(k=0.003) "Water mass flow rate 2"; Modelica.Blocks.Math.Add cheMasFra(k2=-1) "Check for water conservation"; Annex60.Fluid.Sensors.MassFractionTwoPort senMasFra( redeclare package Medium = Medium, m_flow_nominal=1, tau=0, allowFlowReversal=false) "Sensor for measuring water content"; Modelica.Blocks.Sources.Constant mWatFloSol "Solution mass fraction water"; Annex60.Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = Medium, allowFlowReversal=false) "Mass flow rate sensor"; Modelica.Blocks.Math.Add cheMasFlo(k2=-1) "Check for conservation of mass"; Modelica.Blocks.Sources.Constant mFloSol "Solution mass flow rate"; Sensors.EnthalpyFlowRate senSpeEnt( redeclare package Medium = Medium, allowFlowReversal=false, m_flow_nominal=1, tau=0) "Specific enthalpy flow rate sensor"; Modelica.Blocks.Math.Add cheSpeEnt(k2=-1) "Check for conservation of energy"; Modelica.Blocks.Sources.Constant hSol "Solution mass flow rate"; protected Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare package Medium = Medium) "Fluid port for using fluid stream mixing implementation"; equation connect(sou1.ports[1], vol.ports[1]); connect(sou2.ports[1], vol1.ports[1]); connect(mWatFlo1.y, vol.mWat_flow); connect(vol1.TWat,TWat. y); connect(vol.TWat,TWat. y); connect(mWatFlo3.y, vol2.mWat_flow); connect(vol2.TWat,TWat. y); connect(mWatFlo2.y, vol1.mWat_flow); connect(vol1.ports[2], port_a); connect(vol.ports[2], port_a); connect(port_a, vol2.ports[1]); connect(mWatFloSol.y,cheMasFra. u1); connect(senMasFlo.port_b, senMasFra.port_a); connect(vol2.ports[2], senSpeEnt.port_a); connect(senSpeEnt.port_b, senMasFlo.port_a); connect(hSol.y,cheSpeEnt. u1); connect(mFloSol.y,cheMasFlo. u1); connect(senMasFra.port_b, sin.ports[1]); end MoistureMixingConservation;

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation Annex60.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation

This test checks if trace substance mass flow rates are conserved

Annex60.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation

Information

This model is reconfigured to a steady state or dynamic check for conservation of trace substances.

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

Modelica definition

model TraceSubstanceConservation "This test checks if trace substance mass flow rates are conserved" extends Modelica.Icons.Example; constant String substanceName="CO2"; package Medium = Annex60.Media.Air(extraPropertiesNames={substanceName}); Annex60.Fluid.Sources.MassFlowSource_h sou( redeclare package Medium = Medium, nPorts=1, m_flow=1, X={0.01,0.99}, C=fill(0.001, Medium.nC)) "Air source with moisture and trace substances"; Annex60.Fluid.MixingVolumes.MixingVolumeMoistAir vol( redeclare package Medium = Medium, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=1, V=1, nPorts=2, allowFlowReversal=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Mixing volume for adding moisture"; Modelica.Blocks.Sources.Constant TWat(k=273.15) "Water supply temperature"; Modelica.Blocks.Sources.Constant mWatFlo(k=0.001) "Water mass flow rate "; Annex60.Fluid.Sensors.TraceSubstancesTwoPort senTraSubIn( redeclare package Medium = Medium, m_flow_nominal=1, tau=0, allowFlowReversal=false, substanceName=substanceName) "Measured inlet trace substance concentration"; Annex60.Fluid.Sensors.TraceSubstancesTwoPort senTraSubOut( redeclare package Medium = Medium, m_flow_nominal=1, tau=0, allowFlowReversal=false, substanceName=substanceName) "Measured outlet trace substance concentration"; Annex60.Fluid.Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Air sink"; Sensors.MassFlowRate senMasFloIn(redeclare package Medium = Medium, allowFlowReversal=false) "Fluid mass flow rate at inlet"; Sensors.MassFlowRate senMasFloOut(redeclare package Medium = Medium, allowFlowReversal=false) "Fluid mass flow rate at outlet"; Modelica.Blocks.Math.Product CfloIn "Trace substance mass flow rate at inlet"; Modelica.Blocks.Math.Product CfloOut "Trace substance mass flow rate at outlet"; equation connect(vol.TWat, TWat.y); connect(mWatFlo.y, vol.mWat_flow); connect(sou.ports[1], senTraSubIn.port_a); connect(senTraSubIn.port_b, senMasFloIn.port_a); connect(senMasFloIn.port_b, vol.ports[1]); connect(sin.ports[1], senMasFloOut.port_b); connect(senMasFloOut.port_a, senTraSubOut.port_b); connect(CfloIn.u2, senTraSubIn.C); connect(CfloIn.u1, senMasFloIn.m_flow); connect(CfloOut.u1, senMasFloOut.m_flow); connect(CfloOut.u2, senTraSubOut.C); connect(vol.ports[2], senTraSubOut.port_a); end TraceSubstanceConservation;

http://iea-annex60.org