modelPartialLumpedVessel
Extends from Modelica.Fluid.Interfaces.PartialLumpedVolume (Lumped volume with mass and energy balance).
Information
This base class extends PartialLumpedVolume with a vector of fluid ports and a replaceable wall HeatTransfer model.
The following modeling assumption are made:
- homogeneous medium, i.e., phase separation is not taken into account,
- no kinetic energy in the fluid, i.e., kinetic energy dissipates into the internal energy,
- pressure loss definitions at vessel ports assume incompressible fluid,
- outflow of ambient media is prevented at each port assuming check valve behavior.
If
fluidlevel < portsData_height[i]andports[i].p < vessel_ps_static[i]mass flow at the port is set to 0.
Each port has a (hydraulic) diameter and a height above the bottom of the vessel, which can be configured using the portsData record.
Alternatively the impact of port geometries can be neglected with use_portsData=false. This might be useful for early
design studies. Note that this means to assume an infinite port diameter at the bottom of the vessel.
Pressure drops and heights of the ports as well as kinetic and potential energy fluid entering or leaving the vessel are neglected then.
The following variables need to be defined by an extending model:
input fluidVolume, the volume of the fluid in the vessel,vessel_ps_static[nPorts], the static pressures inside the vessel at the height of the corresponding ports, at zero flow velocity, andWb_flow, work term of the energy balance, e.g., p*der(V) if the volume is not constant or stirrer power.
An extending model should define:
parameter vesselArea(default: Modelica.Constants.inf m2), the area of the vessel, to be related to cross flow areas of the ports for the consideration of dynamic pressure effects.
Optionally the fluid level may vary in the vessel, which effects the flow through the ports at configurable portsData_height[nPorts].
This is why an extending model with varying fluid level needs to define:
input fluidLevel (default: 0m), the level the fluid in the vessel, andparameter fluidLevel_max (default: 1m), the maximum level that must not be exceeded. Ports at or above fluidLevel_max can only receive inflow.
An extending model should not access the portsData record defined in the configuration dialog,
as an access to portsData may fail for use_portsData=false or nPorts=0.
Instead the predefined variables
portsData_diameter[nPorts],portsData_height[nPorts],portsData_zeta_in[nPorts], andportsData_zeta_out[nPorts]
should be used if these values are needed.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.ReynoldsNumber | Re_turbulent | 100 | cf. suddenExpansion |
| Assumptions › Dynamics | |||
| Types.Dynamics | energyDynamics (from PartialLumpedVolume) | system.energyDynamics | Formulation of energy balance |
| Types.Dynamics | massDynamics (from PartialLumpedVolume) | system.massDynamics | Formulation of mass balance |
| Types.Dynamics | substanceDynamics (from PartialLumpedVolume) | massDynamics | Formulation of substance balance |
| Types.Dynamics | traceDynamics (from PartialLumpedVolume) | massDynamics | Formulation of trace substance balance |
| Initialization | |||
| Medium.AbsolutePressure | p_start (from PartialLumpedVolume) | system.p_start | Start value of pressure |
| Boolean | use_T_start (from PartialLumpedVolume) | true | = true, use T_start, otherwise h_start |
| Medium.Temperature | T_start (from PartialLumpedVolume) | if use_T_start then system.T_start else Medium.temperature_phX(p_start, h_start, X_start) | Start value of temperature |
| Medium.SpecificEnthalpy | h_start (from PartialLumpedVolume) | if use_T_start then Medium.specificEnthalpy_pTX(p_start, T_start, X_start) else Medium.h_default | Start value of specific enthalpy |
| Medium.MassFraction[Medium.nX] | X_start (from PartialLumpedVolume) | Medium.X_default | Start value of mass fractions m_i/m |
| Medium.ExtraProperty[Medium.nC] | C_start (from PartialLumpedVolume) | Medium.C_default | Start value of trace substances |
| General › Ports | |||
| Integer | nPorts | 0 | Number of ports |
| Boolean | use_portsData | true | = false to neglect pressure loss and kinetic energy |
| Modelica.Fluid.Vessels.BaseClasses.VesselPortsData | portsData | Data of inlet/outlet ports | |
| Advanced › Port properties | |||
| Medium.MassFlowRate | m_flow_nominal | if system.use_eps_Re then system.m_flow_nominal else 1e2*system.m_flow_small | Nominal value for mass flow rates in ports |
| SI.MassFlowRate | m_flow_small | if system.use_eps_Re then system.eps_m_flow*m_flow_nominal else system.m_flow_small | Regularization range at zero mass flow rate |
| Boolean | use_Re | system.use_eps_Re | = true, if turbulent region is defined by Re, otherwise by m_flow_small |
| Assumptions › Heat transfer | |||
| Boolean | use_HeatTransfer | false | = true to use the HeatTransfer model |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| VesselFluidPorts_b[nPorts] | ports | Fluid inlets and outlets | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a | heatPort |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.System | system (from PartialLumpedVolume) | System properties | |
| SI.Volume | fluidVolume (from PartialLumpedVolume) | Volume | |
| Medium.BaseProperties | medium (from PartialLumpedVolume) | ||
| SI.Energy | U (from PartialLumpedVolume) | Internal energy of fluid | |
| SI.Mass | m (from PartialLumpedVolume) | Mass of fluid | |
| SI.Mass | mXi (from PartialLumpedVolume) | Masses of independent components in the fluid | |
| SI.Mass | mC (from PartialLumpedVolume) | Masses of trace substances in the fluid | |
| Medium.ExtraProperty[Medium.nC] | C (from PartialLumpedVolume) | Trace substance mixture content | |
| SI.MassFlowRate | mb_flow (from PartialLumpedVolume) | Mass flows across boundaries | |
| SI.MassFlowRate | mbXi_flow (from PartialLumpedVolume) | Substance mass flows across boundaries | |
| Medium.ExtraPropertyFlowRate | mbC_flow (from PartialLumpedVolume) | Trace substance mass flows across boundaries | |
| SI.EnthalpyFlowRate | Hb_flow (from PartialLumpedVolume) | Enthalpy flow across boundaries or energy source/sink | |
| SI.HeatFlowRate | Qb_flow (from PartialLumpedVolume) | Heat flow across boundaries or energy source/sink | |
| SI.Power | Wb_flow (from PartialLumpedVolume) | Work flow across boundaries or source term | |
| Medium.EnthalpyFlowRate[nPorts] | ports_H_flow | ||
| Medium.MassFlowRate[nPorts,Medium.nXi] | ports_mXi_flow | ||
| Medium.MassFlowRate | sum_ports_mXi_flow | Substance mass flows through ports | |
| Medium.ExtraPropertyFlowRate[nPorts,Medium.nC] | ports_mC_flow | ||
| Medium.ExtraPropertyFlowRate | sum_ports_mC_flow | Trace substance mass flows through ports | |
| HeatTransfer | heatTransfer | ||
| Medium.Density | portInDensities | Densities of the fluid at the device boundary | |
| SI.Velocity | portVelocities | Velocities of fluid flow at device boundary | |
| SI.EnergyFlowRate | ports_E_flow | Flow of kinetic and potential energy at device boundary | |
| Real | s | Curve parameters for port flows vs. port pressures; for further details see, Modelica Tutorial: Ideal switching devices | |
| Real | ports_penetration | Penetration of port with fluid, depending on fluid level and port diameter | |
| SI.Area | portAreas | {Modelica.Constants.pi/4*portsData_diameter[i]^2 for i in 1:nPorts} | |
| Medium.AbsolutePressure | vessel_ps_static | Static pressures inside the vessel at the height of the corresponding ports, zero flow velocity | |
| SI.MassFlowRate | m_flow_turbulent |
Contents
| Name | Description |
|---|---|
Revisions
- Jan. 2009 by Rüdiger Franke: extended with
- portsData record and threat configurable port heights,
- consideration of kinetic and potential energy of fluid entering or leaving in energy balance
- Dec. 2008 by Rüdiger Franke: derived from OpenTank, in order to make general use of configurable port diameters