modelThirdOrderStratifier

Model to reduce the numerical dissipation in a tank

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Information

This model reduces the numerical dissipation that is introduced by the standard first-order upwind discretization scheme which is created when connecting fluid volumes in series.

The model is used in conjunction with Buildings.Fluid.Storage.Stratified. It computes a heat flux that needs to be added to each volume of Buildings.Fluid.Storage.Stratified in order to give the results that a third-order upwind discretization scheme (QUICK) would give.

The QUICK method can cause oscillations in the tank temperatures since the high order method introduces numerical dispersion. There are two ways to reduce the oscillations:

  • To use an under-relaxation coefficient alpha when adding the heat flux into the volume.
  • To use the first-order upwind for hOut[2] and hOut[nSeg]. Note: Using it requires nSeg ≥ 4.

Both approaches are implemented in the model.

The model is used by Buildings.Fluid.Storage.StratifiedEnhanced.

Limitations

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

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow_smallSmall mass flow rate for regularization of zero flow
IntegernSegNumber of volume segments
Realalpha0.5Under-relaxation coefficient (1: QUICK; 0: 1st order upwind)

Connectors

TypeNameDefaultDescription
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheatPortHeat input into the volumes
Modelica.Blocks.Interfaces.RealInputm_flowMass flow rate from port a to port b
Modelica.Blocks.Interfaces.RealInputH_flowEnthalpy flow between the volumes
Modelica.Fluid.Interfaces.FluidPort_afluidPortFluid port, needed to get pressure, temperature and species concentration

Contents

NameDescription
MediumMedium model

Revisions

  • June 7, 2018 by Filip Jorissen:
    Copied model from Buildings and update the model accordingly. This is for #314.
  • December 14, 2012 by Michael Wetter:
    Removed unused protected parameters sta0 and cp0.
  • March 29, 2012 by Wangda Zuo:
    Revised the implementation to reduce the temperature overshoot.
  • July 28, 2010 by Wangda Zuo:
    Rewrote third order upwind scheme to avoid state events. This leads to more robust and faster simulation.
  • June 23, 2010 by Michael Wetter and Wangda Zuo:
    First implementation.