Contenu principal

Tank (IL)

R2026b

Tank in an isothermal liquid system

  • Tank (IL) block

Libraries:
Simscape / Fluids / Isothermal Liquid / Tanks & Accumulators

Description

The Tank (IL) block models a container with up to six input ports, A through F, within an isothermal liquid system. The tank outputs fluid volume at port V and fluid level at port L as physical signals. The block models the hydrostatic pressure difference between the liquid surface and the inlet height level. The tank can be pressurized to a constant, user-specified value or to atmospheric pressure.

Fluid Volume

The volume of fluid in the tank is determined from the total mass flow into the tank:

V=Mρ,

where:

  • M is the total mass in the tank supplied by all ports.

  • ρ is the fluid density.

Due to the constant pressure in the tank, the liquid volume inside the tank changes based on mass flow rate. Note that the converse is true for pipes, where pressure is a function of fixed fluid volumes.

If the tank fluid volume exceeds the specified capacity of the tank, you can choose to be notified. Set the Liquid volume above max capacity parameter to Warning if you would like to receive a warning when this occurs during simulation. Set the parameter to Error if you would like the simulation to stop when this occurs.

Fluid Level

If Tank volume parameterization is set to Constant cross-section area, the fluid level in the tank is determined from the fluid volume V, due to the constant cross-sectional area of the tank. Otherwise, the fluid level can be specified as tabulated data in the Tabulated data - volume vs. level option.

When the level in the tank falls below the inlet height, the assumption that fluid entirely fills the volume of the connecting blocks may not be valid. Connections to a Pipe (IL) block, which is based on this assumption, may in this case return unphysical results. If you expect to model tank fluid levels below tank inlet height(s), connect the Tank (IL) block to your system with a Partially Filled Pipe (IL) block instead.

Like the Liquid volume above max capacity parameter, you can be notified if the tank fluid level falls below the height of the inlet port(s) during your simulation by changing the Liquid level below inlet height parameter setting.

Mass Flow Rate

If you set Number of inlets to a number greater than 1, the equations below apply to each port. The dynamic pressure for an inlet port, i, is

pi,dyn={12ρivi2,if m˙i<00,if m˙i0

where:

  • ρi is the fluid density.

  • vi is the flow velocity.

  • m˙i is the mass flow rate into the tank fluid volume through the port.

The total pressure is

ptotal=P+pdyn+Δpelev,port,

where:

  • P is the value of the Tank pressurization parameter if the Pressurization specification parameter is Specified pressure. Otherwise, P is the atmospheric pressure.

  • Δpelev,port is the hydrostatic pressure difference at the specified port Inlet height: Δpelev,port=ρgL, where L is either the difference in height between the fluid level and the inlet height or zero, whichever is larger.

Variables

To set the priority and initial target values for the block variables prior to simulation, use the Initial Targets section in the block dialog box or Property Inspector. For more information, see Set Priority and Initial Target for Block Variables.

Nominal values provide a way to specify the expected magnitude of a variable in a model. Using system scaling based on nominal values increases the simulation robustness. Nominal values can come from different sources, one of which is the Nominal Values section in the block dialog box or Property Inspector. For more information, see Modify Nominal Values for a Block Variable.

Examples

Assumptions and Limitations

  • When you set the Pressurization specification parameter to Variable pressure, the block assumes that variation in pressure occurs slowly and there is no pressure derivative in the mass and energy balance equations.

Ports

Conserving

expand all

Tank inlet.

Programmatic Use

Port: A

Optional tank inlet.

Dependencies

To enable this port, set Number of inlets to 2, 3, 4, 5, or 6.

Programmatic Use

Port: B

Optional tank inlet.

Dependencies

To enable this port, set Number of inlets to 3, 4, 5, or 6.

Programmatic Use

Port: C

Optional tank inlet.

Dependencies

To enable this port, set Number of inlets to 4, 5, or 6.

Programmatic Use

Port: D

Optional tank inlet.

Dependencies

To enable this port, set Number of inlets to 5 or 6.

Programmatic Use

Port: E

Optional tank inlet.

Dependencies

To enable this port, set Number of inlets to 6.

Programmatic Use

Port: F

Input

expand all

Tank pressure, specified as a physical signal input, in MPa.

Dependencies

To enable this port, set Pressurization specification to Variable pressure.

Programmatic Use

Port: P

Output

expand all

Liquid volume inside the tank in m^3, specified as a physical signal.

Programmatic Use

Port: V

Liquid level inside the tank in m, specified as a physical signal.

Programmatic Use

Port: L

Parameters

expand all

Number of inlet ports. Setting this parameter to 2 or more exposes additional input ports.

Programmatic Use

Parameter: num_inlet
Values: "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.One" | "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.Two" | "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.Three" | "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.Four" | "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.Five" | "fluids.isothermal_liquid.tanks_accumulators.enum.NumInlet.Six"

Method to specify the tank pressure. To define a non-atmospheric constant pressure, set this parameter to Specified pressure and specify the value with the Tank pressurization parameter. To specify a variable tank pressure, set this parameter to Variable pressure and supply the tank pressure as a physical signal at port P.

Programmatic Use

Parameter: pressure_spec
Values: "fluids.isothermal_liquid.tanks_accumulators.enum.TankPressureSpec.Atmospheric" | "fluids.isothermal_liquid.tanks_accumulators.enum.TankPressureSpec.Variable" | "fluids.isothermal_liquid.tanks_accumulators.enum.TankPressureSpec.Specified"

User-defined tank pressure.

Dependencies

To enable this parameter, set Pressurization specification to Specified pressure.

Programmatic Use

Parameter: tank_pressure

Specifies tank area characteristics. This parameter is used to determine the fluid level in the tank. If you would like to model a tank with a variable cross-sectional area, you can provide data for tank volume and fluid level with the Tabulated data - volume vs. level option.

Programmatic Use

Parameter: volume_spec
Values: "fluids.isothermal_liquid.tanks_accumulators.enum.TankVolumeSpec.Constant" | "fluids.isothermal_liquid.tanks_accumulators.enum.TankVolumeSpec.Table"

Tank cross-sectional area.

Dependencies

To enable this parameter, set Tank volume parameterization to Constant cross-section area.

Programmatic Use

Parameter: tank_area

Vector of tank fluid levels for the tabular parameterization of a non-constant tank area. The values in this vector correspond one-to-one to values in the Volumetric flow rate vector parameter. Its elements are listed in ascending order. The elements must be positive and the first element must be 0.

Dependencies

To enable this parameter, set Tank volume parameterization to Tabulated data - volume vs. level.

Programmatic Use

Parameter: level_TLU

Vector of tank fluid volumes for the tabular parameterization of a non-constant tank area. The values in this vector correspond one-to-one to values in the Liquid level vector parameter. Its elements are listed in ascending order. The elements must be positive and the first element must be 0.

Dependencies

To enable this parameter, set Tank volume parameterization to Tabulated data - volume vs. level.

Programmatic Use

Parameter: volume_TLU

Height of inlet port. The value must be greater than or equal to 0.

Dependencies

To enable this parameter, set Number of inlets to 1.

Programmatic Use

Parameter: inlet_height_A

Cross-sectional area of the port inlet. This value must be greater than 0.

Programmatic Use

Parameter: inlet_area_A

Vector of port heights for multiple enabled ports. If you have two or more ports enabled, the Inlet height parameter becomes a vector of values that correspond to the height of each inlet port, starting with port A. The parameter name and vector length depend on the value of the Number of inlets parameter. The default height for each inlet is .1 m. Each element of this vector must be greater than or equal to 0.

Dependencies

To enable this parameter, set Number of inlets to 2, 3, 4, 5, or 6.

Programmatic Use

Parameter: inlet_height_AB

Parameter: inlet_height_ABC

Parameter: inlet_height_ABCD

Parameter: inlet_height_ABCDE

Parameter: inlet_height_ABCDEF

Vector of cross-sectional areas for multiple enabled ports. If you have two or more ports enabled, the Inlet cross-sectional area parameter becomes a vector of values that correspond to the cross-sectional area of each inlet, starting with port A. The parameter name will include all enabled ports. Each element of this vector must be greater than 0.

Dependencies

To enable this parameter, set Number of inlets to 2, 3, 4, 5, or 6.

Programmatic Use

Parameter: inlet_area_AB

Parameter: inlet_area_ABC

Parameter: inlet_area_ABCD

Parameter: inlet_area_ABCDE

Parameter: inlet_area_ABCDEF

Whether to be notified if the tank fluid level falls below the port inlet height during simulation. Set this parameter to Warning if you would like to receive a warning when this occurs during simulation. Set the parameter to Error if you would like the simulation to stop when this occurs.

Programmatic Use

Parameter: level_check
Values: "simscape.enum.assert.action.error" | "simscape.enum.assert.action.none" | "simscape.enum.assert.action.warn"

Whether to be notified if the tank fluid volume rises above the tank maximum capacity during simulation. Set this parameter to Warning if you would like to receive a warning when this occurs during simulation. Set the parameter to Error if you would like the simulation to stop when this occurs.

Programmatic Use

Parameter: capacity_check
Values: "simscape.enum.assert.action.none" | "simscape.enum.assert.action.warn" | "simscape.enum.assert.action.error"

Fill limit of the tank.

Dependencies

To enable this parameter, set Liquid volume above max capacity to either:

  • Warning

  • Error

Programmatic Use

Parameter: max_capacity

Constant for the acceleration of gravity.

Programmatic Use

Parameter: g

Extended Capabilities

expand all

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

Version History

Introduced in R2020a

expand all