modelPartialStratified
Partial model of a stratified tank for thermal energy storage
Extends from Buildings.Fluid.Storage.BaseClasses.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Information
This is a partial model of a stratified storage tank.
See the Buildings.Fluid.Storage.UsersGuide for more information.
Implementation
This model does not include the ports that connect to the fluid from the outside, because these ports cannot be used for the models that contain the Buildings.Fluid.Storage.BaseClasses.ThirdOrderStratifier.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Volume | VTan | Tank volume | |
| Modelica.Units.SI.Length | hTan | Height of tank (without insulation) | |
| Modelica.Units.SI.Length | dIns | Thickness of insulation | |
| Modelica.Units.SI.ThermalConductivity | kIns | 0.04 | Specific heat conductivity of insulation |
| Integer | nSeg | 2 | Number of volume segments |
| Modelica.Units.SI.Time | tau | 1 | Time constant for mixing |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPortInterface) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal (from PartialTwoPortInterface) | Nominal mass flow rate | |
| Advanced | |||
| Modelica.Units.SI.MassFlowRate | m_flow_small (from PartialTwoPortInterface) | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialTwoPortInterface) | false | = true, if actual temperature at port is computed |
| Dynamics › Conservation equations | |||
| Modelica.Fluid.Types.Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamics.FixedInitial | Formulation of energy balance |
| Initialization | |||
| Medium.AbsolutePressure | p_start | Medium.p_default | Start value of pressure |
| Medium.Temperature | T_start | Medium.T_default | Start value of temperature |
| Modelica.Units.SI.Temperature[nSeg] | TFlu_start | T_start*ones(nSeg) | Initial temperature of the tank segments, with TFlu_start[1] being the top segment |
| Medium.MassFraction[Medium.nX] | X_start | Medium.X_default | Start value of mass fractions m_i/m |
| Medium.ExtraProperty[Medium.nC] | C_start | fill(0, Medium.nC) | Start value of trace substances |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPortInterface) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPortInterface) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Blocks.Interfaces.RealOutput | Ql_flow | Heat loss of tank (positive if heat flows from tank to ambient) | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a | heaPorVol | Heat port that connects to the control volumes of the tank | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a | heaPorSid | Heat port tank side (outside insulation) | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a | heaPorTop | Heat port tank top (outside insulation) | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a | heaPorBot | Heat port tank bottom (outside insulation). Leave unconnected for adiabatic condition |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow (from PartialTwoPortInterface) | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp (from PartialTwoPortInterface) | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_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.ThermodynamicState | sta_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.MixingVolume | vol | Tank segment |
Revisions
-
February 7, 2025, by Jelger Jansen:
Removedimportstatement. This is for IBPSA, #1961. -
March 7, 2022, by Michael Wetter:
Setfinal massDynamics=energyDynamics.
This is for #1542. -
November 13, 2019 by Jianjun Hu:
Added parameterTFlu_startand changed the initial tank segments temperature toTFlu_startso each segment could have different temperature. This is for #1246. -
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:
PropagatedallowFlowReversalandm_flow_smalland setmSenFac=1. -
January 26, 2015, by Michael Wetter:
RenamedhA_flowtoH_a_flow,hB_flowtoH_b_flowandhVol_flowtoH_vol_flowas they output enthalpy flow rate, and not specific enthalpy. Made various modelsprotected. -
January 25, 2015, by Michael Wetter:
Addedfinaltotau = 0inEnthalpyFlowRate. 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 onH_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:
Settau = 0inEnthalpyFlowRatesensors for increased simulation speed. -
August 29, 2014, by Michael Wetter:
Replaced the use ofMedium.lambda_constwithMedium.thermalConductivity(sta_default)aslambda_constis 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 globalsystemdeclaration. -
July 29, 2011, by Michael Wetter:
Removeduse_T_startandh_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.