Buildings.Fluid.Storage.BaseClasses
Package with base classes for Buildings.Fluid.Storage
Information
This package contains base classes that are used to construct the models in Buildings.Fluid.Storage.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
Buoyancy | Model to add buoyancy if there is a temperature inversion in the tank |
IndirectTankHeatExchanger | Heat exchanger typically submerged in a fluid with a second fluid circulating through it |
PartialStratified | Partial model of a stratified tank for thermal energy storage |
ThirdOrderStratifier | Model to reduce the numerical dissipation in a tank |
Examples | Examples for BaseClasses models |
Buildings.Fluid.Storage.BaseClasses.Buoyancy
Model to add buoyancy if there is a temperature inversion in the tank
Information
This model outputs a heat flow rate that can be added to fluid volumes in order to emulate buoyancy during a temperature inversion. For simplicity, this model does not compute a buoyancy induced mass flow rate, but rather a heat flow that has the same magnitude as the enthalpy flow associated with the buoyancy induced mass flow rate.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model | |
Volume | V | Volume [m3] | |
Integer | nSeg | 2 | Number of volume segments |
Time | tau | Time constant for mixing [s] |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model | |
HeatPort_a | heatPort[nSeg] | Heat input into the volumes |
Modelica definition
Buildings.Fluid.Storage.BaseClasses.IndirectTankHeatExchanger
Heat exchanger typically submerged in a fluid with a second fluid circulating through it
Information
This model is a heat exchanger with a moving fluid on one side and a stagnant fluid on the other. It is intended for use when a heat exchanger is submerged in a stagnant fluid. For example, the heat exchanger in a storage tank which is part of a solar thermal system.
This component models the fluid in the heat exchanger, convection between the fluid and the heat exchanger, and convection from the heat exchanger to the surrounding fluid.
The model is based on Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside and Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder.
The fluid ports are intended to be connected to a circulated heat transfer fluid while the heat port is intended to be connected to a stagnant fluid.
Extends from Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports), Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package MediumHex | Modelica.Media.Interfaces.Pa... | Heat transfer fluid flowing through the heat exchanger | |
replaceable package MediumTan | Modelica.Media.Interfaces.Pa... | Heat transfer fluid inside the tank | |
replaceable package Medium | PartialMedium | Medium in the component | |
Integer | nSeg | Number of segments in the heat exchanger | |
HeatCapacity | CHex | Capacitance of the heat exchanger [J/K] | |
Volume | volHexFlu | Volume of heat transfer fluid in the heat exchanger [m3] | |
Diameter | dExtHex | Exterior diameter of the heat exchanger pipe [m] | |
Nominal condition | |||
PressureDifference | dp_nominal | Pressure difference [Pa] | |
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
HeatFlowRate | Q_flow_nominal | Heat transfer at nominal conditions [W] | |
Temperature | TTan_nominal | Temperature of fluid inside the tank at UA_nominal [K] | |
Temperature | THex_nominal | Temperature of fluid inside the heat exchanger at UA_nominal [K] | |
Real | r_nominal | 0.5 | Ratio between coil inside and outside convective heat transfer |
Flow resistance | |||
Boolean | computeFlowResistance | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics | |||
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Dynamics | energyDynamicsSolid | energyDynamics | Formulation of energy balance for heat exchanger solid mass |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Initialization | |||
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Modeling detail | |||
Boolean | hA_flowDependent | true | Set to false to make the convective heat coefficient calculation of the fluid inside the coil independent of mass flow rate |
Boolean | hA_temperatureDependent | true | Set to false to make the convective heat coefficient calculation of the fluid inside the coil independent of temperature |
Connectors
Type | Name | Description |
---|---|---|
replaceable package MediumHex | Heat transfer fluid flowing through the heat exchanger | |
replaceable package MediumTan | Heat transfer fluid inside the tank | |
replaceable package Medium | Medium in the component | |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
HeatPort_a | port[nSeg] | Heat port connected to water inside the tank |
Modelica definition
Buildings.Fluid.Storage.BaseClasses.PartialStratified
Partial model of a stratified tank for thermal energy storage
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.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Volume | VTan | Tank volume [m3] | |
Length | hTan | Height of tank (without insulation) [m] | |
Length | dIns | Thickness of insulation [m] | |
ThermalConductivity | kIns | 0.04 | Specific heat conductivity of insulation [W/(m.K)] |
Integer | nSeg | 2 | Number of volume segments |
Time | tau | 1 | Time constant for mixing [s] |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Dynamics | |||
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Formulation of energy balance |
Dynamics | massDynamics | energyDynamics | Formulation of mass balance |
Initialization | |||
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Connectors
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
output RealOutput | Ql_flow | Heat loss of tank (positive if heat flows from tank to ambient) |
HeatPort_a | heaPorVol[nSeg] | Heat port that connects to the control volumes of the tank |
HeatPort_a | heaPorSid | Heat port tank side (outside insulation) |
HeatPort_a | heaPorTop | Heat port tank top (outside insulation) |
HeatPort_a | heaPorBot | Heat port tank bottom (outside insulation). Leave unconnected for adiabatic condition |
Modelica definition
Buildings.Fluid.Storage.BaseClasses.ThirdOrderStratifier
Model to reduce the numerical dissipation in a tank
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]
andhOut[nSeg]
. Note: Using it requiresnSeg ≥ 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.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model | |
MassFlowRate | m_flow_small | Small mass flow rate for regularization of zero flow [kg/s] | |
Integer | nSeg | Number of volume segments | |
Real | alpha | 0.5 | Under-relaxation coefficient (1: QUICK; 0: 1st order upwind) |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model | |
HeatPort_a | heatPort[nSeg] | Heat input into the volumes |
input RealInput | m_flow | Mass flow rate from port a to port b |
input RealInput | H_flow[nSeg + 1] | Enthalpy flow between the volumes |
FluidPort_a | fluidPort[nSeg + 2] | Fluid port, needed to get pressure, temperature and species concentration |