Professional Documents
Culture Documents
1. Introduction
This workshop teaches skills in the use of multiphase modeling, transient flow modeling, generating
images, and preparing animations.
• Using Solution Controls to modify the problem definition (turn off the valve)
2. Prerequisites
This tutorial assumes that you are already familiar with the ANSYS Workbench interface and its project
workflow. This tutorial also assumes that you have completed the first workshop and that you are famil-
iar with the ANSYS Fluent tree and ribbon structure. Some steps in the setup and solution procedure
will not be shown explicitly.
3. Problem Description
In this workshop, you will model the filling and emptying of a water tank. The transient problem is
solved as a multiphase (air/water) simulation, using the volume of fluid (VOF) multiphase model.
An initial water level is set in the tank. The water supply is turned on for the first second of the simulation
and then shut off for the rest of the simulation. The water level rises until water flows out the U-tube,
generating a siphoning effect, which effectively empties the tank.
Note
This workshop shows how to set up the simulation in standalone Fluent. You can also
set up the simulation in Workbench as shown in the other workshops.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
Tank Flushing
5. Ensure that Display Mesh After Reading is enabled under Display Options.
Note
IF HPC licenses are available, you can select Parallel under Processing Options and
enter the number of processes.
a. In the Scale Mesh dialog box, select cm from the Mesh Was Created In drop-down list.
c. Click Scale.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Note
Ensure that the minimum volume is not negative as ANSYS Fluent cannot begin a calcu-
lation when this is the case.
a. In the Views dialog box, select front from the list of Views.
b. Click Apply.
c. Click Auto Scale and then close the Views dialog box.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Tank Flushing
Note
The view can also be oriented by clicking on the +Z axis on the triad, in the lower right
corner of the graphics window. Then click the Fit to Window icon in the graphics
toolbar.
1. In the Solver group of the Setting Up Physics ribbon tab, select Transient from the Time group.
a. In the Viscous Model dialog box, select k-epsilon from the Model list.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
c. Retain the other default settings, and click OK to accept the model and close the Viscous Model
dialog box.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Tank Flushing
a. In the Multiphase Model dialog box, select Volume of Fluid from the Model list.
c. Ensure that Explicit is selected from the Formulation group box under Volume Fraction Parameters.
d. In the Interface Modeling group box, ensure that the Type is set to Sharp.
Note
e. Enable Implicit Body Force from the Body Force Formulation group box.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
a. In the Phases dialog box, select phase-1 - Primary Phase and click Edit....
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Tank Flushing
i. In the Primary Phase dialog box, select water-liquid from the Phase Material drop-down list.
iii. Click OK to set and close the Primary Phase dialog box.
b. In the Phases dialog box, select phase-2 - Secondary Phase and click Edit....
ii. Ensure that air is selected from the Phase Material drop-down list.
iii. Click OK to set and close the Secondary Phase dialog box.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
i. In the Phase Interaction dialog box, click the Surface Tension tab.
ii. In the Surface Tension tab, enable Surface Tension Force Modeling.
iii. Select constant under the Surface Tension Coefficients (n/m) drop-down list.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Tank Flushing
Note
The operating density should be set to the density of the lightest fluid in the domain
when using the VOF model, or else an erroneous hydrostatic pressure distribution
will occur.
a. Set the boundary condition for the inlet mixture phase from the tree.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
i. In the Mass-Flow Inlet dialog box, select Normal to Boundary from the Direction Specification
Method drop down list.
ii. In the Turbulence group, from the Specification Method drop-down list, select Intensity and
Hydraulic Diameter.
b. Set the boundary condition for the inlet water phase, from the tree.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Tank Flushing
i. In the Mass-Flow Inlet dialog box, retain the selection of Mass Flow Rate from the Mass Flow
Specification Method drop down list.
c. Similarly, set the Mass Flow Rate for inlet air phase to 0.
d. Set the boundary condition for the outlet mixture phase from the tree.
i. In the Turbulence group, from the Specification Method drop-down list, select Intensity and
Hydraulic Diameter.
e. Set the boundary condition for the outlet air phase from the tree.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
i. In the Copy Conditions dialog box, retain the selection of outlet from the From Boundary
Zone list.
Note
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Tank Flushing
vi. Ensure that ambient is selected from the To Boundary Zones list, and click Copy.
Note
The Copy Conditions dialog box is a quick way of transferring common settings
from one boundary to another. To Boundary Zones automatically displays
boundaries of the same type as the From Boundary Zone selection.
4.4. Solving
In the steps that follow, you will set up and run the calculation using the Solving ribbon tab.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
a. In the Solution Methods task page, select PISO from the Scheme drop-down list in the Pressure-
Velocity Coupling group.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Tank Flushing
a. In the Solution Controls task page, enter 0.3 for Momentum in the Under-Relaxation Factors
group.
b. Enter 0.5 for Turbulent Kinetic Energy and Turbulent Dissipation Rate.
3. Initialize the flow field using the Initialization group of the Solving ribbon tab.
Note
Initially, the tank is filled to a level of 6 cm with water. Here you will first initialize the
flow solution, then create an adaption register and use the register to define the initial
location of the liquid surface.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
a. In the Solution Initialization task page, retain the default selection of Standard from the Initializ-
ation Methods group box.
d. Click Initialize.
Note
This will instruct the solver to fill the tank with air. The next step is to partially fill the
tank with water, resulting in the proper initial condition.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Tank Flushing
a. In the Region Adaption dialog box, enter -2.8 and 30 for X min (cm) and X Max (cm), respectively,
in the group of Input Coordinates.
d. Click Mark.
Note
A message appears in the Fluent console informing you that 3716 cells have been
marked.
i. In the Manage Adaption Registers dialog box, select hexahedron-r0 from the list of Registers.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
A. In the Adaption Display Options dialog box, enable Draw Mesh and Filled under Options.
C. Click OK.
The marked cells will be displayed in the graphics window, showing the liquid distribution
at time = 0.
Note
You may need to zoom in (use the Fit to Window icon ) because the
mesh was scaled since it was first displayed.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Tank Flushing
iv. Close the Manage Adaption Registers and the Mesh Display dialog box.
a. In the Patch dialog box, select air from the Phase drop-down list.
Note
The specialized Volume Fraction Patch Options are not necessary for this problem.
a. To add a new graphics window to display the contours, right-click the existing tab at the top of the
graphics window and select New Window.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
c. Select Phases... and Volume Fraction from the Contours of drop-down lists.
Note
f. Click Display.
c. Click Apply.
e. Disable lighting.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Tank Flushing
In this step you will define activities that Fluent will perform during the calculation. These activities
are as follows:
• To turn off the supply of water after t = 1 second. (Mass flow rate boundary condition will be
changed to zero).
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
i. In the Autosave dialog box, enter 25 for Save Data File Every (Time Steps).
Note
The File Name entry only appears in standalone Fluent. If you are using
Workbench, it uses its own internal naming convention.
iii. Retain the selection of time-step from the Append File Name with drop-down list.
Note
Including .gz in the file name tells Fluent to compress the data files produced
by Autosave. The time-step will be appended to the file name such that the
resulting names will be tankflush-0025.dat.gz, tankflush-
0050.dat.gz, and so on.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Tank Flushing
iv. Select Time Step from the When drop-down list for command-1.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
A. In the Animation Sequence dialog box, enter 2 for Window and click Set next to it.
I. In the Contours dialog box that opens, ensure that Filled is enabled.
II. Ensure that Phases... and Volume Fraction are selected from the Contours of drop-
down lists.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Tank Flushing
a. In the Residual Monitors dialog box, enter 100 for Iterations to Plot.
Note
This will make the residuals scroll across the plot, making it easier to see the current
time step.
11. Save the case and data files to your working folder (tank-flush-init.cas/dat.gz).
Note
For multiphase problems, saving files with the initial condition is good practice because
if something goes wrong and you need to restart, you can skip the patching step and
just reload the initial data file.
a. In the Run Calculation task page, enter 0.01 for Time Step Size (s).
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
c. Click Calculate.
Note
Do not click on any option in the Calculate dialog box that appears.
a. In the Playback dialog box, click the play button to review the animation.
b. You can select MPEG from the Write/Record drop-down list and click Write to save the animation.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Tank Flushing
The Animation Playback tool can also be used to generate a sequence of picture frames.
Note
If you are running Fluent in Workbench, the .mpeg file from the animation sequence
is written in the Workbench project directory.
a. To locate the file in Workbench, select Files in the Workbench View menu.
View → Files
d. The folder which opens shows the file sequence-1.mpeg. The .mpeg file can be
played in Windows Media Player or similar programs.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
Further Improvements
2. Exit Fluent.
5. Summary
In this workshop you were interested in how long it would take to completely empty the tank. This
workshop has shown the basic steps that are applied in VOF simulations, which are:
• Running a transient simulation while writing intermediate data files and animation data.
6. Further Improvements
There are many ways the simulation in this tutorial could be extended. You will first reload the saved
initial case and data files.
– In the Run Calculation task page, select Variable from Time Stepping Method. This will ensure that the
Time Step Size corresponds to a predetermined value for the Global Courant Number in the region of
the phase interface. (Click Settings... under Time Stepping Method. )
Note
Courant number of 2 means that the phase interface is passing only two cells per time
step.
• If HPC licenses are available, try running the calculation using different numbers of parallel processes and
compare the solution time.
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.