# Relative roughness in openfoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 16, 2013, 04:44 Relative roughness in openfoam #1 Member   Vishal Join Date: Jul 2013 Posts: 73 Rep Power: 6 How to incorporate relative roughness in openfoam? I am using pisoFoam to solve a simple turbulent flow through a pipe. I want to validate the result using Moody's chart, where i specify reynolds number and relative roughness to openfoam and check if the frcition factor given by openfoam matches with the value from moody's chart. Do we have to use nutkRoughWallFunction? If yes then what do Ks and Cs mean, and where do i find their values? Also, what is the default relative roughness used by openfoam?

 August 16, 2013, 05:06 #2 Senior Member     Mojtaba Amiraslanpour Join Date: Jun 2011 Location: Zanjan, Iran Posts: 291 Rep Power: 9 Hi, I strongly recommend you to study this article: Blocken, B., Stathopoulos, T., Carmeliet, J., 2007. CFD simulation of the atmospheric boundary layer: wall function problems. Atmospheric Environment 41 (2), 238–252. Also check this thread out: http://www.cfd-online.com/Forums/ope...h-surface.html You can see nutkRoughWallFunction source file to see how are they defined. Cs values is something between 0 to 1, but typically it is considered 0.5. Ks (It is called equivalent sand-gran roughness height) differs from case to case, it is often calculated by: Ks = (20 to 30)*y0 in which, y0 is aerodynamic roughness length. a rule of thumb for values of y0 is 0.1 of the real roughness value. for example if height of the roughness is 0.1 m then y0 would be 0.01 m. I hope it helps a bit. Best nimasam, waku2005, Tobi and 3 others like this. __________________ Learn OpenFOAM in Persian for free, And ask your questions here. Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

 August 16, 2013, 06:01 #3 Member   Vishal Join Date: Jul 2013 Posts: 73 Rep Power: 6 Okay i just realised that my way of validating turbulent flow is wrong. Can you tell me how to validate a turbulent flow using some analytical results, like we have poiseuille's law for laminar flow.

August 16, 2013, 08:29
#4
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish Okay i just realised that my way of validating turbulent flow is wrong. Can you tell me how to validate a turbulent flow using some analytical results, like we have poiseuille's law for laminar flow.
Well, I am not familiar with this but maybe you can validate it using analytical turbulent flow velocity profiles which are carried out of Moody's diagram.

hope it helps.
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 18, 2013, 23:20
#5
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a you can validate it using analytical turbulent flow velocity profiles which are carried out of Moody's diagram.
I do not quite get your point over here. The only way you can validate using Moody's chart is that you know Reynolds number and relative roughness and you obtain friction factor from openfoam and check whether that value matches with what is given by Moody's chart.

How do i calculate relative roughness from Ks and Cs values? And how do i get the friction factor from openfoam?

I read the nutkRoughWallFunction files and understood what Ks and Cs mean but there is no mention of how to obtain relative roughness from them.

August 19, 2013, 12:37
#6
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish I do not quite get your point over here. The only way you can validate using Moody's chart is that you know Reynolds number and relative roughness and you obtain friction factor from openfoam and check whether that value matches with what is given by Moody's chart. How do i calculate relative roughness from Ks and Cs values? And how do i get the friction factor from openfoam? I read the nutkRoughWallFunction files and understood what Ks and Cs mean but there is no mention of how to obtain relative roughness from them.

OK, first of all, what do you mean by relative roughness? do you mean y0?

I haven't worked with nutkRoughWallFunction for a while and forgot some, I think you define Ks values as an input data.

Well friction factor can be obtained using wall shear stress, as you know:

Cf=Tau/(0.5*rho*U^2)

In which Tau is wall shear stress.

You can calculate wall shear stress with a utility named as "wallShearStress" in openfoam. later you can calcluate Cf in paraview using its calculator according to rho and U values.
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 19, 2013, 23:09
#7
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a OK, first of all, what do you mean by relative roughness? do you mean y0? I haven't worked with nutkRoughWallFunction for a while and forgot some, I think you define Ks values as an input data. Well friction factor can be obtained using wall shear stress, as you know: Cf=Tau/(0.5*rho*U^2) In which Tau is wall shear stress. You can calculate wall shear stress with a utility named as "wallShearStress" in openfoam. later you can calcluate Cf in paraview using its calculator according to rho and U values.
Hmm. Okay I will try that. Relative roughness means e/D. The right hand scale on moody's chart.

Also, Cf is skin friction factor. I believe it is not the same as the friction factor f which is on the left hand scale of moody's chart. According to texts - friction factor is calculated experimentally. So the approach i am using is wrong.

 August 19, 2013, 23:57 #8 Member   Vishal Join Date: Jul 2013 Posts: 73 Rep Power: 6 There is one more problem though. This is the test case i am trying out. Just to learn about turbulence. But even at 10^6 reynolds number i am getting laminar streamlines. Can you look up and tell me what is wrong with the problem. Assume smooth walls. test.zip

August 20, 2013, 04:02
#9
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish Hmm. Okay I will try that. Relative roughness means e/D. The right hand scale on moody's chart. Also, Cf is skin friction factor. I believe it is not the same as the friction factor f which is on the left hand scale of moody's chart. According to texts - friction factor is calculated experimentally. So the approach i am using is wrong.
Hmm, well I am not sure about this but as far as I know, Cf is called "Fanning friction factor". In the other hand, Fanning friction factor is one-fourth of the Darcy friction factor. As you know most of the time Darcy friction factor is used in Moody's diagram.

I couldn't get why your approach is wrong.
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 20, 2013, 05:14
#10
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a Hmm, well I am not sure about this but as far as I know, Cf is called "Fanning friction factor". In the other hand, Fanning friction factor is one-fourth of the Darcy friction factor. As you know most of the time Darcy friction factor is used in Moody's diagram. I couldn't get why your approach is wrong.
Yes you are quite right. Cf is called the fanning friction factor. And you can calculate Darcy friction factor using Colebrook equation.

Now my conclusion is - Obtain Fanning friction coefficient Cf using wallShearStress and then multiply it by 4 to get Darcy friction factor and use Moodys chart with Reynolds number and relative pipe roughness to verify the friction factor.

Thanks a lot. I think this solves my problem. Can you also take a look at another problem which i posted right before your current reply?

August 20, 2013, 05:23
#11
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish Thanks a lot. I think this solves my problem. Can you also take a look at another problem which i posted right before your current reply?
Well I'm not a turbulence expert, but sure, I will take a look at it
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 20, 2013, 05:35
#12
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a Well I'm not a turbulence expert, but sure, I will take a look at it
It is a very simple problem. I have been stuck on it for quite a while and honestly, it is getting quite frustrating now.

August 23, 2013, 07:21
#13
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
Originally Posted by Mojtaba.a
Quote:
Originally Posted by inf.vish
Quote:
 Originally Posted by Mojtaba.a Dear Vishal, I haven't tried it yet. heavy days . Maybe your k values is too low or your epsilon values are too high.
Oh it's okay. I will try changing the values of k and epsilon. I read somewhere on the forum that the values of k and epsilon do not matter. So if i set them 0 it should simulate properly. am i right?
Nope, not 0. You have actually turned off turbulence. give flow some turbulence.
I don't know the approximated values of k & epsilon for your case but lets start by 0.1 for both of them.

If it is possible lets go back to thread and continue this in there.

best wishes,
Mojtaba
I tried with k and epsilon = 0.1
The results look similar. The velocity is not blowing. Input bein 1 m/s i am getting a maximum velocity of around 1.98 m/s.

The results still look laminar - U.jpg

August 23, 2013, 13:25
#14
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish I tried with k and epsilon = 0.1 The results look similar. The velocity is not blowing. Input bein 1 m/s i am getting a maximum velocity of around 1.98 m/s. The results still look laminar - Attachment 24777
Dear Vishal which turbulence model are you using and what are your yPlus values?
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 25, 2013, 23:23
#15
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a Dear Vishal which turbulence model are you using and what are your yPlus values?
Hello, Sorry for the late reply. Weekends.

These are my yPLus values yPlus.txt

Also, I am using k-epsilon turbulence model.

August 26, 2013, 02:12
#16
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish Hello, Sorry for the late reply. Weekends. These are my yPLus values Attachment 24826 Also, I am using k-epsilon turbulence model.
Well actually kE is not a very strong model in simulating near wall flows. Plus your y+ values are high for this purpose.

You have got to use kOmegaSST model alongside with a finer grid to be able to resolve the boundary layer.

Try take a look at these:

http://www.computationalfluiddynamic...t-cell-height/
http://www.computationalfluiddynamic...oundary-layer/
http://www.computationalfluiddynamic...oundary-layer/
http://www.computationalfluiddynamic...ds-number-cfd/
http://www.computationalfluiddynamic...-requirements/
http://www.computationalfluiddynamic...nce-modelling/
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 27, 2013, 00:53
#17
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a Well actually kE is not a very strong model in simulating near wall flows. Plus your y+ values are high for this purpose. You have got to use kOmegaSST model alongside with a finer grid to be able to resolve the boundary layer. Try take a look at these: http://www.computationalfluiddynamic...t-cell-height/ http://www.computationalfluiddynamic...oundary-layer/ http://www.computationalfluiddynamic...oundary-layer/ http://www.computationalfluiddynamic...ds-number-cfd/ http://www.computationalfluiddynamic...-requirements/ http://www.computationalfluiddynamic...nce-modelling/
I have no idea about y+. I am an undergraduate student and have to do openfoam as part of my internship. I have no prior knowledge of CFD and turbulence models. Thus it is very difficult for me to understand OpenFOAM. I will try reading the links you have given.

Also, for kOmegaSST what boundary conditions should i use?

Is it possible for you to simulate the problem and send me the files? I have been trying this problem for 3 weeks now and not able to understand anything.

Last edited by inf.vish; August 27, 2013 at 03:27.

August 27, 2013, 05:35
#18
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by inf.vish I have no idea about y+. I am an undergraduate student and have to do openfoam as part of my internship. I have no prior knowledge of CFD and turbulence models. Thus it is very difficult for me to understand OpenFOAM. I will try reading the links you have given. Also, for kOmegaSST what boundary conditions should i use? Is it possible for you to simulate the problem and send me the files? I have been trying this problem for 3 weeks now and not able to understand anything.
for keOmegaSST, instead of having k and epsilon you have got k and omega.

you have to make a new initial boundary file named omega in your 0 directory and use omegaWallFunction for your wall boundaries. For example:

wall
{
type omegaWallFunction;
value uniform 0;
}

outlet
{
}

inlet
{
type fixedValue;
value uniform 0.0001;
}

try having a look at this thread:

http://www.cfd-online.com/Forums/ope...omega-sst.html

I hope it helps a bit ,
Best
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

August 27, 2013, 06:58
#19
Member

Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 6
Quote:
 Originally Posted by Mojtaba.a for keOmegaSST, instead of having k and epsilon you have got k and omega. you have to make a new initial boundary file named omega in your 0 directory and use omegaWallFunction for your wall boundaries. For example: wall { type omegaWallFunction; value uniform 0; } outlet { type zeroGradient; } inlet { type fixedValue; value uniform 0.0001; } try having a look at this thread: http://www.cfd-online.com/Forums/ope...omega-sst.html I hope it helps a bit , Best
Thanks I will try.
One more question, do the values of k and omega (or epsilon) affect the final solution?
I was trying out various values but found that for k>epsilon i get floating point exception on the courant number and for k<<epsilon (whatever be the value of k and epsilon) I obtain solutions which are very very close to each other.

from what i have read y+ should be between 30-300 right?

Also I was looking at pitzDaily example from pisoFoam>LES, there you can see vortices but on running the same simulation with say kE you do not get the vortices. I read somewhere on the forum that LES is better at capturing vortices as with kE or kOmega the viscous forces dampen the vortices.

August 27, 2013, 11:59
#20
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 One more question, do the values of k and omega (or epsilon) affect the final solution?
They will effect the final results as they are the values for kinetic energy and dissipation frequency.

Quote:
 I was trying out various values but found that for k>epsilon i get floating point exception on the courant number and for k<

Quote:
 from what i have read y+ should be between 30-300 right?
If you are using wall functions, yes. But right now by using a low reynolds turbulence model this value have got to be less than 1.
Therefore by using kOmegaSST model, you have got to lower your y+ value to something lower than 1.

Quote:
 Also I was looking at pitzDaily example from pisoFoam>LES, there you can see vortices but on running the same simulation with say kE you do not get the vortices. I read somewhere on the forum that LES is better at capturing vortices as with kE or kOmega the viscous forces dampen the vortices.
That's right. LES is very powerful, hence it can resolve the whole boundary layer, but one drawback is its computational cost.

www.engmech.cz/2012/proceedings/pdf/195_Furst_J-FT.pdf‎

It uses openFOAM and a new turbulence model which is best for laminar turbulent transition modeling.

And plus take a look at this:
http://www.cfd-online.com/Forums/ope...el-low-re.html

Dig them out, maybe you can get what I can't.

I hope it helps a bit,
Best,
Mojtaba
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post botp OpenFOAM Programming & Development 2 February 15, 2016 13:25 opencfd OpenFOAM Announcements from ESI-OpenCFD 13 March 30, 2013 17:52 rosswin Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 March 5, 2013 08:34 OFU OpenFOAM Meshing & Mesh Conversion 0 June 16, 2010 04:36 wyldckat OpenFOAM Announcements from Other Sources 7 January 19, 2010 16:39

All times are GMT -4. The time now is 03:10.