modelStratifiedEnhanced

Stratified tank model with enhanced discretization

Extends from BaseClasses.PartialStratified (Partial model of a stratified tank for thermal energy storage).

Information

This is a model of a stratified storage tank for thermal energy storage.

See the Buildings.Fluid.Storage.UsersGuide for more information.

Limitations

The model requires at least 4 fluid segments. Hence, set nSeg to 4 or higher.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.VolumeVTan (from PartialStratified)Tank volume
Modelica.Units.SI.LengthhTan (from PartialStratified)Height of tank (without insulation)
Modelica.Units.SI.LengthdIns (from PartialStratified)Thickness of insulation
Modelica.Units.SI.ThermalConductivitykIns (from PartialStratified)0.04Specific heat conductivity of insulation
IntegernSeg (from PartialStratified)2Number of volume segments
Modelica.Units.SI.Timetau (from PartialStratified)1Time constant for mixing
Assumptions
BooleanallowFlowReversal (from PartialTwoPortInterface)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialTwoPortInterface)Nominal mass flow rate
Advanced
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialTwoPortInterface)1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Advanced › Diagnostics
Booleanshow_T (from PartialTwoPortInterface)false= true, if actual temperature at port is computed
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamics (from PartialStratified)Modelica.Fluid.Types.Dynamics.FixedInitialFormulation of energy balance
Initialization
Medium.AbsolutePressurep_start (from PartialStratified)Medium.p_defaultStart value of pressure
Medium.TemperatureT_start (from PartialStratified)Medium.T_defaultStart value of temperature
Modelica.Units.SI.Temperature[nSeg]TFlu_start (from PartialStratified)T_start*ones(nSeg)Initial temperature of the tank segments, with TFlu_start[1] being the top segment
Medium.MassFraction[Medium.nX]X_start (from PartialStratified)Medium.X_defaultStart value of mass fractions m_i/m
Medium.ExtraProperty[Medium.nC]C_start (from PartialStratified)fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPortInterface)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPortInterface)Fluid connector b (positive design flow direction is from port_a to port_b)
Modelica.Blocks.Interfaces.RealOutputQl_flow (from PartialStratified)Heat loss of tank (positive if heat flows from tank to ambient)
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheaPorVol (from PartialStratified)Heat port that connects to the control volumes of the tank
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheaPorSid (from PartialStratified)Heat port tank side (outside insulation)
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheaPorTop (from PartialStratified)Heat port tank top (outside insulation)
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheaPorBot (from PartialStratified)Heat port tank bottom (outside insulation). Leave unconnected for adiabatic condition

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow (from PartialTwoPortInterface)port_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp (from PartialTwoPortInterface)port_a.p - port_b.pPressure difference between port_a and port_b
Medium.ThermodynamicStatesta_a (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow)))Medium properties in port_a
Medium.ThermodynamicStatesta_b (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow))Medium properties in port_b
Buildings.Fluid.MixingVolumes.MixingVolumevol (from PartialStratified)Tank segment

Revisions

  • March 7, 2022, by Michael Wetter:
    Set final massDynamics=energyDynamics.
    This is for #1542.
  • June 7, 2018 by Filip Jorissen:
    Copied model from Buildings and update the model accordingly. This is for #314.
  • June 1, 2018, by Michael Wetter:
    Refactored model to allow a fluid port in the tank that do not have the enhanced stratification model.
    This is for issue 1182.
  • March 29, 2012 by Wangda Zuo:
    Revised the implementation to reduce the temperature overshoot.
  • June 23, 2010 by Michael Wetter and Wangda Zuo:
    Changed model that is used to correct the numerical diffusion. The previous version used the model from Stefan Wischhusen, An Enhanced Discretization Method for Storage Tank Models within Energy Systems, Modelica Conference, Vienna, Austria, September 2006. However, for situations where there is a strong stratification, this model can lead to a large overshoot in tank temperatures, leading to a violation of the second law. In this revision, the model that computes the volume outlet temperatures has been changed to a third order upwind scheme, which is implemented in Buildings.Fluid.Storage.BaseClasses.ThirdOrderStratifier.
  • October 23, 2008 by Michael Wetter:
    First implementation.