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

Relative roughness in openfoam

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

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 16, 2013, 05:44
Default Relative roughness in openfoam
  #1
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
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?
inf.vish is offline   Reply With Quote

Old   August 16, 2013, 06:06
Default
  #2
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
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 4 others like this.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 16, 2013, 07:01
Default
  #3
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
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.
inf.vish is offline   Reply With Quote

Old   August 16, 2013, 09:29
Default
  #4
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 19, 2013, 00:20
Default
  #5
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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.
inf.vish is offline   Reply With Quote

Old   August 19, 2013, 13:37
Default
  #6
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 20, 2013, 00:09
Default
  #7
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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.
inf.vish is offline   Reply With Quote

Old   August 20, 2013, 00:57
Default
  #8
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
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
inf.vish is offline   Reply With Quote

Old   August 20, 2013, 05:02
Default
  #9
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 20, 2013, 06:14
Default
  #10
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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?
inf.vish is offline   Reply With Quote

Old   August 20, 2013, 06:23
Default
  #11
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 20, 2013, 06:35
Default
  #12
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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.

Thanks in advance
inf.vish is offline   Reply With Quote

Old   August 23, 2013, 08:21
Default
  #13
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
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.
please try Quoting my above text into the thread to continue.

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
inf.vish is offline   Reply With Quote

Old   August 23, 2013, 14:25
Default
  #14
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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?
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 26, 2013, 00:23
Default
  #15
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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.
inf.vish is offline   Reply With Quote

Old   August 26, 2013, 03:12
Default
  #16
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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/
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 27, 2013, 01:53
Default
  #17
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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 04:27.
inf.vish is offline   Reply With Quote

Old   August 27, 2013, 06:35
Default
  #18
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by inf.vish View Post
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
{
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
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   August 27, 2013, 07:58
Default
  #19
Member
 
Vishal
Join Date: Jul 2013
Posts: 73
Rep Power: 12
inf.vish is on a distinguished road
Quote:
Originally Posted by Mojtaba.a View Post
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.
inf.vish is offline   Reply With Quote

Old   August 27, 2013, 12:59
Default
  #20
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
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<<epsilon (whatever be the value of k and epsilon) I obtain solutions which are very very close to each other.
Well I have no idea about this.

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.

Right now I have found this article which is quite useful:
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

I am studying about this. You have got to give me some time.
Dig them out, maybe you can get what I can't.

I hope it helps a bit,
Best,
Mojtaba
Bob! likes this.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Memory protection in OpenFOAM / combinig with FORTRAN botp OpenFOAM Programming & Development 2 February 15, 2016 13:25
ESI-OpenCFD Releases OpenFOAM v2.2.0 opencfd OpenFOAM Announcements from ESI-OpenCFD 13 March 30, 2013 17:52
[Gmsh] gmsh 2.6.0 conversion to OpenFoam 160 rosswin OpenFOAM Meshing & Mesh Conversion 0 March 5, 2013 08:34
[mesh manipulation] createPatch / cyclicGgi / OpenFoam 1.5-dev OFU OpenFOAM Meshing & Mesh Conversion 0 June 16, 2010 05:36
Cross-compiling OpenFOAM 1.6 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 7 January 19, 2010 16:39


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