CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Strange Solution for a simple pipe flow!! (

shekharc May 8, 2005 10:41

Strange Solution for a simple pipe flow!!
Dear friends, I am using MAC algorithm to solve a simple pipe flow using Finite Difference Method in Cylindrical-polar co-ordinate, staggerred grid. Re = 1000, unsteady flow.

The convergence criterion is: maximum-divergence < 0.001. I am following the following procedure:

1. Initializing the velocity field with zero velocity i.e. u,v,w = 0 and P = 1 atm at t = 0 (everywhere).

2. Getting the provisional velocity at time-step "delta_t" using momentum equation. Time step is sufficiently small (1.0E-4).

3. Iterating to get a divergence-free velocity field under the influence of no-slip B.C. at the cypinder-wall. At inlet and outlet, Derechlet B.C. for Pressure is used i.e. P = 1 atm. At wall, dP/dn = 0 is used.

I am iterating but the maximum divergence among all the cells oscillates about the value 5.0E+2. However, when i analize a particulat cell near the inlet, divergence across it stablized about the value 2.0E-3. I don't know what is going on because if it has to diverge, the solution should not oscillate.

About the convergence criterion, I think the first criterion, i.e. max_div < DELTA should hold rather than analyzing a particular cell.

Please help me out.

thank you, shekharc.

Adrin Gharakhani May 8, 2005 16:21

Re: Strange Solution for a simple pipe flow!!
Just curious how you expect such a flow to exist! You have no pressure gradient from the inlet to the outlet. You haven't said anything about velocities there; so, unless I'm missing something here your problem setup seems incorrect. Try a higher pressure value at the inlet and see if the problem persists...

Adrin Gharakhani

Jim_Park May 8, 2005 19:33

Re: Strange Solution for a simple pipe flow!!
Adrin has a point (maybe more!).

I can think of two problems you might want to do. First, if the mass flow is M-dot, what is the pressure drop?

For this one, specify the inlet velocity, which is constant across the inlet, v-in = M-dot/(area x density). The pressure will not be set at the inlet but be determined by the mass flow condition. If you look at the MAC derivation published by Harlow et al, you'll see the boundary conditions on the pressure equation are set in terms of velocities. At the outlet, the MAC derivation requires outlet conditions based on velocity derivatives.

Thus the mass flow determines the pressure drop through the pipe.

The second problem is the reverse: given the pressure drop, what is the mass flow through the pipe? This one I think you need to calculate iteratively. Guess a mass flow and calculated the corresponding pressure gradient, compare to the desired pressure gradient, correct the guess of mass flow, and repeat until converged.

For a laminar, constant viscosity fluid, the analytic solution (see Schlichting for instance) is remarkably good. In fact, you can use the analytic to check MAC solutions to see if the meshes used are fine enough. It's a good test case to assure that your coding is bug-free.

shekharc May 9, 2005 05:42

Re: Strange Solution for a simple pipe flow!!
Thank you very much for the suggestions. What I implemented is:

1. Constant velocity profile across the inlet i.e. W_inlet = 5.0E-2 m/sec i.e. M-dot is specified (for incompressible flow, density = const.)

2. P_inlet = 1.0 atm.

3. P_outlet = 1.0 atm.

I think P_inlet and P_outlet should not be chosen arbitarary as you suggested. Rather, this should be determined by M-dot. I think here I did wrong.

4. dp/dn = 0 on the wall.

Could you suggest me how to derive pressure boundary condition in term of velocities?

Thank you. shekharc.

Jim_Park May 9, 2005 09:21

Re: Strange Solution for a simple pipe flow!!
"I think P_inlet and P_outlet should not be chosen arbitarary as you suggested. Rather, this should be determined by M-dot."

I didn't suggest specifying the inlet and outlet pressure. The pressure DIFFERENCE from inlet to outlet will emerge from the solution after you specify M-dot. The pressure level is arbitrary in incompressible flow. So you can set one OR the other AFTER your solution is complete.

The MAC technique first appears in The Physics of Fluids, vol. 8, n. 12, pp. 2182-2189, December, 1965. "Numerical Calculation of Time-Dependent Viscous Incompressible Flow of Fluid with Free Surface," by Francis H. Harlow and J. Eddie Welch.

If you can find this paper in the archival section of your institution's library to check the derivation of the pressure equation in MAC, you'll find that the pressure boundary conditions are given in terms of the known velocity boundary conditions, either normal velocities or shears. It's a bit awkward, and the introduction of the Simplified MAC method made specification of boundary conditions for the pressure equation a lot more direct. [JCP, vol. 6, 1970, pp. 322-325].

All times are GMT -4. The time now is 20:49.