Pipe Heating Example
Drag-in Components | Define Fixed Heat Flow Parameters |
Define Tank Parameters | Connect and Simulate |
Define Boundary Parameters | Analyze |
Define Pipe Parameters |
In this part, filling of a tank using a pipe that heats the fluid flowing through it is modeled.
Model to determine the effect of heat addition on the fluid temperature.
Drag-in Components
Create a new model and drag the following components from the Modelica standard library:
- System: Used to define system properties and default values so that you do not need to define it for every component
- MassFlowSource_T: Used as a constant mass flow source
- DynamicPipe: Can store mass and energy
- FixedHeatFlow: Used as a heat source
Define Tank Parameters
height: Total height of the tank. By default, the initial level of fluid in the tank is set at 0.5 * height of the tank. You can keep the default or change it by going to the Initialization tab and changing the level_start parameter.
crossArea: Define cross-sectional area of the tank.
Medium (This parameter cannot be left blank.) Select a fluid from the drop-down menu, e.g. “Extension of the StandardWater package.”
Ports: This refers to the outlet of the tank to which other components can be connected.
nPorts: In this example, as you want to connect only to the ambient, set the nPorts to 1.
use_portsData: Set use_portsData to true.
portsData: Provide the portsData as a list, which means they need to be specified using curly braces {}. It takes a function as an argument. The function is Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(). You can open the function (type Modelica.Fluid.Vessels.BaseClasses.VesselPortsData in the search field in the Class Browser) and check the inputs:
You can define diameter, height and other parameters. For this example, set the port height to 1 m and diameter to 0.3 m. Use the defaults for zeta_out and zeta_in. The input to the portsData should look like this: {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=0.3,height=0)}
Define Boundary Parameters
nPorts: As the boundary is only connected to the pipe, set this value to 1.
Medium: Select a fluid from the drop-down menu, e.g. “Extension of the StandardWater package.”
m_flow: Provide a value for the mass flow rate.
Define Pipe Parameters
Medium (This parameter cannot be left blank.) Select a fluid from the drop-down menu, e.g. “Extension of the StandardWater package.”
Length: Total length of the pipe
isCircular: You can choose between circular and non-circular. If isCircular is set to false, then crossArea and perimeter parameters have to be defined. Note that it is assumed that the cross-sectional area is constant throughout the length.
Diameter: Diameter of the circular pipe
Roughness: Roughness of the inner pipe surface. This is a pipe material property, so common materials and their roughness values are listed below:
height_ab: Difference in height between the outlet (port_b) and inlet (port_a). Check the arrow direction of the pipe to determine inlet and outlet.
In the Assumptions tab, set use_HeatTransfer to true. Open the editor for HeatTransfer and set k to 1.
Define Fixed Heat Flow Parameters
Q_flow: Set a fixed heat flow rate.
Connect and Simulate
Provide a simulation time in the Experiment Setup and simulate:
Analyze
Plot the temperature and level of the tank. Temperature can be obtained from the heat transfer data: tank.heatTransfer.Ts[1]. Level can be obtained by plotting the level: tank.level.
The temperature of the fluid inside the tank increases from 20 °C to about 22 °C after 100 minutes.