Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Chapter 6: Flow in a Process Injection Mixing Pipe

This tutorial includes:


6.1.Tutorial Features
6.2. Overview of the Problem to Solve
6.3. Preparing the Working Directory
6.4. Defining the Case Using CFX-Pre
6.5. Obtaining the Solution Using CFX-Solver Manager
6.6. Viewing the Results Using CFD-Post

6.1. Tutorial Features


In this tutorial you will learn about:

• Applying a profile boundary using data stored in a file.

• Visualizing the velocity on a boundary in CFX-Pre.

• Using the CFX Expression Language (CEL) to describe temperature-dependent fluid properties in CFX-Pre.

• Using the k-epsilon turbulence model.

• Using streamlines in CFD-Post to track flow through the domain.

Component Feature Details


CFX-Pre User Mode General mode
Analysis Type Steady State
Fluid Type General Fluid
Domain Type Single Domain
Turbulence Model k-Epsilon
Heat Transfer Thermal Energy
Boundary Conditions Boundary Profile
Visualization
Inlet (Profile)
Inlet (Subsonic)
Outlet (Subsonic)
Wall: No-Slip
Wall: Adiabatic
CEL (CFX Expression
Language)
Timestep Physical Time Scale
CFD-Post Plots Default Locators

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 111
Flow in a Process Injection Mixing Pipe

Component Feature Details


Outline Plot (Wireframe)
Slice Plane
Streamline
Other Changing the Color Range
Expression Details View
Legend
Viewing the Mesh

6.2. Overview of the Problem to Solve


The goal of this tutorial is to understand the general approach taken when working with an existing
mesh. In this tutorial, you will go through the three main steps when solving a problem, which are de-
fining a simulation using General mode in CFX-Pre, obtaining a solution using CFX-Solver Manager and
viewing the results in CFD-Post.

The injection mixing pipe, common in the process industry, is composed of two pipes: one with a larger
diameter than the other. Analyzing and optimizing the mixing process is often critical for many chem-
ical processes. CFD is useful not only in identifying problem areas (where mixing is poor), but also in
testing new designs before they are implemented.

The geometry for this example consists of a circular pipe of diameter 1.0 m with a 90° bend, and a
smaller pipe of diameter 0.3 m which joins with the main pipe at an oblique angle. Water at 315.0 K
enters in the 0.3 m diameter pipe at a rate of 5.0 m/s while water at 285.0 K enters in the 1.0 m diameter
pipe at a rate of 0.5 m/s.

Figure 6.1: Injection Mixing Pipe

In this tutorial, you will establish a general workflow for analyzing the flow of the water fluid into and
out of an injection pipe. First, a simulation will be created and an existing mesh will be imported in
CFX-Pre. A viscosity expression will also be created, and will be used to modify the water properties
later on in this tutorial to increase the solution accuracy. Finally, initial values will be set and a solution

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
112 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining the Case Using CFX-Pre

will be found using CFX-Solver Manager. The results will then be viewed in CFD-Post. Streamlines ori-
ginating from the main inlet will be generated to show the flow of the water into and out of the injection
pipe.

If this is the first tutorial you are working with, it is important to review the following topics before
beginning:

• Running ANSYS CFX Tutorials Using ANSYS Workbench (p. 4)

• Changing the Display Colors (p. 6)

6.3. Preparing the Working Directory


1. Create a working directory.

ANSYS CFX uses a working directory as the default location for loading and saving files for a par-
ticular session or project.

2. Download the inject_mixer.zip file here.

3. Unzip inject_mixer.zip to your working directory.

Ensure that the following tutorial input files are in your working directory:

• InjectMixerMesh.gtm

• InjectMixer_velocity_profile.csv

4. Set the working directory and start CFX-Pre.

For details, see Setting the Working Directory and Starting ANSYS CFX in Stand-alone Mode (p. 3).

6.4. Defining the Case Using CFX-Pre


The tutorial follows this general workflow for setting up the case in CFX-Pre:
6.4.1. Importing a Mesh
6.4.2. Setting Temperature-Dependent Material Properties
6.4.3. Plotting an Expression
6.4.4. Evaluating an Expression
6.4.5. Modify Material Properties
6.4.6. Creating the Domain
6.4.7. Creating the Side Inlet Boundary
6.4.8. Creating the Main Inlet Boundary
6.4.9. Creating the Main Outlet Boundary
6.4.10. Setting Initial Values
6.4.11. Setting Solver Control
6.4.12. Writing the CFX-Solver Input (.def ) File

1. In CFX-Pre, select File > New Case.

2. Ensure General is selected and click OK.

3. Select File > Save Case As.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 113
Flow in a Process Injection Mixing Pipe

4. Under File name, type InjectMixer.

5. Click Save.

6. Proceed to Importing a Mesh (p. 114).

6.4.1. Importing a Mesh


The following steps will demonstrate how to import a mesh.

1. Right-click Mesh and select Import Mesh > CFX Mesh.

The Import Mesh dialog box appears.

2. Configure the following setting(s):

Setting Value
File name InjectMixerMesh.gtm

3. Click Open.

4. Right-click a blank area in the viewer and select Predefined Camera > Isometric View (Y up) from the
shortcut menu.

6.4.2. Setting Temperature-Dependent Material Properties


Viscosity varies with temperature, which implies that the water will behave differently when coming
through the 1.0 m and the 0.3 m diameter pipes. In the following steps, you will create an expression
for viscosity as a function of temperature. This expression will then be used to modify the properties
of the library material: Water to increase the accuracy of the solution. By setting temperature-dependent
material properties, Viscosity will be made to vary linearly with temperature between the following
conditions:

• =1.8E-03 N s m-2 at T=275.0 K

• =5.45E-04 N s m-2 at T=325.0 K

The variable T (Temperature) is a CFX System Variable recognized by CFX-Pre, denoting static temper-
ature. All variables, expressions, locators, functions, and constants can be viewed by double-clicking
the appropriate entry (such as Additional Variables or Expressions) in the tree view.

All expressions must have consistent units. You should be careful if using temperature in an expression
with units other than [K].

The Expressions tab lets you define, modify, evaluate, plot, copy, delete and browse through expressions
used within CFX-Pre.

1. From the main menu, select Insert > Expressions, Functions and Variables > Expression.

2. In the New Expression dialog box, type Tupper.

3. Click OK.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
114 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining the Case Using CFX-Pre

The details view for the Tupper equation is displayed.

4. Under Definition, type 325 [K].

5. Click Apply to create the expression.

The expression is added to the list of existing expressions.

6. Ensure that no expression is highlighted, then right-click in the Expressions workspace and select Insert
> Expression.

7. In the New Expression dialog box, type Tlower.

8. Click OK.

9. Under Definition, type 275 [K].

10. Click Apply to create the expression.

The expression is added to the list of existing expressions.

11. Create expressions for Visupper, Vislower and VisT using the following values.

Name Definition
Visupper 5.45E-04 [N s m^-2]
Vislower 1.8E-03 [N s m^-2]
VisT Vislower+(Visupper-Vislower)*(T-Tlower)/(Tupper-Tlower)

6.4.3. Plotting an Expression


1. Right-click VisT in the Expressions tree view, and then select Edit.

The Expressions details view for VisT appears.

Tip

Alternatively, double-clicking the expression also opens the Expressions details view.

2. Click the Plot tab and configure the following setting(s):

Tab Setting Value


Plot Number of Points 10
T (Selected)
Start of Range 275 [K]
End of Range 325 [K]

3. Click Plot Expression.

A plot showing the variation of the expression VisT with the variable T is displayed.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 115
Flow in a Process Injection Mixing Pipe

6.4.4. Evaluating an Expression


1. Click the Evaluate tab.

2. In T, type 300 [K].

This is between the start and end range defined in the last module.

3. Click Evaluate Expression.

A value of around 0.0011[kg m^-1 s^-1] for VisT at the given value of T appears in the Value
field.

6.4.5. Modify Material Properties


As mentioned earlier in this tutorial, the default material properties of Water will be modified using
the Viscosity expression to increase the accuracy of the solution.

1. Click the Outline tab.

2. Double-click Water under Materials to display the Basic Settings tab.

3. Click the Material Properties tab.

4. Expand Transport Properties.

5. Select Dynamic Viscosity.

6. Under Dynamic Viscosity, click in Dynamic Viscosity.

7. Click Enter Expression .

8. Enter the expression VisT into the data box.

9. Click OK.

6.4.6. Creating the Domain


The domain will be set to use the thermal energy heat transfer model, and the (k-epsilon) turbulence
model.

Both Basic Settings and Fluid Models are changed in this module. The Initialization tab is for setting
domain-specific initial conditions, which are not used in this tutorial. Instead, global initialization is used
to set the starting conditions.

1. Select Insert > Domain from the main menu or click Domain .

2. In the Insert Domain dialog box, type InjectMixer.

3. Click OK.

4. Configure the following setting(s):

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
116 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining the Case Using CFX-Pre

Tab Setting Value


Basic Settings Location and Type

> Location B1.P3


Fluid and Particle Fluid 1
Definitions
Fluid and Particle
Definitions

> Fluid 1

> Material Water


Domain Models

> Pressure

> Reference Pres-


sure 0 [atm]

5. Click Fluid Models.

6. Configure the following setting(s):

Setting Value
Heat Transfer

> Option Thermal Energy

7. Click OK.

6.4.7. Creating the Side Inlet Boundary


The side inlet boundary must be defined.

1. Select Insert > Boundary from the main menu or click Boundary .

2. Set Name to side inlet.

Note

A boundary named after a region will use that region as its location by default.

3. Click OK.

4. Configure the following setting(s):

Tab Setting Value


Basic Settings Boundary Type Inlet

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 117
Flow in a Process Injection Mixing Pipe

Tab Setting Value


Location side inlet
Boundary Mass and Momentum
Details
> Option Normal Speed
Mass and Momentum

> Normal Speed 5 [m s^-1]


Heat Transfer

> Option Static Temperature


Heat Transfer

> Static Temperature 315 [K]

5. Click OK.

6.4.8. Creating the Main Inlet Boundary


The main inlet boundary for the large pipe must be defined. This inlet is defined using a velocity profile.
Profile data must be initialized before the boundary can be created.

You will create a plot showing the velocity profile data, marked by higher velocities near the center of
the inlet, and lower velocities near the inlet walls.

1. Select Tools > Initialize Profile Data.

The Initialize Profile Data dialog box appears.

2. Under Data File, click Browse .

3. From your working directory, select InjectMixer_velocity_profile.csv.

4. Click Open.

5. Click OK.

The profile data is read into memory.

Note

After profile data has been initialized from a file, the profile data file should not be de-
leted or otherwise removed from its directory. By default, the full file path to the profile
data file is stored in CFX-Pre, and the profile data file is read directly by CFX-Solver each
time the solver is started or restarted.

6. Select Insert > Boundary from the main menu or click Boundary .

7. Set name Name to main inlet.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
118 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining the Case Using CFX-Pre

8. Click OK.

9. Configure the following setting(s):

Tab Setting Value


Basic Settings Boundary Type Inlet
Location main inlet
Profile Boundary
Conditions

> Use Profile Data (Selected)


Profile Boundary
Setup

> Profile Name main inlet

10. Click Generate Values.

This causes the profile values of U, V, W to be applied at the nodes on the main inlet boundary,
and U, V, W entries to be made in Boundary Details. In order to later reset the velocity values at
the main inlet to match those that were originally read from the boundary condition profile file,
revisit Basic Settings for this boundary and click Generate Values.

11. Configure the following setting(s):

Tab Setting Value


Boundary Details Flow Regime

> Option Subsonic


Mass And
Momentum
Cart. Vel.
> Option Components
Turbulence

> Option Medium (Intensity


= 5%)
Heat Transfer

> Option Static Temperature


Heat Transfer

> Static Temperat-


ure 285 [K]
Plot Options Boundary Contour (Selected)
Boundary Contour

> Profile Variable W

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 119
Flow in a Process Injection Mixing Pipe

12. Click OK.

13. Zoom into the main inlet to view the inlet velocity contour.

6.4.9. Creating the Main Outlet Boundary


In this module you create the outlet boundary. All other surfaces that have not been explicitly assigned
a boundary will remain in the InjectMixer Default object, which is shown in the tree view. This
boundary uses a No-Slip Adiabatic Wall by default.

1. Select Insert > Boundary from the main menu or click Boundary .

2. Set Name to outlet.

3. Click OK.

4. Configure the following setting(s):

Tab Setting Value


Basic Settings Boundary Type Outlet
Location outlet
Boundary Details Flow Regime

> Option Subsonic


Mass and Momentum

> Option Average Static


Pressure
Relative Pressure 0 [Pa]

5. Click OK.

6.4.10. Setting Initial Values


For this tutorial, the initial values will be set automatically. An automatic guess is sufficient for this
particular problem.

1. Click Global Initialization and review, but do not change, the current settings.

2. Click Close.

6.4.11. Setting Solver Control

1. Click Solver Control .

2. Configure the following setting(s):

Tab Setting Value


Basic Settings Advection Scheme

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
120 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining the Case Using CFX-Pre

Tab Setting Value


> Option High Resolution
Convergence
Control

> Max. Iterations 50


Convergence
Control

> Fluid Timescale


Control

> Timescale Con-


trol Physical Timescale
Convergence
Control

> Fluid Timescale


Control

> Physical Times-


[a]
cale 2 [s]
Convergence
Criteria

> Residual Type RMS


Convergence
Criteria
[b]
> Residual Target 1.E-4
a. The physical timescale that will be set up is derived from the pipe diameter (1
m) and the rate at which the water flows in the pipe (0.5 m/s).

b. An RMS value of at least 1.E-5 is usually required for adequate convergence, but
the default value is sufficient for demonstration purposes.

3. Click OK.

6.4.12. Writing the CFX-Solver Input (.def) File


Once the problem has been defined you move from General mode into CFX-Solver.

1. Click Define Run .

2. Configure the following setting(s):

Setting Value
File name InjectMixer.def

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 121
Flow in a Process Injection Mixing Pipe

3. Click Save.

The CFX-Solver input file (InjectMixer.def) is created. CFX-Solver Manager automatically starts
and, on the Define Run dialog box, Solver Input File is set.

4. When you are finished, select File > Quit in CFX-Pre.

5. Click Save & Quit if prompted, to save InjectMixer.cfx

6. Proceed to Obtaining the Solution Using CFX-Solver Manager (p. 122).

6.5. Obtaining the Solution Using CFX-Solver Manager


You will now generate a solution for the CFD simulation that you just prepared.

6.5.1. Starting the Run


At this point, CFX-Solver Manager is running, and the Define Run dialog box is displayed, with the CFX-
Solver input file set.

1. Click Start Run.

2. When the run ends, ensure that the check box next to Post-Process Results is cleared and click OK to
close the dialog box.

6.5.2. Moving from CFX-Solver Manager to CFD-Post

1. Select Tools > Post-Process Results or click Post-Process Results .

2. If using CFX-Solver Manager in stand-alone mode, optionally select Shut down CFX-Solver Manager.

3. Click OK.

6.6. Viewing the Results Using CFD-Post


When CFD-Post starts, the viewer and Outline workspace display by default.

The tutorial follows this general workflow for viewing results in CFD-Post:
6.6.1. Modifying the Outline of the Geometry
6.6.2. Creating and Modifying Streamlines Originating from the Main Inlet
6.6.3. Modifying Streamline Color Ranges
6.6.4. Coloring Streamlines with a Constant Color
6.6.5. Creating Streamlines Originating from the Side Inlet
6.6.6. Examining Turbulence Kinetic Energy
6.6.7. Quitting CFD-Post

6.6.1. Modifying the Outline of the Geometry


Throughout this and the following examples, use your mouse and the Viewing Tools toolbar to manip-
ulate the geometry as required at any time.

1. In the tree view, double-click Wireframe.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
122 of ANSYS, Inc. and its subsidiaries and affiliates.
Viewing the Results Using CFD-Post

2. Set the Edge Angle to 15 [degree].

3. Click Apply.

6.6.2. Creating and Modifying Streamlines Originating from the Main Inlet
When you complete this module you will see streamlines (mainly blue and green) starting at the main
inlet of the geometry and proceeding to the outlet. Above where the side pipe meets the main pipe,
there is an area where the flow re-circulates rather than flowing roughly tangent to the direction of the
pipe walls.

1. Select Insert > Streamline from the main menu or click Streamline .

2. Under Name, type MainStream.

3. Click OK.

4. Configure the following setting(s):

Tab Setting Value


Geometry Type 3D Streamline
Definition

> Start From main inlet

5. Click Apply.

6. Right-click a blank area in the viewer, select Predefined Camera from the shortcut menu, then select
Isometric View (Y up).

The pipe is displayed with the main inlet in the bottom right of the viewer.

6.6.3. Modifying Streamline Color Ranges


You can change the appearance of the streamlines using the Range setting on the Color tab.

1. Under User Locations and Plots, modify the streamline object MainStream by applying the following
settings

Tab Setting Value


Color Range Local

2. Click Apply.

The color map is fitted to the range of velocities found along the streamlines. The streamlines
therefore collectively contain every color in the color map.

3. Configure the following setting(s):

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 123
Flow in a Process Injection Mixing Pipe

Tab Setting Value


Color Range User Specified
Min 0.2 [m s^-1]
Max 2.2 [m s^-1]

Note

Portions of streamlines that have values outside the range shown in the legend are
colored according to the color at the nearest end of the legend. When using tubes or
symbols (which contain faces), more accurate colors are obtained with lighting turned
off.

4. Click Apply.

The streamlines are colored using the specified range of velocity values.

6.6.4. Coloring Streamlines with a Constant Color


1. Configure the following setting(s):

Tab Setting Value


Color Mode Constant
Color (Green)

Color can be set to green by selecting it from the color pallet, or by repeatedly clicking on the
color box until it cycles through to the default green color.

2. Click Apply.

6.6.5. Creating Streamlines Originating from the Side Inlet


The following steps illustrate using this feature to add a streamline object that originates at the side
inlet.

1. Right-click MainStream and select Duplicate from the shortcut menu.

2. In the Name window, type SideStream.

3. Click OK.

4. Double-click the newly created streamline, SideStream.

5. Configure the following setting(s):

Tab Setting Value


Geometry Definition

> Start From side inlet


Color Mode Constant

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
124 of ANSYS, Inc. and its subsidiaries and affiliates.
Viewing the Results Using CFD-Post

Tab Setting Value


Color (Red)

6. Click Apply.

Red streamlines appear, starting from the side inlet.

7. For better view, select Isometric View (Y up).

6.6.6. Examining Turbulence Kinetic Energy


Away from walls, turbulence kinetic energy has an influence on the level of mixing. A plane will be
created to view the Turbulence Kinetic Energy variable within the domain.

Note

This module has multiple changes compiled into single steps in preparation for other tutorials
that provide fewer specific instructions.

1. Turn off the visibility of both the MainStream and the SideStream objects.

2. Create a plane named Plane 1 that is normal to X and passing through the X = 0 Point. To do so, spe-
cific instructions follow.

a. From the main menu, select Insert > Location > Plane and click OK.

b. In the details view, set Definition > Method to YZ Plane and X to 0 [m].

c. Click Apply.

3. Color the plane using the variable Turbulence Kinetic Energy, to show regions of high turbulence.
To do so, apply the settings below.

Tab Setting Value


Color Mode Variable
Variable Turbulence Kinetic
Energy

4. Click Apply.

5. Experiment with other variables to color this plane (for example, Temperature to show the temperature
mixing of the two streams).

Commonly used variables are in the drop-down menu. A full list of available variables can be viewed

by clicking next to the Variable data box.

6.6.7. Quitting CFD-Post


1. When you are finished, select File > Quit to exit CFD-Post.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 125
Flow in a Process Injection Mixing Pipe

2. If prompted by a dialog box, save the state at your discretion.

Release 2019 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
126 of ANSYS, Inc. and its subsidiaries and affiliates.

You might also like