Tank with liquid and vapor volumes of variable proportion

• Library:
• Simscape / Fluids / Two-Phase Fluid / Tanks & Accumulators

Description

The Receiver-Accumulator (2P) block represents a tank with fluid that can undergo phase change. The liquid and vapor phases, referred to as zones, are modeled as distinct volumes that can change in size during simulation, but do not mix. The relative amount of space a zone occupies in the system is called a zone fraction, which ranges from `0` to `1`. The vapor-liquid mixture phase is not modeled.

In an HVAC system, when this tank is placed between a condenser and an expansion valve, it acts as a receiver. Liquid connections to the block are made at ports AL and BL. When the tank is placed between an evaporator and a compressor, it acts as an accumulator. Vapor connections to the block are made at ports AV and BV. A fluid of either phase can be connected to either port, however the fluid exiting from a V port is in the vapor zone and an L port is in the liquid zone. There is no mass flow through unconnected ports.

The temperature of the tank walls are set at port H.

The liquid level of the tank is reported as a zone fraction at port L. If the liquid level reports `0`, the tank is fully filled with vapor. The tank is never empty.

Heat Transfer Between the Fluid and Wall

The total heat transfer between the fluid and the wall, QH, is the sum of the heat transfer in the liquid and vapor phases:

`${Q}_{\text{H}}={Q}_{\text{L}}+{Q}_{\text{V}}.$`

The heat transfer between the liquid and the wall is:

`${Q}_{\text{L}}={z}_{\text{L}}{S}_{\text{W}}{\alpha }_{\text{L}}\left({T}_{\text{H}}-{T}_{\text{L}}\right),$`

where:

• zL is the liquid volume fraction of the tank.

• SW is the Total heat transfer surface area.

• αL is the Liquid heat transfer coefficient.

• TH is the temperature of the tank wall.

• TL is the temperature of the liquid.

The heat transfer between the vapor and the wall is:

`${Q}_{V}=\left(1-{z}_{L}\right){S}_{\text{W}}{\alpha }_{\text{V}}\left({T}_{\text{H}}-{T}_{\text{V}}\right),$`

where:

• αV is the Vapor heat transfer coefficient.

• TV is the temperature of the vapor.

The liquid volume fraction is determined from the liquid mass fraction:

`${z}_{\text{L}}=\frac{{f}_{\text{M,L}}{\nu }_{\text{L}}}{{f}_{\text{M,L}}{\nu }_{\text{L}}+\left(1-{f}_{\text{M,L}}\right){\nu }_{\text{V}}},$`

where:

• fM,L is the mass fraction of the liquid.

• νL is the specific volume of the liquid.

• νV is the specific volume of the vapor.

Energy Flow Rates Due To Phase Change

When the liquid specific enthalpy is greater than or equal to the saturated liquid specific enthalpy, the mass flow rate of the vaporizing fluid is:

`${\stackrel{˙}{m}}_{\text{Vap}}=\frac{{M}_{L}\left({h}_{L}-{h}_{L,Sat}\right)/\left({h}_{V}-{h}_{L,Sat}\right)}{\tau }.$`

where:

• ML is the total liquid mass.

• τ is the Vaporization and condensation time constant parameter.

• hL is the specific enthalpy of the liquid at the internal node.

• hL,Sat is the saturated liquid specific enthalpy at the internal node.

• hV is the specific enthalpy of the vapor.

• hV,Sat is the saturated vapor specific enthalpy.

The energy flow associated with vaporization is:

`${\varphi }_{\text{Vap}}={\stackrel{˙}{m}}_{\text{Vap}}{h}_{V,Sat},$`

When the liquid specific enthalpy is lower than the saturated liquid specific enthalpy, no vaporization occurs, and Vap = 0.

Similarly, when the vapor specific enthalpy is less than or equal to the saturated vapor specific enthalpy, the mass flow rate of the condensing fluid is:

`${\stackrel{˙}{m}}_{\text{Con}}=\frac{{M}_{V}\left({h}_{V}-{h}_{V,Sat}\right)/\left({h}_{V}-{h}_{L,Sat}\right)}{\tau }.$`

where MV is the total vapor mass.

The energy flow associated with condensation is:

`${\varphi }_{\text{Con}}={\stackrel{˙}{m}}_{\text{Con}}{h}_{L,Sat},$`

When the vapor specific enthalpy is higher than the saturated vapor specific enthalpy, no condensation occurs, and Con = 0.

Mass Balance

The total tank volume is constant. Due to phase change, the volume fraction and mass of the fluid changes. The mass balance in the liquid zone is:

`$\frac{\text{d}{M}_{\text{L}}}{\text{d}t}={\stackrel{˙}{m}}_{\text{L,In}}-{\stackrel{˙}{m}}_{\text{L,Out}}+{\stackrel{˙}{m}}_{\text{Con}}-{\stackrel{˙}{m}}_{\text{Vap}},$`

where:

• $\stackrel{˙}{m}$L,In is the inlet liquid mass flow rate at all L and V ports.

• $\stackrel{˙}{m}$L,Out is the outlet liquid mass flow rate:

`${\stackrel{˙}{m}}_{\text{L,Out}}=-\left({\stackrel{˙}{m}}_{\text{AL}}+{\stackrel{˙}{m}}_{\text{BL}}\right),$`

• $\stackrel{˙}{m}$Con is the mass flow rate of the condensing fluid.

• $\stackrel{˙}{m}$Vap is the mass flow rate of the vaporizing fluid.

The mass balance in the vapor zone is:

`$\frac{\text{d}{M}_{\text{V}}}{\text{d}t}={\stackrel{˙}{m}}_{\text{V,In}}-{\stackrel{˙}{m}}_{\text{V,Out}}-{\stackrel{˙}{m}}_{\text{Con}}+{\stackrel{˙}{m}}_{\text{Vap}},$`

where:

• MV is the total vapor mass.

• $\stackrel{˙}{m}$V,In is the inlet vapor mass flow rate at all L and V ports.

• $\stackrel{˙}{m}$V,Out is the outlet vapor mass flow rate:

`${\stackrel{˙}{m}}_{\text{V,Out}}=-\left({\stackrel{˙}{m}}_{\text{AV}}+{\stackrel{˙}{m}}_{\text{BV}}\right).$`

If there is only one zone present in the tank, the outlet mass flow rate of the fluid is the sum of the flow rate through all of the ports:

`${\stackrel{˙}{m}}_{\text{phase,Out}}=-\left({\stackrel{˙}{m}}_{\text{AL}}+{\stackrel{˙}{m}}_{\text{BL}}+{\stackrel{˙}{m}}_{\text{AV}}+{\stackrel{˙}{m}}_{\text{BV}}\right).$`

where $\stackrel{˙}{m}$phase,Out is $\stackrel{˙}{m}$L,Out if the fluid is entirely liquid, and $\stackrel{˙}{m}$V,Out if the fluid is entirely vapor.

Energy Balance

The fluid can heat or cool depending on the heat transfer between the tank and wall, which is set by the temperature at port H.

The energy balance in the liquid zone is:

`${M}_{\text{L}}\frac{\text{d}{u}_{\text{L}}}{\text{d}t}+\frac{\text{d}{M}_{\text{L}}}{\text{d}t}{u}_{\text{L}}={\varphi }_{\text{L,In}}-{\varphi }_{\text{L,Out}}+{\varphi }_{\text{Con}}-{\varphi }_{\text{Vap}}+{Q}_{\text{L}}.$`

where:

• uL is the specific internal energy of the liquid.

• ϕL,In is the inlet liquid energy flow rate at all L and V ports.

• ϕL,Out is the outlet liquid energy flow rate:

`${\varphi }_{\text{L,Out}}=-\left({\varphi }_{\text{AL}}+{\varphi }_{\text{BL}}\right).$`

• ϕCon is the energy flow rate of the condensing vapor.

• ϕVap is the energy flow rate of the vaporizing liquid.

• QL is the heat transfer between the tank wall and the liquid.

The energy balance in the vapor zone is:

`${M}_{\text{V}}\frac{\text{d}{u}_{\text{V}}}{\text{d}t}+\frac{\text{d}{M}_{\text{V}}}{\text{d}t}{u}_{\text{V}}={\varphi }_{\text{V,In}}-{\varphi }_{\text{V,Out}}-{\varphi }_{\text{Con}}+{\varphi }_{\text{Vap}}+{Q}_{\text{V}}.$`

• uV is the specific internal energy of the vapor.

• ϕV,In is the inlet vapor energy flow rate at all L and V ports.

• ϕV,Out is the outlet vapor energy flow rate:

`${\varphi }_{\text{V,Out}}=-\left({\varphi }_{\text{AV}}+{\varphi }_{\text{BV}}\right).$`

• QV is the heat transfer between the tank wall and the vapor.

If there is only one zone present in the tank, the outlet energy flow rate is the sum of the flow rate through all of the ports:

`${\varphi }_{\text{phase,Out}}=-\left({\varphi }_{\text{AL}}+{\varphi }_{\text{BL}}+{\varphi }_{\text{AV}}+{\varphi }_{\text{BV}}\right).$`

where ϕphase,Out is ϕL,Out if the fluid is entirely liquid, and ϕV,Out if the fluid is entirely vapor.

Momentum Balance

There are no pressure changes modeled in the tank, including hydrostatic pressure. The pressure at any port is equal to the internal tank pressure.

Assumptions and Limitations

• Pressure must remain below the critical pressure.

• Hydrostatic pressure is not modeled.

• The container wall is rigid, therefore the total volume of fluid is constant.

• The thermal mass of the tank wall is not modeled.

• Flow resistance through the outlets is not modeled. To model pressure losses associated with the outlets, connect a Local Restriction (2P) block or a Flow Resistance (2P) block to the ports of the Receiver-Accumulator (2P) block.

• A liquid-vapor mixture is not modeled.

Ports

Output

expand all

Liquid level in the tank. Use this port to monitor the amount of liquid remaining inside.

Conserving

expand all

Opening for the fluid to flow into or out of the tank. Both liquid and vapor can enter through this port. However, only vapor can exit through it—until the tank is depleted of vapor, in which event liquid too can flow out through this port.

Opening for the fluid to flow into or out of the tank. Both liquid and vapor can enter through this port. However, only vapor can exit through it—until the tank is depleted of vapor, in which event liquid too can flow out through this port.

Opening for the fluid to flow into or out of the tank. Both liquid and vapor can enter through this port. However, only liquid can exit through it—until the tank is depleted of liquid, in which event vapor too can flow out through this port.

Opening for the fluid to flow into or out of the tank. Both liquid and vapor can enter through this port. However, only liquid can exit through it—until the tank is depleted of liquid, in which event vapor too can flow out through this port.

Thermal boundary between the fluid volume and the tank wall. Use this port to capture heat exchanges of various kinds—for example, conductive, convective, or radiative—between the fluid and the environment external to the tank.

Parameters

expand all

Main

Aggregate volume of liquid and vapor phases in the tank.

Area normal to the direction of flow at port AV.

Area normal to the direction of flow at port BV.

Area normal to the direction of flow at port AL.

Area normal to the direction of flow at port BL.

Means by which to handle unusual volume fractions. Select `Warning` to be notified when the volume fraction crosses a specified range. Select `Error` to stop simulation at such events.

Lower bound of the valid range for the liquid volume fraction in the tank. Fractions below this value will trigger a simulation warning or error (depending on the setting of the Liquid volume fraction out of range block parameter.

Dependencies

This parameter is active when the Liquid volume fraction out of range block parameter is set to `Warning` or `Error`.

Upper bound of the valid range for the liquid volume fraction in the tank. Fractions above this value will trigger a simulation warning or error (depending on the setting of the Liquid volume fraction out of range block parameter.

Dependencies

This parameter is active when the Liquid volume fraction out of range block parameter is set to `Warning` or `Error`.

Volume fraction of either phase below which to transition to a single-phase tank—either subcooled liquid or superheated vapor. This parameter determines how smooth the transition is. The larger its value, the smoother the transition and therefore the faster the simulation (though at the cost of lower accuracy).

Heat Transfer

Coefficient for heat exchange between the vapor zone and its section of the tank wall. This parameter serves to calculate the rate of this heat exchange.

Coefficient for heat exchange between the liquid zone and its section of the tank wall. This parameter serves to calculate the rate of this heat exchange.

Surface area of the tank through which heat exchange with the fluid occurs.

Effects and Initial Conditions Tab

Thermodynamic variable in terms of which to define the initial conditions of the component.

Pressure in the tank at the start of simulation, specified against absolute zero.

Temperature in the tank at the start of simulation, specified against absolute zero.

Dependencies

This parameter is active when the Initial fluid energy specification option is set to `Temperature`.

Mass fraction of liquid in the tank at the start of simulation.

Dependencies

This parameter is active when the Initial fluid energy specification option is set to ```Liquid mass fraction```.

Volume fraction of liquid in the tank at the start of simulation.

Dependencies

This parameter is active when the Initial fluid energy specification option is set to ```Liquid volume fraction```.

Specific enthalpy of the fluid in the tank at the start of simulation.

Dependencies

This parameter is active when the Initial fluid energy specification option is set to ```Specific enthalpy```.

Specific internal energy of the fluid in the tank at the start of simulation.

Dependencies

This parameter is active when the Initial fluid energy specification option is set to ```Specific internal energy```.

Characteristic time to equilibrium of a phase-change event taking place in the tank. Increase this parameter to slow the rate of phase change or decrease it to speed up the rate.

Extended Capabilities

C/C++ Code GenerationGenerate C and C++ code using Simulink® Coder™.

Introduced in R2018b

Get trial now