WOLFRAM SYSTEM MODELER

OpenTank

Simple tank with inlet/outlet ports

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Fluid.Vessels.OpenTank"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Model of a tank that is open to the ambient at the fixed pressure p_ambient.

The vector of connectors ports represents fluid ports at configurable heights, relative to the bottom of tank. Fluid can flow either out of or in to each port.

The following assumptions are made:
  • The tank is filled with a single or multiple-substance medium having a density higher than the density of the ambient medium.
  • The fluid has uniform density, temperature and mass fractions
  • No liquid is leaving the tank through the open top; the simulation breaks with an assertion if the liquid level growths over the height.

The port pressures represent the pressures just after the outlet (or just before the inlet) in the attached pipe. The hydraulic resistances portsData.zeta_in and portsData.zeta_out determine the dissipative pressure drop between tank and port depending on the direction of mass flow. See VesselPortsData and [Idelchik, Handbook of Hydraulic Resistance, 2004].

With the setting use_portsData=false, the port pressure represents the static head at the height of the respective port. The relationship between pressure drop and mass flow rate at the port must then be provided by connected components; Heights of ports as well as kinetic and potential energy of fluid entering or leaving are not taken into account anymore.

Parameters (22)

energyDynamics

Value: system.energyDynamics

Type: Dynamics

Description: Formulation of energy balance

massDynamics

Value: system.massDynamics

Type: Dynamics

Description: Formulation of mass balance

substanceDynamics

Value: massDynamics

Type: Dynamics

Description: Formulation of substance balance

traceDynamics

Value: massDynamics

Type: Dynamics

Description: Formulation of trace substance balance

p_start

Value: p_ambient

Type: AbsolutePressure (Pa)

Description: Start value of pressure

use_T_start

Value: true

Type: Boolean

Description: = true, use T_start, otherwise h_start

T_start

Value: if use_T_start then system.T_start else Medium.temperature_phX(p_start, h_start, X_start)

Type: Temperature (K)

Description: Start value of temperature

h_start

Value: if use_T_start then Medium.specificEnthalpy_pTX(p_start, T_start, X_start) else Medium.h_default

Type: SpecificEnthalpy (J/kg)

Description: Start value of specific enthalpy

X_start

Value: Medium.X_default

Type: MassFraction[Medium.nX] (kg/kg)

Description: Start value of mass fractions m_i/m

C_start

Value: Medium.C_default

Type: ExtraProperty[Medium.nC]

Description: Start value of trace substances

nPorts

Value: 0

Type: Integer

Description: Number of ports

use_portsData

Value: true

Type: Boolean

Description: = false to neglect pressure loss and kinetic energy

portsData

Value:

Type: VesselPortsData[if use_portsData then nPorts else 0]

Description: Data of inlet/outlet ports

m_flow_nominal

Value: if system.use_eps_Re then system.m_flow_nominal else 1e2 * system.m_flow_small

Type: MassFlowRate (kg/s)

Description: Nominal value for mass flow rates in ports

m_flow_small

Value: if system.use_eps_Re then system.eps_m_flow * m_flow_nominal else system.m_flow_small

Type: MassFlowRate (kg/s)

Description: Regularization range at zero mass flow rate

use_Re

Value: system.use_eps_Re

Type: Boolean

Description: = true, if turbulent region is defined by Re, otherwise by m_flow_small

use_HeatTransfer

Value: false

Type: Boolean

Description: = true to use the HeatTransfer model

height

Value:

Type: Height (m)

Description: Height of tank

crossArea

Value:

Type: Area (m²)

Description: Area of tank

p_ambient

Value: system.p_ambient

Type: AbsolutePressure (Pa)

Description: Tank surface pressure

T_ambient

Value: system.T_ambient

Type: Temperature (K)

Description: Tank surface Temperature

level_start

Value: 0.5 * height

Type: Height (m)

Description: Start value of tank level

Inputs (2)

fluidVolume

Default Value: V

Type: Volume (m³)

Description: Volume

fluidLevel

Default Value: level

Type: Height (m)

Description: Level of fluid in the vessel for treating heights of ports

Connectors (12)

ports

Type: VesselFluidPorts_b[nPorts]

Description: Fluid inlets and outlets

heatPort

Type: HeatPort_a

Description: Thermal port for 1-dim. heat transfer (filled rectangular icon)

portsData_diameter_internal

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_height_internal

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_zeta_in_internal

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_zeta_out_internal

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_diameter

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_height

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_zeta_in

Type: RealInput[nPorts]

Description: 'input Real' as connector

portsData_zeta_out

Type: RealInput[nPorts]

Description: 'input Real' as connector

regularFlow

Type: BooleanInput[nPorts]

Description: 'input Boolean' as connector

inFlow

Type: BooleanInput[nPorts]

Description: 'input Boolean' as connector

Components (4)

system

Type: System

Description: System properties

medium

Type: BaseProperties

Description: Base properties (p, d, T, h, u, R_s, MM and, if applicable, X and Xi) of a medium

portsData

Type: VesselPortsData[if use_portsData then nPorts else 0]

Description: Data of inlet/outlet ports

heatTransfer

Type: HeatTransfer

Description: Wall heat transfer

Used in Examples (6)

HeatingSystem

Modelica.Fluid.Examples

Simple model of a heating system

ThreeTanks

Modelica.Fluid.Examples.Tanks

Demonstrating the usage of SimpleTank

TanksWithOverflow

Modelica.Fluid.Examples.Tanks

Two tanks connected with pipes at different heights

EmptyTanks

Modelica.Fluid.Examples.Tanks

Show the treatment of empty tanks

ControlledTanks

Modelica.Fluid.Examples.ControlledTankSystem

Demonstrating the controller of a tank filling/emptying system

MeasuringTemperature

Modelica.Fluid.Examples.Explanatory

Differences between using one port with and without explicit junction model and two port sensors for fluid temperature measuring

Revisions

  • Dec. 12, 2008 by Rüdiger Franke: move port definitions to BaseClasses.PartialLumpedVessel; also use energy and mass balance from common base class
  • Dec. 8, 2008 by Michael Wetter (LBNL):
    Implemented trace substances.
  • Jan. 6, 2006 by Katja Poschlad, Manuel Remelhe (AST Uni Dortmund), Martin Otter (DLR):
    Implementation based on former tank model.
  • Oct. 29, 2007 by Carsten Heinrich (ILK Dresden):
    Adapted to the new fluid library interfaces:
    • FluidPorts_b is used instead of FluidPort_b (due to it is defined as an array of ports)
    • Port name changed from port to ports
    Updated documentation.
  • Apr. 25, 2006 by Katrin Prölß (TUHH):
    Limitation to bottom ports only, added inlet and outlet loss factors.