You are on page 1of 28

Set Up for Iterating

Let's move on to solving the mathematical model.

And that we do under the solution in the tree.
1. Highlight solution methods.
a. And there are a bunch of knobs you can twiddle here.

b. We will leave them all at defaults for now.

c. But an important thing to note here is that the discretization for pressure as well as
momentum is second order accurate.
d. So if we have a second order accurate discretization scheme, and as we refine the
mesh, we expect the error to go down as the square of them, the mesh spacing.
2. Again, there are a bunch of knobs I can twiddle under solution controls.
I won't do that.
3. And highlight Monitors.
a. under Residuals, click Edit.

This is where we set the tolerances for the aggregate mass and momentum
imbalances-- that is,
we control until when the solver will iterate.
And we talked about this in the big ideas in CFD.

So let me go back to that particular PowerPoint.

So, this tolerance is for the aggregate mass imbalance here, but similarly
for the momentum imbalance.

b. So we're setting tolerance in that particular menu.

c. The default tolerance is set to 10 to the power of minus 3, i.e 0.001
And in my experience, and I've come across problems where that has not
given me even qualitatively the right result.
d. So I like the aggregate mass and momentum imbalances to drop to 10 to the power of
minus 6.
And in the exercises I will have you explore
what is the effect of setting the residuals at just 10
to the power minus 3 versus 10 to the power of minus 6.
4. Come down to solution initialization.
So this is where we initialize the guess values for at all the cell centers.
And again, we talked about this in the big ideas in CFD.
So if I go back to that PowerPoint.

The algorithm starts by assigning guess values at the cell centers i.e. step 1.
That's essentially what we're doing here.

e. I'll go to standard initialization, so under Solution Initialization, Standard Initialization.

f. I'll initialize all the cell center values for , the gauge pressure to be 0, the axial velocity to
be 1, and the radial velocity to be 0.
g. And I'll click initialize.
And that's a very simple initialization.
5. And I can check what initialization did by going to the graphics
under Results,
a. go to Contours and I double click on Contours.

b. And I will select Contours of to Velocity and Axial Velocity.

c. Make sure none of the surfaces here are selected, and click Display.

These Surfaces

d. And if I zoom in here, let me fill the domain with colors corresponding to the axial velocity.

fill the remaning

domain with colors

e. So I'll pick Filled, and click Display.


And let me turn on the mesh, so I'll click Draw Mesh.

g. Make sure every surface is selected, so I'll click on that, all surfaces are selected.

h. Click display, and Close.

i. And then display again of contors screen.
Let's try to understand what this is clicking.
a. So these cells are colored by red. So the value is 1.
b. But over here it goes from red to blue, so it goes from red from 1 to 0.

c. And that's showing me the nodal values.

So what it's showing me is-- so the nodal values, in fact

I will annotate that.
Having 0 value from BCs

Nodal Value
Having Value 1

So that's a nodal value, and that's calculated by interpolating these cell center values.
And all these cell center values are 1. Because axial velocity is 1
This value is 0 from the boundary condition.
As I'm going along here, it's going from 1 to 0, and that's what is shown by these colors.
But really, what I want to see are not the nodal values.

I want to see the cell center values.

a. So what I'll do is I will deselect node values and click Display.

Iterate Once

b. Now it's coloring each cell by the corresponding value of the axial velocity at the center of the
c. And we see all that is set to 1.
And similarly, you can check that the gauge pressure is set to 0 and so on.
So that's the effect of the solution initialization.

Iterate Once
1. Let's run one iteration and look at the effect on the cell-center values.
a. Highlight Run calculation.
b. Set the number of iterations to be one.
c. And click calculate.

let's take a look at what the cell-center values of axial velocity look like.
2. I'll go back to Contours in Graphics under the Results, double click on it, and click Display.

So we have run one iteration, which means that all the cell-center values have been tweak once.
And you can see, for instance, this particular cell,

it's gone from axial velocity 1 to something like 0.7.

In fact, I can see where in the range is just by right clicking on the cell.

So that's around 0.7.

So you can see the effect of the boundary condition on that cell i.e it is zero at top of the cell.
You can also look at the mass imbalances(residuals) of, click, contours of residuals, mass
imbalance, and click Display.

This Cell
10 to the power
of minus 6,

So if I look at this particular cell and right click on it,

the mass imbalance is about 10 to the power of minus 6,

which means that the mass going out minus a mass coming in
is of the order of 10 to the power of minus 6.
And you can add these mass imbalances for all of them,
and then the absolute value, and scale it.
And because of the scaling, it clicks that value is 1.

order of 1.

because of the scaling , You can see it's gone, instead of the order of 10
to the power of minus 6, you're getting off the order of 1.
And we want to reduce that by a factor of 6 orders of magnitude.
Similarly, for the momentum imbalances, unfortunately you
can't look at those imbalances by default over here.
And so we can go ahead and do more iterations.

Iterate to Convergence
Before we iterate into convergence, let me iterate, click, four more times
click, Calculate.
And I'll click, Use settings changes for current calculation only, OK?
Now the aggregate mass residual has dropped to about 0.5,
and correspondingly, for the momentum residuals, and so on.

mass residual has

dropped to about 0.5

And if I look at residuals of mass imbalance in contours,

OK, it's gone down by about that proportion, by 0.5.

And if I go back and take a look at the axial velocity,

Speeding up of

there is a speeding up of the flow.

And over here, for instance, if I right-click on it, it's gone up.

So the flow has speeded up here, and if I right-click here,

it's slowing down over there.

So the effect of the wall is as we move away from wall the flow is increasing
3. I can run to convergence, so I'll just give a large number of iterations.
I give 1000
So it'll iterate until the residuals fall below 10 to the power of minus 6.

That reports the residuals, the aggregate mass, and momentum balances.

OK, so the White is continuity.

So that, is an aggregate mass imbalance.
X Velocity You have in Red to interpret this as axial momentum.
So that's the imbalance in the axial momentum,

and the green is the aggregate imbalance in the radial momentum. i.e y velocity

And this is a logarithmic scale,

so the imbalances are falling exponentially,

So what we have done here is, by clicking that the solutions converge, we have reduced the
linearization error below a tolerance.


Here is the discretization and linearization overview.

So by iterating the convergence, we have dropped the linearization error

to presumably a small amount.
And we have, now, a solution to our boundary value problem
that has a small amount of linearization error,
and an unknown amount of discretization error, which
we'll quantify when we verify the situation and we refine the mesh.

Interrogate Residuals and Axial Velocity

Let's take a peek at the residuals of the mass imbalance
after the residuals have dropped below 10 to the power of minus 6.
And so if I look at contours of residuals, mass imbalance,

I see that it's dropped to-- of the order of 10 to the power of minus 13.
So it's gone from order of 10 of the power of minus 6 to about 10
to the power of minus 13.
So about 6 orders of magnitude.
That's reflected in the aggregate residual, too. Given bellow

And if I look at contours of velocity, axial velocity, and I click Display, and I can see that.
I can see that over here, the cell center
value is close to 2, which is close to the expected

value from the pre-analysis. i.e in Analytical solution it was assumed to be 2 because radial distance
become zero at center line.
And then you have a variation between that, between around 2 and 0.
And hopefully, that will be parabolic, which is what we expect.
Near to 2 in red region which is center line

Drag Monitor Explanation

To check on convergence, it's a good idea
to monitor something else in addition to the residuals.
And the drag or the drag coefficient is a good entity to monitor.
Its calculation involves not only interpolation of cell center values
but also differentiation of those interpolated values.
And anytime you numerically differentiate something
you're going to increase the errors in it.

So the drag coefficient inherently has more error in it, and for that reason
it's a good entity to monitor in addition to the residuals.
Let's see how FLUENT calculates a drag coefficient.
The solver will find the net force acting on the pipe wall
by integrating the pressure and the shear forces on the surface.

So if this is the pipe wall, you have-- so that's a wall.

And similarly, over here you can think of that as a cross section

pipe wall

through the pipe.

tangential force

Cross section
through the
pipe (Half Cut).

Normal force
acting on the
surface. That
is pressure

On the surface there is normal force acting on the surface.

That's a pressure.
And there is a tangential force acting on the surface. That is the wall shear.
And in this case, the wall shear is going to be in the direction of the flow because the flow is
through the pipe, going to try to pull the pipe along.
And by integrating these two forces, you can get the net force on the wall.
Drag is a component of this force vector in the axial direction
because by definition it's the force in the direction of the flow.
So we want the component in that direction.

That's a direction of the drag,.

And we can see here that only the wall shear
is going to contribute to the drag because the pressure is
perpendicular to the direction of the track.

Drag coefficient is defined as follows.

Units of Drag is
dynamic pressure.


Which is a dimensionless quantity

And you use the average velocity at any cross section as a reference velocity.
So the dynamic pressure, It has the units of pressure, and you need to multiply it by an area to
get the units of force i.e is Newton.
And the appropriate area to use is what is called the wetted area, which is the area of the pipe
in contact with the flow.
1. And these entities in the denominator are set in FLUENT as follows.
So the drag coefficient in FLUENT is defined

So it's looking for reference value in denominator.

So it'll use a reference value of rho over here.

Reference value of velocity and reference value of area.

And these reference values are set in the Reference Values panel.
Enter the values as follows
And this gives that as 2 pi rl.
Value of area

value of rho

value of velocity

So once we enter those three entities, our drag coefficient will be calculated directly.
The reference values won't affect the drag. It will affect only the drag coefficient.
There reference values won't effect your solution.
It affects only post processing and post processing on non-dimensional quantities.

Drag Monitor Implementation

Let's implement monitoring the drag coefficient alongside the residuals
as the iterations proceed.
1. Highlight monitors.
a. And under Create select Create for drag.


I'll leave the default name,

I'll click print to console, so it will print the drag coefficient to the console.
It will also plot it.
I found that it's a good idea to also write that to a file, and you'll have to search for a file with
that name to figure out where the sub folders it's putting it.
f. And we want the force on the entity to denoted as pipe_wall, so that will give me the force on
the wall.
g. And the direction is x, because we want the force in the direction of the flow, the axle direction
which FLUENT calls x.
h. I'll click OK.


2. And I also need to input the reference value so that it has the right values to use for the NON
Dimensionalization of Drag Values
So the reference value is not going to affect the drag, it's going to affect the drag coefficient.
3. So I've come under here, reference values.
a. let's start with row, The row reference should be 1.
b. The velocity reference should be 1 too, because that's our average velocity.
c. And the area needs to be 2 pi RL, which is 1.885.


In fact, what I'll do is I'll just reinitialize the solution.

So I'll start the solution from scratch.

e. And I'll click run calculation 2000 iterations.
f. And I'll click Calculate.
So let's see, it's plotting how the drag coefficient is
Changing as the iterations proceed. As shown bellow

I can see the residuals over here bellow.

So I can switch between the two windows.

So nothing's changed of the residuals-- in fact,

this hasn't changed the solution at all in this particular case.
But I wanted to show you this, because it's really a good idea
to monitor something else, particularly the drag coefficient if appropriate,
as iterations proceed.

And it's printed to the console and it can see that the drag coefficient is not changing,
and it's of the order of 0.17, which is close to the expected skin friction coefficient of 0.16.


Printed Here
And that's a good kind of quick check that that value is right.
In fact, initially, I forgot to set the right value of the area,
and I got a different result here.
And then I was like, why is it so different from the skin friction
And I fixed it with setting the right reference values.
And so now, we have a good solution.
And we can do the post-processing and look at the results..