You are on page 1of 27

Workshop 07

Inline Mixer
14.5 Release

Introduction to ANSYS
CFD Professional
2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Overview
This workshop simulates an inline
static mixing device. Two side inlets
inject hot fluid into the main flow
just before a restriction in the pipe,
designed to enhance mixing
A Profile Boundary Condition is used
for the velocity main inlet, for which
the temperature is set at 298 [K]
Fluid enters the side inlets at 325 [K]
and 5 [m/s]
Symmetry planes divide the model
into of its initial size
We will create an Additional Variable
to mark the flow from the side inlet
and another to indicate the Fluid Age

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Mesh Checking
Before setting up the simulation you will
check the mesh quality in CFD-Post. This
can be useful when assessing whether
mesh quality is the cause of problems in
the solution.
1. Start ANSYS Workbench and save
the project to your working directory
(File > Save As)
2. Drag and drop a Results component
system into the Project Schematic. Open
CFD-Post by double clicking on the
Results cell or right clicking to select Edit
3. In CFD-Post select File > Load Results
and browse to the directory containing
the mesh file Inline_Mixer_Mesh.gtm
(workshop_input_files\WS_03_Mixing
Tube). Make sure Files of type is set to
All Readable Files or CFX so that you can
select the file. Then click on Open
2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Mesh Checking
3.

Click on the Calculators tab and highlight Mesh Calculator

4.

Examine the results for each of the functions. Guidelines from the
Help documentation (search for Mesh Visualization Advice) have
been copied below

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Mesh Checking
Two metrics fall outside the recommended values:
Minimum Face Angle < 10
Element Volume Ratio > 30
Now create some plots to view these mesh regions:

Create a Volume object (Location > Volume)

Method = Isovolume
Variable = Minimum Face Angle

Mode = Below Value


Value = 15 [degree]

There are very few elements of this quality


Create a second Volume object using the Isovolume
Method with the variable Element Volume Ratio above a
Value of 30. Check the Inclusive box to include elements
at that value so that the isovolume is visible. On the
Colour tab change the Colour to something that will
stand out

There are few elements with high Element Volume


Ratios
They overlap the elements with poor face angles

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Mesh Checking
5. Edit the object Default 2D Region (under the Mesh Regions branch in the
Outline tree)
6.

View the mesh on this


object by editing its Render
properties to Show Mesh
Lines

A finer mesh in the area of


the isovolumes would
improve the mesh quality. A
coarse mesh was used to
minimise solution times
7. Close CFD-Post (File > Close
CFD-Post)

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Starting the Simulation


1.

Drag and drop a CFX Component System into the Project Schematic
and edit the Setup cell to open CFX-Pre

2.

Right click on Mesh in the Outline tree and select Import Mesh >
CFX Mesh. You can then browse to the directory containing
Inline_Mixer_Mesh.gtm and select it
The mesh represents one quarter of the full geometry

3.

Click on Open to import the mesh

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Starting the Simulation


The next step is to prepare the profile boundary data so that they can be
used to define the velocity components on the main inlet. The data are
contained in a file called Inline_Mixer_BC_Profile.csv. Files such as this
can be created by exporting solution data from CFD-Post.
4.

Select Tools > Initialise Profile Data

5. Select the Data File as


Inline_Mixer_BC_Profile.csv

The profiles for the velocity


components are listed

6. Click OK. The User Function, MainInlet,


is added to the Outline tree

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Creating the Additional Variables


We will create two Additional Variables, one will serve as a marker for
fluid entering through the side inlet and the other will be an indicator of
fluid age, i.e. the time taken for the fluid to reach a given point. It is
defined as D(Fluid Age)/Dt = 1, which provided by a unit source term.
Right-click on Additional
Variables in the Outline Tree
and select Insert > Additional
Variable
Name it Side and leave the
Variable Type as Specific and
the Units as [ ]

Repeat the above steps to


create a Volumetric AV called
Fluid Age with units of [s]

2013 ANSYS, Inc.

December 12, 2013

Release 14.5

Creating the Domain


Now create the fluid domain:
1. Right-click on Default Domain in the Outline and
rename it InlineMixer
2. Double-click on InlineMixer to edit it and set the
following on the Basic Settings:

Material = Water
Reference Pressure = 1 [ atm ]

2013 ANSYS, Inc.

December 12, 2013

10

Release 14.5

Creating the Domain


Select the Fluid Models tab:
1. Set the following:

Heat Transfer Model = Thermal Energy


Turbulence Model = k-Epsilon
2. In the Additional Variables section highlight Fluid
Age and ensure that the Option is set to
Transport Equation
3. Do the same for Side
4. Click on OK to complete the specification of the
domain

2013 ANSYS, Inc.

December 12, 2013

11

Release 14.5

Inlet Boundary Conditions


1. Insert a new boundary by right-clicking
on the domain InlineMixer in the Outline
tree

2. Set the Name to Main Inlet and click OK


3. On the Basic Settings tab, set Boundary
Type to Inlet, and Location to Main Inlet
4. Turn on the Use Profile Data toggle

The previously initialised profile


MainInlet is displayed

5. Click Generate Values and switch to the


Boundary Details tab

Generate Values automatically enters


appropriate expressions that refer to the
selected profile.
2013 ANSYS, Inc.

December 12, 2013

12

Release 14.5

Inlet Boundary Conditions


6.

On the Boundary Details tab set the Static


Temperature to 298 [K]

7.

If necessary, change the option for Mass and


Momentum to Cart Vel Components. The User
Function, MainInlet , is automatically used

8.

Give Fluid Age a Value of 0 [s] and Side a value of


0[]

9.

Click Apply, not OK

10. Select the Plot Options tab and enable the


Boundary Contour toggle
11. Set the Profile Variable to W and click Apply
The profile is a 1/7th power law profile, which is
commonly used to describe the boundary layer

12. Turn off the Boundary Contour toggle and click OK


2013 ANSYS, Inc.

December 12, 2013

13

Release 14.5

Inlet Boundary Conditions


Now create the side inlet boundary condition:

1. Insert a new boundary named Side Inlet


2. On the Basic Settings tab, set Boundary Type to Inlet, and Location to
Side Inlet
3. On the Boundary Details tab set the Mass and Momentum Option to
Normal Speed with a value of 5 [m s^-1]
4. Set Static Temperature to 325 [K]
5. Set the Value of Side to 1 [ ] and Fluid Age to 0 [s]
6. Click OK

2013 ANSYS, Inc.

December 12, 2013

14

Release 14.5

Outlet Boundary Condition


Next, create the outlet boundary condition:

1. Insert a new boundary named Outlet


2. On the Basic Settings tab set Boundary Type to Outlet and Location to
Outlet
3. Click the Boundary Details tab and set the Mass and Momentum
Option to Average Static Pressure with a value of 0 [ Pa ]
4. Click OK

2013 ANSYS, Inc.

December 12, 2013

15

Release 14.5

Symmetry Boundary Conditions


Lastly create the symmetry boundary conditions:

1. Insert a new boundary named Sym 1


2. On the Basic Settings tab set Boundary Type to Symmetry and Location
to Sym1
3. Click OK

4. Insert a new boundary named Sym 2


5. On the Basic Settings tab, set Boundary Type to Symmetry and Location
to Sym2
6. Click OK

2013 ANSYS, Inc.

December 12, 2013

16

Release 14.5

Source for Fluid Age


A unit source is needed in the transport equation for Fluid Age. To
include this source we need to create a Subdomain.
1. Right-click on InlineMixer in the
Outline Tree and select Insert >
Subdomain and leave the name as
the default

2. On the Basic Settings tab pick the


solid B7 as the Location
3. Switch to the Sources tab and
activate Sources

4. In the list of Equation Sources,


highlight Fluid Age, click in the
check box and give it a value of 1

2013 ANSYS, Inc.

December 12, 2013

17

Release 14.5

Solver Control
1. Double-click Solver Control in the
Outline tree
2. Set Timescale Control to Physical
Timescale, and set the Physical
Timescale to 5 [ s ]
3. Click OK

2013 ANSYS, Inc.

December 12, 2013

18

Release 14.5

Running the Solver


1. Save the settings by selecting File > Save Project and then close CFXPre (File > Close CFX-Pre)
2. To write the definition file, the input file for the CFX-Solver, and start
up the CFX Solver Manager, double-click on the Solution cell in the
CFX component system in the Project Schematic
3. When the CFX-Solver Manager opens, click Start Run

4. The run should finish after about 40 iterations. When it does so,
close the CFX-Solver Manager (File > Close CFX-Solver Manager)
5. In the Project Schematic double-click on the Results cell of the CFX
component system to open CFD-Post

2013 ANSYS, Inc.

December 12, 2013

19

Release 14.5

Post-processing
One of the variables written to the results file is Yplus. This variable
gives the dimensionless distance between a wall and the first node from
the wall. This is an important quantity for turbulence models since the
turbulent wall functions are valid only below certain Yplus values. For
the k-epsilon model Yplus should be < 100. Note that you can only plot
Yplus on walls.
Colour the InlineMixer Default boundary using Yplus (to select Yplus use
the button)

Yplus is > 200 over most of the area of the walls


The thickness of the first inflation layer from the wall should be reduced
to obtain more accurate results. To maintain good mesh quality when
reducing the first layer thickness, you will often have to include more
inflation layer and/or use a finer mesh
For turbulent flows you should always check the Yplus values in your results

2013 ANSYS, Inc.

December 12, 2013

20

Release 14.5

Post-processing
The mixing of the fluid from the different inlets can
be visualised with a plot of temperature distribution
1.

Double-click on Sym 1 in the Outline tree to edit

2.

Set the following on the Colour tab:

Mode to Variable
Variable to Temperature
Range to User Specified
Min to 298 [ K ]
Max to 302.5 [ K ]

The temperature profile appears well mixed within 3


pipe diameters downstream of the flow restriction

2013 ANSYS, Inc.

December 12, 2013

21

Release 14.5

Post-processing
We can also visualise mixing by plotting contours of the variable Side. This
will be done on a series of planes downstream from Side Inlet. The definition
of the planes will be imported from a state file.
3.

File > Load State. Select


proceed and browse to the file
called planes.cst. State Option
= Add to Current State.

4. Create a contour plot located on


Planes 1 - 7, PlaneSideInlet and
Out ().

5. Set a User Specified Range of 0


0.15. At perfect mixing the
concentration would be 0.107,
which can be checked with
expression:
massFlow()@Side Inlet /(massFlow()@Side Inlet + massFlow()@Main Inlet )
2013 ANSYS, Inc.

December 12, 2013

22

Release 14.5

Post-processing
The variable Fluid Age would reveal regions where fluid is not being flushed
through.
6.

Change the plot variable


to Fluid Age and the
Range to Local

7.

Colour Sym 1 with Fluid


Age

The value of Fluid Age is


generally increasing towards
the outlet, without any hot
spots that would concern us

2013 ANSYS, Inc.

December 12, 2013

23

Release 14.5

Post-processing
The flow is viewed by means of a vector plot
4. Turn off visibility for Sym 1
5. Create a Vector plot on the location Sym 1

2013 ANSYS, Inc.

Mixing is enhanced by the large recirculation zone downstream


of the restriction

December 12, 2013

24

Release 14.5

Post processing
The full geometry can be displayed by
means of an instance transform
1. Turn off visibility of all plots

2. Colour the InlineMixer Default


boundary with Temperature, using a
Local Range
3. In the Outline tree edit the User
Locations and Plots > Default
Transform object
4. Turn off Instancing Info From Domain,
change Number of Graphical Instances
to 2 and then turn on Apply Rotation

5. Change the Angle From setting to


Value, enter an Angle of 180 [degree]
2013 ANSYS, Inc.

December 12, 2013

25

Release 14.5

Post-processing
6. Turn on Apply Reflection and set the
Method to ZX Plane with a Y value of
0[m]
7. Click Apply

Two transforms are performed: a


rotation of 180 degrees about the Zaxis and then a reflection in the ZX
plane. This results in four copies of
the original geometry

8. Turn off visibility of the Wireframe

9. Turn off visibility of InlineMixer


Default
The Default Transform applies to all existing and new objects by default. You
can create new transforms and apply them to selected objects as necessary.
2013 ANSYS, Inc.

December 12, 2013

26

Release 14.5

Post-processing
Now create an Isosurface of
Temperature:
1. Select Location > Isosurface
2. Accept the default name by
clicking OK
3. Set Variable to Temperature
4. Set Value to 301.5 [K], a little
above the mass-flow averaged
temperature on the outlet. Use
the Function Calculator to
evaluate this.
The isosurface is reasonably axisymmetric 1.5 - 2 pipe diameters
downstream of the restriction, where the flow has started to recover.
2013 ANSYS, Inc.

December 12, 2013

27

Release 14.5