Transcript Workshop 6 Tank Flushing
Workshop 7 Tank Flushing
Introduction to CFX
Pardad Petrodanesh.Co
Lecturer: Ehsan Saadati [email protected]
www.petrodanesh.ir
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-1 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Introduction
Workshop Supplement
This workshop models a water tank filling and then emptying through a siphon. The problem is transient in nature and solved as a two fluid multiphase case (air + water).
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.
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-2 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Mesh Import
Workshop Supplement
1.
Start Workbench, add a
CFX Component System
, then edit the
Setup
to start CFX-Pre 2.
Right-click on
Mesh
>
Import Mesh >ICEM CFD
3.
Set the
Mesh Units
• to
cm
For some mesh formats it is important to know the units used to generate the mesh 4.
Import the mesh
flush.cfx5
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-3 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Define Simulation Type
Workshop Supplement
The first step is to change the Analysis Type to Transient: 1.
Edit the
Analysis Type
object in the
Outline
tree 2.
Set the
Analysis Type
Option to
Transient
3.
Set the
Total Time
to
2.5 [s]
4.
Set the
Timesteps
to
0.01 [s]
and click
OK
• The simulation will have 250 timesteps ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-4 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Edit Default Domain
1.
Edit
Default Domain
from the
Outline
tree 2.
Delete
Fluid 1
under
Fluid and Particle Definition
3.
Click on the
New
icon 4.
Name the new fluid
Air
5.
Set the
Material
to
Air at 25C
and the
Morphology
to
Continuous Fluid
6.
Create another fluid named
Water
7.
Set the
Material
to
Water
and the
Morphology
to
Continuous Fluid
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-5
Workshop Supplement
April 28, 2009 Inventory #002599
WS7: Tank Flushing
Edit Default Domain
8.
Turn on
Buoyancy
and set the (
X, Y, Z
) • gravity components to (
0, -g, 0
) Use the expression icon to enter
-g
( g is a built-in constant ) 9.
Set the
Buoy. Ref. Density
to
1.185 [kg
•
m^-3]
This is the density of Air at 25 C. Search the help for “Buoyancy in Multiphase Flow” (including the quotes in the search) for more details
Workshop Supplement
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-6 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Edit Default Domain
10.
Switch to the
Fluid Models
tab 11.
Under
Multiphase Options
, enable the
Homogeneous Model
• This makes the simplifying assumption that both phases share the same velocity field 12.
Set the
Free Surface Model Option
to
Standard
• This changes some solver numerics to resolve the free surface interface better 13.
Under
Heat Transfer
, enable the
Homogeneous Model
the
Option
to
None
toggle and set 14.
Set the
Turbulence Model Option k-Epsilon
to ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-7
Workshop Supplement
April 28, 2009 Inventory #002599
WS7: Tank Flushing
Edit Default Domain
15.
Switch to the
Fluid Pair Model
tab 16.
Enable the
Surface Tension Coefficient
toggle and set the coefficient to
0.072 [N m^-1]
17.
Under
Surface Tension Force
, set the
Option
to
Continuum Surface Force
18.
Set the
Primary Fluid
to Water 19.
Under
Interphase Transfer
, set the
Option
to
Free Surface
20.
Click
OK
to complete the changes to the domain ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-8
Workshop Supplement
April 28, 2009 Inventory #002599
WS7: Tank Flushing
Create Boundary Conditions
Workshop Supplement
Start by creating an Opening boundary at the top of the tank to allow air to escape as the tank is filled: 1.
Insert a new boundary named
Ambient
2.
Set the
Boundary Type
to
Opening
and the
Location
to
AMBIENT
3.
On the
Boundary Details
tab, set the
Mass and Momentum Option
to of
0 [Pa] Opening Pres. And Dirn
with a
Relative Pressure
4.
On the
Fluid Values
tab, set the
Volume Fraction
of
Air
to
1
and the
Volume Fraction
of
Water
to
0
5.
Click
Ok
to create the boundary ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-9 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Create Boundary Conditions
Workshop Supplement
Now create the outlet and symmetry boundaries. Since recirculation may occur at the outlet this boundary will be specified as an Opening: 1.
Insert a new boundary named
Outlet
with the
Boundary Type
as
Opening
and the
Location
as
OUTLET
2.
In the
Boundary Details
, use
Opening Pres. And Dirn Relative Pressure
of
0 [Pa]
with a 3.
In the
Fluid Values
, set the
Volume Fraction
of
Air
to
1
the
Volume Fraction
of
Water
to
0
and 4.
Click
Ok
to create the boundary 5.
Insert a
Symmetry SYM1
boundary named
Sym1
on the Location 6.
Insert a
Symmetry SYM2
boundary named
Sym2
on the Location ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-10 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Inlet Water Flow Function
Workshop Supplement
Water will flow into the tank at a rate of
0.2 [kg s^-1]
for 1 [s]; it will then be shut off for the remainder of the simulation. Therefore the inlet flow rate must be a function of time. You will write an expression using the
if()
function to define this behavior, then create the Inlet boundary: 1.
Right-click on
Expressions
in the
Outline Insert > Expression
tree and select 2.
Enter the
Name
as
flowProfile
3.
Enter the
Definition
click
Apply
as:
if(t<1 [s], 0.2 [kg/s], 0 [kg/s])
and 4.
Insert a new boundary named
Inlet
5.
Set the
Boundary Type
to
Inlet
and the
Location
to
INLET
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-11 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Inlet Boundary Condition
Workshop Supplement
6.
In
Boundary Details
, set the
Mass and Momentum Option
to
Bulk Mass Flow Rate
7.
Set the
Mass Flow Rate
to the expression
flowProfile
8.
In the
Fluid Values
, set the
Volume Fraction
of
Air
to
0
and the
Volume Fraction
of
Water
to
1
, then click
OK
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-12 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Define Expressions
Workshop Supplement
Next you will create expressions to define the initial water height and the initial hydrostatic pressure field. These expressions must define the correct initial flow field because the transient simulation is started “cold” (it is not started from a converged steady-state simulation).
1.
• • • • Insert the following expressions:
waterHt = 6 [cm] waterVF
=
if(y
is the initial height of the water in the tank.
waterVF
provides the initial volume fraction distribution in the tank (see next slide).
waterDen
is the density of water.
HydroP
provides the initial pressure distribution due to the hydrostatic pressure of water.
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-13 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Define Expressions
The expression for
waterVF
contains three
step()
function terms multiplied together. The first function,
step((waterHt - y) / 1[m])
, returns 1 when
y < waterHt
. In other words the volume fraction of water is 1 below the
y = waterHt
line shown to the right.
The second
step()
function returns 1 when
y > -0.01[m]
. The third step function returns 1 when
x > -0.028 [m]
.
The result is that the volume fraction of water is equal to 1 only in the shaded area shown to the right. This defines the initial water volume fraction.
Note that the arguments to the
step()
function must be dimensionless, hence each time we divide by
1[m]
.
y = waterHt y = - 0.01
x = - 0.028
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-14
Workshop Supplement
April 28, 2009 Inventory #002599
WS7: Tank Flushing
Define Initial Conditions
Workshop Supplement
Now set the initial conditions using these expressions: 1.
Right-click on
Flow Analysis 1
in the select
Insert > Global Initialisation Outline
tree and 2.
Set all
Cartesian Velocities Components
to
0 [m s^-1]
3.
Set the
Relative Pressure
to the expression
HydroP
4.
On the
Fluid Settings
tab, set the
Volume Fraction Water
to the expression
waterVF.
Set the
Volume Fraction
for
Air
to the expression
1 – waterVF
for 5.
Click
OK
to set the initial conditions ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-15 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Define Transient Results
Workshop Supplement
By default results are only written at the end of the simulation. You must define transient results to view the intermediate solution: 1.
Edit the
Output Control
object in the
Outline
tree 2.
On the
Trn Results
tab, create a new
Transient Results
object, accepting the default
Name
3.
4.
Set the
Option
• to
Selected Variables
This reduces the file size by only writing out selected variables In the
Output Variables List
, use the … icon and the
Ctrl
key to pick
Air.Volume Fraction
,
Velocity,
and
Water.Volume Fraction
5.
Under
Output Frequency
, set the
Timestep Interval
then click
OK
• to Transient results will be written every second timestep, thus creating a total of 125 Transient Results files
2
, ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-16 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Create Monitor Point
Workshop Supplement
Next create a Monitor Point to track the volume of water in the domain during the solution: 1.
Insert a new expression named
waterVol
Definition set to: with the
volumeInt(Water.Volume Fraction)@Default Domain
• This is the volume integral the water volume fraction in the domain 2.
Edit the
Output Control
object in the
Outline
tree 3.
On the
Monitor Monitor Point
tab, toggle named
Monitor Options, Water Volume
insert a new 4.
Set the
Option Value
as to
waterVol Expression
, then click and enter the
OK Expression
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-17 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Run Solver
Workshop Supplement
1.
Close CFX-Pre and save the project as
TankFlush.wbpj
2.
In the Project Schematic,
Edit
the Solver Manager the
Solution
object to start 3.
Start the run from the Solver Manger • You can monitor the volume of water in the domain during the simulation on the
User Points
tab • The simulation will take about 2 hours to complete. Therefore results files have been provided with this workshop 4.
After a few timesteps, Stop your run 5.
Select
File > Monitor Finished Run
in the Solver Manager 6.
• Browse to the results file provided with the workshop Note the shape of the Water Volume curve, and see that less water is in the domain after the run is complete than there was at the beginning ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-18 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Post-Process Results
1.
Using Windows Explorer, locate the supplied results file
TankFlush_001.res
, and drag it into an empty region of the Project Schematic 2.
A new CFX
Solution Results
and cell will appear. Double-click on the
Results
object to open it in CFD-Post ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-19
Workshop Supplement
April 28, 2009 Inventory #002599
WS7: Tank Flushing
Post-Process Results
Workshop Supplement
1.
Turn on
Visibility
for
Sym1
2.
On the Colour tab, set the
Variable
to
Water.Volume Fraction
and set the
Colour Map
to
White to Blue
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-20 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Post-Process Results
Workshop Supplement
3.
Use the
Timestep Selector
different points in the simulation to load results from 4.
With the first
Timestep
loaded, open the Animation tool 5.
Select the
Quick Animation
the object to animate toggle and select
Timesteps
as 6.
Turn off the
Repeat Forever
button 7.
Enable the
Save Movie
toggle and then click the
Play
icon to animate the results and generate an MPEG ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-21 April 28, 2009 Inventory #002599
WS7: Tank Flushing
Additional Notes
Workshop Supplement
The results show that a significant amount of air becomes entrained in the water. For this situation running the
Inhomogeneous
model is recommended so that each phase has its own velocity field. This would allow entrained air bubble to rise out of the water. When both phases have the same velocity field there is no way for entrained air to separate from the water.
When running the
Inhomogeneous
model, the entrained phase should be set as a
Dispersed Phase
in CFX-Pre.
ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved.
WS7-22 April 28, 2009 Inventory #002599