CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Velocity Loss in simpleFoam, Turbulent Flow

Register Blogs Community New Posts Updated Threads Search

Like Tree17Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2017, 08:50
Default Velocity Loss in simpleFoam, Turbulent Flow
  #1
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Hi,

I do appreciate any form of help regarding this case. I am really confused with this problem.

We can assume that geometry is sort of a simple valley. flow moves in from two inlets. One at the left and the other one is at the top. there is one outlet. [Actually we can change the top inlet with outlet as well, but for now lets go with the first one.]

Velocity Magnitude plot at different height along the geometry is shown here. Both inlet velocity and internalField are considered 2 m/s. What is the reason of velocity loss here? Why we lose velocity along the geometry? Is it because of turbulence or something else [mesh, boundary conditions, etc.]?

All the files are attached as a ZIP. Solution is converged at 414 iterations. My version of OpenFOAM is 1706. I would be thankful for your help guys.
Attached Images
File Type: jpg residuals.jpg (69.5 KB, 50 views)
File Type: jpg velocityMagnitude.jpg (61.5 KB, 51 views)
File Type: png geometry.png (50.5 KB, 59 views)
Attached Files
File Type: zip simpleFoamValley.zip (14.0 KB, 15 views)
soheil_r7 is offline   Reply With Quote

Old   December 10, 2017, 15:40
Default
  #2
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
There are couple of problems with your case. Boundary conditions at the outlet are wrong. When you prescribe pressure at a boundary you should use pressureInletOutletVelocity for U and inletOutlet for the rest.

In fvSolution, consider setting relTol to 0 and play with the relaxation factors. They are very low, consider setting a value close to 1 as much as possible. Start with values close to 1 and decrease them if necessary.

Regarding the loss, the closer to the wall the more loss you would expect. Part of it also could be related to numerical diffusion.
soheil_r7 and ms.hashempour like this.
Taataa is offline   Reply With Quote

Old   December 10, 2017, 16:08
Default
  #3
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Quote:
Originally Posted by Taataa View Post
There are couple of problems with your case. Boundary conditions at the outlet are wrong. When you prescribe pressure at a boundary you should use pressureInletOutletVelocity for U and inletOutlet for the rest.

In fvSolution, consider setting relTol to 0 and play with the relaxation factors. They are very low, consider setting a value close to 1 as much as possible. Start with values close to 1 and decrease them if necessary.

Regarding the loss, the closer to the wall the more loss you would expect. Part of it also could be related to numerical diffusion.
Thank you so much for your help. I applied the changes as you mentioned. relaxtionFactors will be taken care of as well.
Would you please, do me favor, and check whether what I've changed are correct or not and when you have time correct them if I specified them wrongly.

Thanks,

Regards.
Attached Files
File Type: zip simpleFoamValley_Updated.zip (15.2 KB, 11 views)
soheil_r7 is offline   Reply With Quote

Old   December 10, 2017, 22:29
Default
  #4
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
Sounds good. Give it a try and see how does it change the results. Typically a 0.7 relaxation factor for all the fields except for pressure is good. You can find some good values using foamSearch utility. For example you can go to the tutorials directory and do this:

Quote:
cd $FOAM_TUTORIALS/compressible
foamSearch -c . fvSolution relaxationFactors.fields.p
which gives:

Quote:
4 p 0.3;
1 "p.*" 1;
1 p 1;
and for velocity:

Quote:
foamSearch -c . fvSolution relaxationFactors.equations.U
which gives:
Quote:
5 ".*" 1;
4 U 0.7;
1 "U.*" 0.9;
1 U 0.9;
1 "U.*" 1;
1 "(U|h|k|epsilon|omega).*" 1;
The first column gives the number of times the value is used in tutorials.
soheil_r7 likes this.
Taataa is offline   Reply With Quote

Old   December 11, 2017, 13:50
Default
  #5
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
OK!

Once again thanks for your help and your time. It means a lot.

I did implement all the changes. Boundary conditions are updated now according to your advice. relaxation Factors are selected after some tries:

p: 0.4 , U: 0.85, k|epsilon: 0.6.

More than above values solver crashes. Maybe it's because of the mesh quality...It can be improved later if that's the case.

However, after all these, there is no change in velocity at the end of the simulation!
If everything is alright, then why we lose the velocity? This is the question that my supervisor asks me. My supervisor performed a similar geometry with ANSYS, as the contours display (figures attached), at the end of the simulation velocity is 2 m/s everywhere. But, with OpenFoam and these settings I lose velocity which is against the continuity equation I guess.

If I impose a Uinlet of uniform (0 -2 0) at the "inlet2", which is at the top and uniform (2 0 0) at the left, result is completely different. Velocity increases and it won't be less than 2 m/s anywhere. But the problem is we want the velocity along X-Axis everywhere.

So, I really don't know just why and what to do!

Regards,

Soheil;
Attached Images
File Type: png u.png (72.0 KB, 35 views)
File Type: jpg velocityMagnitude.jpg (51.5 KB, 23 views)
File Type: png residuals.png (82.4 KB, 29 views)
File Type: jpg Ansys2.jpg (85.7 KB, 30 views)
Attached Files
File Type: zip cfdOnlineHelp.zip (36.9 KB, 6 views)
soheil_r7 is offline   Reply With Quote

Old   December 11, 2017, 16:22
Default
  #6
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
I didn't notice, your case is 3D and it's relatively huge!

I think the main problem is the mesh, the aspect ratio is too high 63!, you should try to keep it close to 1.

Most importantly, there is a reduction in cross section from left to right why do you expect to have a constant velocity? The simplest form of continuity equation says that flow rates should be the same not the velocities. When the area is increasing the velocity should decrease.
soheil_r7 likes this.
Taataa is offline   Reply With Quote

Old   December 12, 2017, 13:25
Default
  #7
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Thanks!

It makes sense now. I attach two more pictures that exactly shows: "when the area is increasing the velocity should decrease."
So, simulation and boundary conditions are alright for the case. I have to work on improving the mesh and trying to extend the problem to the next level: Modeling the flow when the velocity is almost zero but we have different temperature at left and right..

One more question. Any advice on how to improve the mesh without increasing the cell number to a huge number?! Getting an aspect ratio of almost 1 is challenging in a 3D geometry.. It has to be another way.. instead of just increasing the cell numbers along X,Y,Z axis...maybe adding more blocks somehow..

I do appreciate all your advice. Helped me a lot.

Regards,
Soheil;
Attached Images
File Type: jpg velocityNoSameArea.jpg (46.8 KB, 15 views)
File Type: jpg velocitySameArea.jpg (48.9 KB, 18 views)
soheil_r7 is offline   Reply With Quote

Old   December 12, 2017, 13:56
Default
  #8
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
Well, that's the difficulty of meshing, you should find a balance between accuracy and run time. What people usually do is mesh convergence study. It's the formal way of finding the smallest mesh size while maintaining the desired accuracy. You can google it, there are many good examples and papers on it.

What I would suggest in you case is to start from a smaller domain, say tenth of your current size. Then start running quick simulations with different mesh sizes and see how does it affect the results.
soheil_r7 and piu58 like this.
Taataa is offline   Reply With Quote

Old   December 14, 2017, 03:35
Default
  #9
Member
 
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 9
Alasir is on a distinguished road
An important factor is often the velocity relative to the cell size close to the wall. I advise you to play around with the command "simpleFoam -postProcess -func yPlus", as it will give you a dimensionless number called y+ that you might want to research. Basically you want it below 1 for a lot of CFD models, but some are valid for much higher values.

Many mesh generators allow you to spesify the mesh density at different places, allowing you to have a fine mesh close to the wall and much larger cells in the middle.
soheil_r7 likes this.
Alasir is offline   Reply With Quote

Old   December 17, 2017, 12:44
Default
  #10
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Hello again!

I would be thankful if you could help me one more time.

In previous posts all I wanted to see is how velocity works along the domain. The main objective of this project that I am working on is to see how the fluid behaves/moves along the domain when velocity is almost zero and when we have temperature difference at the inlet and outlet. I just want to simulate possibility of fluid movement and its velocity when we have temperature difference..

As this case is incompressible, the solver that I choosed is "
buoyantBoussinesqSimpleFoam". It seems it's not enough for what I want...When Velocity is Zero it can not converge with the selected boundary conditions. Additionally, temperature difference is not the reason of flow movement...

Do I have to use ideal gas model and compressible solvers (instead of incompressible flow) to see the flow movement when velocity is Zero? Because Energy Equations are located in compressible solvers.

buoyantBoussinesqSimpleFoam solution, results and files are attached to this post. Velocity is considered 2 m/s.

Any guidance is appreciated.

Regards,

Soheil;
Attached Images
File Type: png Residuals.png (81.8 KB, 12 views)
File Type: png U&T.png (70.7 KB, 15 views)
Attached Files
File Type: zip heatCase.zip (17.7 KB, 3 views)
soheil_r7 is offline   Reply With Quote

Old   December 17, 2017, 13:22
Default
  #11
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
I haven't done heat transfer simulations so I can't give you a definite answer but by some googling I found this website that gives you a basic understanding of the solver that can help you to decide if it fits your problem.

Using a compressib solver might be an overkill for your problem I think you can use Boussineq type solvers.
soheil_r7 likes this.
Taataa is offline   Reply With Quote

Old   December 17, 2017, 16:06
Default
  #12
Member
 
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 9
Alasir is on a distinguished road
Its hard to say without a better understanding of WHAT you are trying to model.

If you model water, any compressibility is usually negliblie.

Air in atmospheric conditions are also fairly incompressible.

But if you have a inlet of air into a empty space, then it will expand and fill it far faster than the inlet probably is designed for. And If it is introduced in a higher density, it may also expand!

Further more, heating from the walls may be a problem, but if the velocity of the inlet is high enouch, this effect can be neglible.

In short, you need to have a clear view if what effects you are looking for, in order to best simulate them. If not, you may end up cuasing problems for yourself.

May I recommend drawing a sketch of all the important boundaries, the area, and what you are looking for? Then we may better be able to help you with what assumptions are valid.
soheil_r7 likes this.
Alasir is offline   Reply With Quote

Old   December 21, 2017, 13:02
Default
  #13
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Thanks for the replies and all the help guys. I apologize for the late response. I was trying to figuring the things out and then update the thread. I think I've achieved what I wanted..but I don't know whether it's correct or wrong.

The geometry is a rectangular shape with one inlet (at the left), one outlet (at the right) and rest is wall. Fluid is air. I want to see when temperature at the inlet and outlet is different, how the fluid moves across the domain. [I want to put the flow into movement somehow]. So we need some kind of energy equation and a compressible solver for this. Also, due to buoyancy, density changes (because of temperature differences). So compressible changes needs to be taken to consideration. Thus, the solver "buoyantSimpleFoam" is selected. Attached figures display the Temperature, pressure and Velocity across the domain. Velocity at the inlet is considered fixedValue of zero. After simulation, because of the temperature difference, flow comes to movement.
I would be thankful if you check the boundary conditions and let me know if I can improve it somehow? Residuals plot does not satisfying. So, there has to be some kind of mistakes..
Mesh is coarse..but as it's 3D, I just wanted to make it work for now... However, I tested it with 2D as well and results were the same. [frontAndBack: empty]
I did the simulation with incompressible solver, buoyantBoussinesqSimpleFoam as well, but no velocity calculated.

Any help is appreciated. Hope I was clear about the whole concept.
Attached Images
File Type: png Resid.png (121.0 KB, 16 views)
File Type: png U.png (87.7 KB, 19 views)
File Type: png p.png (51.6 KB, 12 views)
File Type: png T.png (74.1 KB, 12 views)
Attached Files
File Type: zip cfdonline_help.zip (14.7 KB, 4 views)
soheil_r7 is offline   Reply With Quote

Old   December 21, 2017, 13:33
Default
  #14
Member
 
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 9
Alasir is on a distinguished road
You are currently looking at U Magnitude, which is total velocity regardless of direction. You should be able to find Ux, Uy and Uz in paraveiw.

It looks to me that the flow is currently flowing upwards at the left side, following the top to the right side, getting cooled down and sinking, and then getting pulled to the left again. This explains why the flow fluid in the center is still.

Are you currently having any inlets or outlets? Looks to me like the flow is cycling in a circle.
soheil_r7 likes this.
Alasir is offline   Reply With Quote

Old   December 21, 2017, 13:48
Default
  #15
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Pictures from U along X and Y direction is attached. Also uploaded two animation extraced from ParaView to dropBox. [Ux, U_Magnitude]

Yes. I have considered an inlet [at the left] and outlet [at the right].

inlet and outlet BC in the U file is as follows: [internalField uniform (0 0 0);]

Code:
inlet
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    
    outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 0 0);      
    }
and this one is for the p_rgh file: [internalField uniform 101325;]
Code:
inlet
    {
        type            fixedFluxPressure;    
        value           uniform 101325;     
    }

     outlet
    {
        type            fixedValue;
        value           uniform 101325;   
    }
for the T file is: [internalField uniform 300;]

Code:
 inlet
    {
        type            fixedValue;
        value           uniform 350;     
    }
    outlet
    {
        type            fixedValue;
        value           uniform 250;
    }
Attached Images
File Type: png Ux.png (184.5 KB, 13 views)
File Type: png Uy.png (167.9 KB, 11 views)
Alasir likes this.
soheil_r7 is offline   Reply With Quote

Old   December 21, 2017, 14:22
Default
  #16
Member
 
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 9
Alasir is on a distinguished road
Looks like the flow is moving well.

The inlet and outlets are basically heated/cooled walls right now, as long as you keep their velocity fixed as 0.

Was this what you intended?
soheil_r7 likes this.
Alasir is offline   Reply With Quote

Old   December 21, 2017, 15:05
Default
  #17
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Thank you.

Yes, for now this was defined for me to do; hope my professor accepts it! Actually, in the main case the top section has to be inlet as well. (Its picture is attached).
I had some problems in understanding the Boundary Conditions in the beginning.
Attached Images
File Type: png U&T.png (113.5 KB, 16 views)
Alasir likes this.
soheil_r7 is offline   Reply With Quote

Old   December 24, 2017, 12:29
Default
  #18
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
Something is not quit right with you BC. The way I see it, you defined the inlet as a wall then you defined the outlet as an outlet but with a fixed temperature which doesn't sound physical. If it's an outlet you should use a zero gradient or inletOutlet BC for T or if it's a wall you should use noSlip for U and fixedFluxPressure for p, just like the way you defined it at the inlet.
soheil_r7 likes this.
Taataa is offline   Reply With Quote

Old   December 24, 2017, 13:15
Default
  #19
New Member
 
Soheil
Join Date: Mar 2014
Location: Helsinki
Posts: 21
Rep Power: 12
soheil_r7 is on a distinguished road
Thanks.
Yes, you are right. it's an "outlet" so I've changed it to inletOutlet BC for T. I tested it with zeroGradient for T as well. Residuals plot acts differently. I think with a zeroGradient it gives a better results but can't specify a value for T in this case (for example 295 Kelvin). Pictures are attached from two cases.
Attached Images
File Type: jpg T_zeroGradient.jpg (46.5 KB, 6 views)
File Type: png Res_zeroGradient.png (140.7 KB, 10 views)
File Type: jpg T_U_inletOutlet.jpg (48.3 KB, 7 views)
File Type: png res_inletOutlet.png (153.3 KB, 14 views)
soheil_r7 is offline   Reply With Quote

Old   December 25, 2017, 00:57
Default
  #20
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
It shows that there is problem in your solution and/or schemes. I would suggest you to use the inletOutlet play with solution and schemes parameters like reduce the tolerances to 1e-8 for all the fields as well as the relaxation factors. Start by 0.3 for pressure and 0.7 for the rest. Also, in the schemes the normal gradient scheme for Laplacian and snGradSchemes are usually the same. Since your mesh is pretty simple you can orthogonal for both or limited 1 which in this case you need to set the nNonOrthogonalCorrectors in the solution to at least 1. I would suggest you to read this and this pages to get a better sense of the parameters.
soheil_r7 likes this.
Taataa is offline   Reply With Quote

Reply

Tags
simplefoam, velocity


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD by anderson, chp 10.... supersonic flow over flat plate varunjain89 Main CFD Forum 18 May 11, 2018 08:31
3-D parabolic velocity Inlet - Steady state - UDF Turbulent Flow mohibanwar Fluent UDF and Scheme Programming 10 May 18, 2015 11:34
How to get a plot of fluctuating velocity component{u'(t)} in a turbulent flow TQIM STAR-CCM+ 7 November 11, 2014 11:22
Time averaged velocity in turbulent pipe flow tsero FLUENT 1 November 2, 2012 04:19
Turbulent flow through a pipe with variable inlet velocity lobstar OpenFOAM Running, Solving & CFD 8 March 28, 2012 12:15


All times are GMT -4. The time now is 08:41.