Skip to content

Tank

Represents a Tank unit operation that models a storage vessel for material accumulation. In dynamic mode, the tank tracks liquid inventory over time, integrating inlet and outlet mass flows to update the accumulated content. In steady-state mode, the tank passes the inlet stream through to the outlet, applying an optional pressure drop.

DWSIM.UnitOperations.UnitOperations.Tank
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Tank

At a glance

Tank in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Decane-in
Outlet, material 0 Decane-out

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("TankExample")
      .WithCompound("N-decane")
      .WithPropertyPackage(PropertyPackages.PengRobinson))

feed = (fs.AddMaterialStream("Decane-in")
        .At(Q.Celsius(30.0), Q.Bar(2.0))
        .WithMassFlow(Q.KgPerSecond(2.0)))
product = fs.AddMaterialStream("Decane-out")

tank = (fs.AddTank("TK-1")
        .WithVolume(Q.CubicMeters(50.0))
        .ConnectFeed(feed)
        .ConnectProduct(product))
tank.Object.DeltaP = 20000.0                 # Pa, static pressure loss across the tank

fs.AutoLayout()
fs.Solve()

q = feed.Object.Phases[0].Properties.volumetric_flow     # m3/s
print(f"Liquid density  = {feed.Object.Phases[0].Properties.density:.1f} kg/m3")
print(f"Volumetric flow = {q * 3600.0:.2f} m3/h")
print(f"Residence time  = {tank.Object.ResidenceTime / 3600.0:.2f} h (V/Q = {50.0 / q / 3600.0:.2f} h)")
print(f"Outlet P        = {product.Object.Phases[0].Properties.pressure / 1e5:.2f} bar")
print(f"Outlet T        = {product.TemperatureK - 273.15:.2f} C")

Output

Liquid density  = 725.2 kg/m3
Volumetric flow = 9.93 m3/h
Residence time  = 5.04 h (V/Q = 5.04 h)
Outlet P        = 1.80 bar
Outlet T        = 30.01 C

DWSIM 10.2.11.0, generated 2026-10-08.

Properties

IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.

ID Name Unit (SI) Input
PROP_TK_0 Pressure Drop Pa yes
PROP_TK_1 Volume m3 yes
PROP_TK_2 Residence Time s result

Dynamic mode

Extra properties used when the flowsheet runs in dynamic mode.

Name Unit
Liquid Level m
Height m
Initialize using Inlet Stream
Reset Content
Closed Tank
Ambient Temperature K
Ambient UA Product
Operating Pressure Pa
Minimum Pressure Pa

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

Tank(): Initializes a new default instance of the Tank class.

Initializes a new default instance of the Tank class.

public Tank()
Public Sub New()

Tank(string, string): Initializes a new instance of the Tank class with a name and description.

Initializes a new instance of the Tank class with a name and description.

Parameter Type Description
name String The component name assigned to this tank object.
description String A short description of this tank object.
public Tank(string name, string description)
Public Sub New(name As String, description As String)

Properties

DeltaP: Gets or sets the pressure drop across the tank (Pa).

Gets or sets the pressure drop across the tank (Pa).

public double? DeltaP { get; set; }
Public Property DeltaP As Double?

DeltaQ: Gets or sets the calculated heat duty exchanged by the tank (kW).

Gets or sets the calculated heat duty exchanged by the tank (kW).

public double? DeltaQ { get; set; }
Public Property DeltaQ As Double?

EquipmentTypes: Gets the list of equipment orientation types supported by the tank (vertical, horizontal).

Gets the list of equipment orientation types supported by the tank (vertical, horizontal).

public override List<string> EquipmentTypes { get; }
Public Overrides ReadOnly Property EquipmentTypes As List(Of String)

HasPropertiesForDynamicMode: Gets a value indicating that this unit operation exposes properties for dynamic mode configuration.

Gets a value indicating that this unit operation exposes properties for dynamic mode configuration.

public override bool HasPropertiesForDynamicMode { get; }
Public Overrides ReadOnly Property HasPropertiesForDynamicMode As Boolean

IgnorePhase: Gets or sets a value indicating whether the presence of a vapour phase in the inlet stream should be ignored during...

Gets or sets a value indicating whether the presence of a vapour phase in the inlet stream should be ignored during steady-state calculation. When False, a vapour phase will raise an error.

public bool IgnorePhase { get; set; }
Public Property IgnorePhase As Boolean

MobileCompatible: Gets a value indicating whether this unit operation is compatible with mobile interfaces.

Gets a value indicating whether this unit operation is compatible with mobile interfaces.

public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

ObjectClass: Gets or sets the simulation object class, categorized as a Separator.

Gets or sets the simulation object class, categorized as a Separator.

public override SimulationObjectClass ObjectClass { get; set; }
Public Overrides Property ObjectClass As SimulationObjectClass

ResidenceTime: Gets or sets the calculated liquid residence time (s) based on volume and throughput.

Gets or sets the calculated liquid residence time (s) based on volume and throughput.

public double ResidenceTime { get; set; }
Public Property ResidenceTime As Double

SupportsDynamicMode: Gets a value indicating that this unit operation supports dynamic (time-stepping) mode.

Gets a value indicating that this unit operation supports dynamic (time-stepping) mode.

public override bool SupportsDynamicMode { get; }
Public Overrides ReadOnly Property SupportsDynamicMode As Boolean

Volume: Gets or sets the tank total volume (m³).

Gets or sets the tank total volume (m³).

public double Volume { get; set; }
Public Property Volume As Double

Methods

Calculate(object): Calculates the tank (mixing) operation.

Calculates the tank (mixing) operation.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy of this tank by serializing and deserializing via XML.

Creates a deep copy of this tank by serializing and deserializing via XML.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes and disposes the editing form.

Closes and disposes the editing form.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

CreateDimensionsList(): Creates the list of physical dimensions associated with the tank (volume).

Creates the list of physical dimensions associated with the tank (volume).

public override void CreateDimensionsList()
Public Overrides Sub CreateDimensionsList()

CreateDynamicProperties(): Registers the dynamic properties exposed in dynamic simulation mode, such as liquid level, height, and...

Registers the dynamic properties exposed in dynamic simulation mode, such as liquid level, height, and initialisation options.

public override void CreateDynamicProperties()
Public Overrides Sub CreateDynamicProperties()

DeCalculate(): Clears all calculated results.

Clears all calculated results.

public override void DeCalculate()
Public Overrides Sub DeCalculate()

DisplayDynamicsEditForm(): Opens or activates the dynamics property editor form for this tank, including buttons to view the accumulation...

Opens or activates the dynamics property editor form for this tank, including buttons to view the accumulation stream and to fill the tank from the inlet stream.

public override void DisplayDynamicsEditForm()
Public Overrides Sub DisplayDynamicsEditForm()

DisplayEditForm(): Opens or activates the editing form.

Opens or activates the editing form.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

GetDisplayDescription(): Returns the localised display description.

Returns the localised display description.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the localised display name.

Returns the localised display name.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetEditingForm(): Returns the editing form instance.

Returns the editing form instance.

public override object GetEditingForm()
Public Overrides Function GetEditingForm() As Object

GetIconBitmapBytes(): Returns the icon bitmap as a byte array.

Returns the icon bitmap as a byte array.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

GetProperties(PropertyType): Returns an array of property identifiers for the specified property type.

Returns an array of property identifiers for the specified property type.

Parameter Type Description
proptype PropertyType
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.

Returns the unit string for the specified property.

Parameter Type Description
prop String
su IUnitsOfMeasure
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property.

Returns the value of the specified property.

Parameter Type Description
prop String
su IUnitsOfMeasure
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

RunDynamicModel(): Executes one dynamic simulation step for the tank: integrates inlet and outlet mass flows over the current time...

Executes one dynamic simulation step for the tank: integrates inlet and outlet mass flows over the current time step, updates the accumulation stream, and flashes the content to determine the new liquid level and outlet conditions.

public override void RunDynamicModel()
Public Overrides Sub RunDynamicModel()

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property.

Sets the value of the specified property.

Parameter Type Description
prop String
propval Object
su IUnitsOfMeasure
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

UpdateDimensionsList(): Updates the dimensions list values from the current tank properties (e.g., Volume).

Updates the dimensions list values from the current tank properties (e.g., Volume).

public override void UpdateDimensionsList()
Public Overrides Sub UpdateDimensionsList()

UpdateEditForm(): Refreshes the editing form with updated data.

Refreshes the editing form with updated data.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

Fields

f: The classic (WinForms) editor window open for this unit operation, if any.

The classic (WinForms) editor window open for this unit operation, if any. Not saved with the flowsheet.

public object f
Public f As Object