modelStratified

Model of a stratified tank for thermal energy storage

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

Information

This is a model of a stratified storage tank.

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

For a model with enhanced stratification, use Buildings.Fluid.Storage.StratifiedEnhanced.

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
Modelica.Fluid.Interfaces.FluidPorts_a[nSeg]fluPorVolFluid port that connects to the control volumes of the tank

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.
  • July 29, 2017, by Michael Wetter:
    Removed medium declaration, which is not needed and inconsistent with the declaration in the base class. This is for issue 544.
  • March 28, 2015, by Filip Jorissen:
    Propagated allowFlowReversal and m_flow_small and set mSenFac=1.
  • January 26, 2015, by Michael Wetter:
    Renamed hA_flow to H_a_flow, hB_flow to H_b_flow and hVol_flow to H_vol_flow as they output enthalpy flow rate, and not specific enthalpy. Made various models protected.
  • January 25, 2015, by Michael Wetter:
    Added final to tau = 0 in EnthalpyFlowRate. These sensors do not need dynamics as the enthalpy flow rate is used to compute a heat flow which is then added to the volume of the tank. Thus, if there were high frequency oscillations of small mass flow rates, then they have a small effect on H_flow, and they are not used in any control loop. Rather, the oscillations are further damped by the differential equation of the fluid volume.
  • January 25, 2015, by Filip Jorissen:
    Set tau = 0 in EnthalpyFlowRate sensors for increased simulation speed.
  • August 29, 2014, by Michael Wetter:
    Replaced the use of Medium.lambda_const with Medium.thermalConductivity(sta_default) as lambda_const is not declared for all media. This avoids a translation error if certain media are used.
  • June 18, 2014, by Michael Wetter:
    Changed the default value for the energy balance initialization to avoid a dependency on the global system declaration.
  • July 29, 2011, by Michael Wetter:
    Removed use_T_start and h_start.
  • February 18, 2011, by Michael Wetter:
    Changed default start values for temperature and pressure.
  • October 25, 2009 by Michael Wetter:
    Changed computation of heat transfer through top (and bottom) of tank. Now, the thermal resistance of the fluid is not taken into account, i.e., the top (and bottom) element is assumed to be mixed.
  • October 23, 2009 by Michael Wetter:
    Fixed bug in computing heat conduction of top and bottom segment. In the previous version, for computing the heat conduction between the top (or bottom) segment and the outside, the whole thickness of the water volume was used instead of only half the thickness.
  • February 19, 2009 by Michael Wetter:
    Changed declaration that constrains the medium. The earlier declaration caused the medium model to be not shown in the parameter window.
  • October 31, 2008 by Michael Wetter:
    Added heat conduction.
  • October 23, 2008 by Michael Wetter:
    First implementation.