modelControlledTank
Extends from Buildings.Fluid.Storage.Ice.Tank (Ice tank with performance based on performance curves).
Information
This model implements an ice tank model with built-in idealized control
that tracks the set point TSet for the temperature of the working fluid
that leaves the tank, as shown in the figure below.
The model is identical to Buildings.Fluid.Storage.Ice.Tank, except that it takes as an input the set point for the temperature of the leaving working fluid. This temperature is maintained if the flow rate and temperatures allow sufficient heat flow rate between the tank and the working fluid.
The built-in control is an idealization of a tank that has a controller that
bypasses some of the working fluid in order to meet the set point for the temperature
of the leaving working fluid.
The fluid from port_a to port_b has by default
a first order response. If the tank has sufficient capacity for the given
inlet temperature and flow rate, then the idealized control has no
steady-state error. During transients, the set point may not be met
exactly due to the first order response that approximates the dynamics
of the heat exchanger.
Note that the setpoint is also tracked during charging mode.
If the full flow rate should go through the tank during charging,
which is generally desired, then set TSet to a
high temperature, such as 20°C.
Usage
This model requires the fluid to flow from port_a to port_b.
Otherwise, the simulation stops with an error.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | homotopyInitialization (from TwoPortHeatMassExchanger) | true | = true, use homotopy method |
| Buildings.Fluid.Storage.Ice.Data.Tank.Generic | per (from Tank) | Performance data | |
| Modelica.Units.SI.SpecificHeatCapacity | cp (from Tank) | Medium.specificHeatCapacityCp(Medium.setState_pTX(p = Medium.p_default, T = 273.15, X = Medium.X_default)) | Specific heat capacity of working fluid |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | 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 | |
| Modelica.Units.SI.PressureDifference | dp_nominal (from TwoPortFlowResistanceParameters) | Pressure difference | |
| 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 |
| Flow resistance | |||
| Boolean | computeFlowResistance (from TwoPortFlowResistanceParameters) | true | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp (from TwoPortFlowResistanceParameters) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n (from TwoPortFlowResistanceParameters) | 2 | Flow exponent, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance (from TwoPortFlowResistanceParameters) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM (from TwoPortFlowResistanceParameters) | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
| Dynamics › Nominal condition | |||
| Modelica.Units.SI.Time | tau (from TwoPortHeatMassExchanger) | 30 | Time constant at nominal flow (if energyDynamics <> SteadyState) |
| Dynamics › Conservation equations | |||
| Modelica.Fluid.Types.Dynamics | energyDynamics (from TwoPortHeatMassExchanger) | Modelica.Fluid.Types.Dynamics.DynamicFreeInitial | Type of energy balance: dynamic (3 initialization options) or steady state |
| Initialization | |||
| Medium.AbsolutePressure | p_start (from TwoPortHeatMassExchanger) | Medium.p_default | Start value of pressure |
| Medium.Temperature | T_start (from TwoPortHeatMassExchanger) | Medium.T_default | Start value of temperature |
| Medium.MassFraction[Medium.nX] | X_start (from TwoPortHeatMassExchanger) | Medium.X_default | Start value of mass fractions m_i/m |
| Medium.ExtraProperty[Medium.nC] | C_start (from TwoPortHeatMassExchanger) | fill(0, Medium.nC) | Start value of trace substances |
| Real | SOC_start (from Tank) | Start value for state of charge | |
| Dynamics heat exchanger › Conservation equations | |||
| Modelica.Fluid.Types.Dynamics | energyDynamicsHex (from Tank) | Modelica.Fluid.Types.Dynamics.DynamicFreeInitial | Formulation of energy balance for heat exchanger internal fluid mass |
| Modelica.Units.SI.Time | tauHex (from Tank) | 30 | Time constant of working fluid through the heat exchanger at nominal flow |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Blocks.Interfaces.RealOutput | SOC (from Tank) | state of charge | |
| Modelica.Blocks.Interfaces.RealOutput | T (from Tank) | Temperature of the fluid leaving at port_b | |
| Modelica.Blocks.Interfaces.RealOutput | mIce (from Tank) | Mass of remaining ice | |
| Modelica.Blocks.Interfaces.RealOutput | Q_flow (from Tank) | Heat flow rate, positive during charging, negative when melting the ice | |
| Modelica.Blocks.Interfaces.RealInput | TSet | Outlet temperature setpoint during discharging |
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 (from TwoPortHeatMassExchanger) | ||
| Buildings.Fluid.FixedResistances.PressureDrop | preDro (from TwoPortHeatMassExchanger) | Flow resistance |
Revisions
-
January 26, 2022, by Michael Wetter:
Refactored model to new architecture. Changed model to allow idealized control. Avoided SOC to be outside [0, 1]. -
December 14, 2021, by Yangyang Fu:
First implementation.