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

Surface roughness

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2008, 10:06
Default Hi. I have recently started
  #1
New Member
 
David Egede Fich
Join Date: Mar 2009
Location: Aalborg, Denmark
Posts: 1
Rep Power: 0
daefi is on a distinguished road
Hi.

I have recently started modelling in OpenFOAM and I need to run a kEpsilon model on a duct with surface roughness on the bottom wall.

Is there any way to do this in OpenFOAM? I fear that I have to write the C++ code on my own which would probably take more time than I have.

Sincerely David Fich
daefi is offline   Reply With Quote

Old   September 29, 2008, 06:32
Default Hi, I have a similar proble
  #2
New Member
 
Andrea M.A. Barbera
Join Date: Mar 2009
Location: Turin, Italy
Posts: 7
Rep Power: 17
andrea_barbera is on a distinguished road
Hi,

I have a similar problem and I have discovered that a way to consider roughness is perhaps already implemented. Unfortunately I'm not able to apply it.

In the folder ~/OpenFOAM/OpenFOAM-1.5/src/turbulenceModels/RAS/compressible/wallFunctions/mutW allFunctions/mutStandardRoughWallFunction
a BC which allows to consider roughness is implemented, but, sincerely, I do not understand how to apply it (to K or Epsilon, perhaps?)
and what is the meaning of the two constants
"roughnessConstant" and "roughnessFudgeFactor".

Can someone please illustrate how to apply this BC?

Regards

Andrea
andrea_barbera is offline   Reply With Quote

Old   September 29, 2008, 09:35
Default Hi Andrea and David A lot o
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Andrea and David

A lot of discussions about roughnesses and turbulencemodels can be found here:

http://www.cfd-online.com/OpenFOAM_D...es/1/5791.html

Please note that it contains some of my own work, and that it has not been validated. Just implemented directly out of the textbook.

Best regards
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   November 24, 2008, 03:07
Default I have added surface roughness
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
I have added surface roughness according to the fluent manual.
found for instance here http://web.njit.edu/topics/Prog_Lang_Docs/html/FLUENT/fluent/fluent5/ug/html/nod e195.htm

What I did was to add

Ks_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ks",
subDict("wallFunctionCoeffs"),
0.0
)
),

Cs_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cs",
subDict("wallFunctionCoeffs"),
0.0
)
),

to RASModel.H and the corresponding stuff in RASModel.C

and in wallViscosityI.H i modified the for-loop to

forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];

scalar uStar = Cmu25*sqrt(k_[faceCelli]);
scalar yPlus = y_[patchi][facei]*uStar/nuw[facei];
scalar KsPlus = Ks_.value()*uStar/nuw[facei];

// hydrodynamically smooth
scalar logDB = 1.0;

if (KsPlus > 2.25)
{
// fully rough
if (KsPlus > 90.0)
{
logDB = 1.0 + Cs_.value()*KsPlus;
}
else
// transitional
{
scalar n = ::sin(0.4258*(log(KsPlus) - 0.811))
scalar a = (KsPlus - 2.25)/87.75 + Cs_.value()*KsPlus;
logDB = ::pow(a, n);
}
}

if (yPlus > yPlusLam_)
{
nutw[facei] =
nuw[facei]
*(yPlus*kappa_.value()/log(E_.value()*yPlus/logDB) - 1);
}
else
{
nutw[facei] = 0.0;
}
}

using the facts that
log(A)-log(B) = log(A/B)
log(A)*n = log(A^n)

you essentially just need to divide the wall constant E with the variable logDB.

Normally setting the constants to zero would revert to the normal smooth approach, but not here and that is easily fixed also.
But is there anything else I need to modify that I have missed or is this all I have to do?

N
niklas is offline   Reply With Quote

Old   January 26, 2009, 10:54
Default Dear Niklas, thanks for your
  #5
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Dear Niklas,
thanks for your contribution, the piece of code you pasted above is exactly what I need! I have a couple of questions for you:
1) What do you mean when you said: "you essentially just need to divide the wall constant E with the variable logDB"? Do you mean I need to do some extra calculation in order to define properly E in the RASProperty file? Or can I set E arbitrairly, i.e. to zero?
2) Is this piece of code tested for OF 1.5? I think so, but I just want to be sure...
Thanks!
Mad
maddalena is offline   Reply With Quote

Old   January 27, 2009, 03:47
Default Maybe this makes it abit clear
  #6
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Maybe this makes it abit clearer
http://openfoamwiki.net/index.php/Ho...eWallRoughness
niklas is offline   Reply With Quote

Old   January 27, 2009, 05:59
Default Hi Niklas, one more basic q
  #7
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Niklas,

one more basic question... Since I do not want to change OF original files, I want to copy the turbFoam solver, rename it and change references to the new IncompressibleWallRoughness RANS, that I will copy as well. Thus, I followed the user guide:

1) take $WM_PROJECT_DIR/applications/solvers/incompressible/turbFoam and copy it to $WM_PROJECT_USER_DIR/applications/solvers/myFoam
2) change filename turbFoam.C to myFoam.C
3) change /Make/files to match my application name
4) change EXE = $(FOAM_APPBIN)/turbFoam to EXE = $(FOAM_USER_APPBIN)/myFoam
5) wclean and wmake libso

No error displayed during the compilation. However, when I want to use myFoam as a solver, I get bash: myFoam: command not found. It seems that my solver is not defined. I am sure I am missing something, but I do not know what!!! Could you help me? Thanks a lot!

Mad
maddalena is offline   Reply With Quote

Old   January 27, 2009, 06:19
Default I got it! I missed this: rm -r
  #8
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
I got it! I missed this: rm -rf linuxGccDP0pt after point 4)! ;O)
maddalena is offline   Reply With Quote

Old   January 27, 2009, 07:56
Default by not specifying the Ks and C
  #9
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
by not specifying the Ks and Cs values, the original way of doing things will be used. (or by setting Ks to zero).

no need to copy turbFoam, nothing will change there.
niklas is offline   Reply With Quote

Old   March 18, 2009, 10:47
Default Variable Roughness
  #10
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 17
Xabi is on a distinguished road
Hi all!

I am interested in applying a variable roughness along a surface (wall). Does anyone know whether it is possible or not using OpenFoam? Every post I read and code i see, roughness was considered constant ...
Thanks in advance,

X
Xabi is offline   Reply With Quote

Old   March 18, 2009, 10:50
Default
  #11
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by Xabi View Post
Hi all!

I am interested in applying a variable roughness along a surface (wall). Does anyone know whether it is possible or not using OpenFoam? Every post I read and code i see, roughness was considered constant ...
Thanks in advance,

X
When you say variable, is it a function variable, or do you have different walls with different constants?
niklas is offline   Reply With Quote

Old   March 19, 2009, 06:30
Default
  #12
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 17
Xabi is on a distinguished road
Quote:
Originally Posted by niklas View Post
When you say variable, is it a function variable, or do you have different walls with different constants?
Hi,

It is a function variable.I have wall and the roughness is different in each point.
Regards
Xabi is offline   Reply With Quote

Old   March 19, 2009, 06:53
Default
  #13
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by Xabi View Post
It is a function variable.I have wall and the roughness is different in each point.
Regards
OK..........
and the function is?
niklas is offline   Reply With Quote

Old   March 26, 2009, 07:43
Default constant roughness
  #14
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 17
Xabi is on a distinguished road
Hi Niklas,

Before starting with variable roughness I finally decided to implement first a simple constant roughness. I found your piece of code and I add it and had a little problem.
It is quite strange because although Cs_ and Ks_ are declared in Rasmodel.c and set up in Rasmodel .h I get an error saying :

.../wallFunction/wallViscosityI.H : error :'Cs_' was not declared in the scope.

.../wallFunction/wallViscosityI.H : error :'Ks_' was not declared in the scope.

And its strange because the definition of kappa as well as E is the same as Cs and Ks and everything it is ok with them.

so Do you know why it can be?
Thank you.

Quote:
Originally Posted by niklas View Post
OK..........
and the function is?
Xabi is offline   Reply With Quote

Old   March 28, 2009, 23:44
Default Save Ks+ field
  #15
New Member
 
Qi Ying
Join Date: Mar 2009
Posts: 6
Rep Power: 17
maurice is on a distinguished road
Hi All,

I am a new user of OF and I justed added Niklas's roughness wall code mentioned in this thread. I would like to write a postprocessing code that saves the KsPlus values just like the yPlusRAS utility.

I know KsPlus=uStar*Ks/nuw but how can I access uStar, Ks and nuw in the program. I am trying to modify the yPlusRAS code but don't know how to get these variables. Any help is appreciated.

Thanks,

Qi
maurice is offline   Reply With Quote

Old   April 26, 2009, 23:22
Default
  #16
New Member
 
Nestor Rueda
Join Date: Mar 2009
Posts: 9
Rep Power: 17
ruedavallejo is on a distinguished road
hi Niklas

maybe i'm forgetting something but I modified all the files mentioned in the wiki and recompiled again, but I do not get any change in my results when I change the values of Cs, Ks. could you tell me what I'm forgetting? I'm usign k-e, simplefoam. I would expect to see a pressure drop with the increase of Ks.

Regards
Nestor
ruedavallejo is offline   Reply With Quote

Old   April 26, 2010, 05:43
Default
  #17
New Member
 
Peter Skrifvars
Join Date: Oct 2009
Posts: 3
Rep Power: 17
Skrifvars is on a distinguished road
Hi,
I did the changes (OF1.5) described in the Wiki page (or I thought I did) and I get the following
error:

LHS and RHS of + have different dimensions
dimensions : [0 2 -3 0 0 0 0] + [0 2 -2 0 0 0 0]
Skrifvars is offline   Reply With Quote

Old   May 21, 2010, 03:56
Default define Ks and Cs
  #18
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
I am working with OF 1.6. I would like to know, where I should define the variables Ks and Cs when i am using roughWallfunctions. Must this be done in the RasProperties file or some where else. What I have to write to force Ks and Cs?

Regards Chrisi
Chrisi1984 is offline   Reply With Quote

Old   November 21, 2012, 07:09
Default
  #19
New Member
 
Burak
Join Date: Nov 2012
Posts: 14
Rep Power: 14
Burak_1984 is on a distinguished road
Quote:
Originally Posted by niklas View Post
OK..........
and the function is?
Hello Maybe it's a long history but I couldn't find the answer

I have terrain map I want to add roughness lenght to z0.I am trying to convert the simpleFOAM case for wind turbine siting;There the z0 roughness height is defined in ABLconditions as a single value.I would like to include a matrix to define the roughness on the ground patch.

At least I would like to create a patch saying "the points inside the patch should have z0=0.1 instead of z0=0.05"so being able to manually include the variable roughness crudely.

Is this possible? Here Mr. Hanael compiled a code that implements Mr.Tapia's Master Thesis as basis.

https://github.com/hananel/roughnessToFoam

However I don't have wasp *.map file, only coordinates and roughness values and I don't quite get the idea to implement a OpenFOAM source code.

How does for example internalField nonuniform List<Vector> work out?How can I call the <Vector> part from another file.I guess my solution lies there.

Many thanks
Regards
Burak
Burak_1984 is offline   Reply With Quote

Old   May 9, 2013, 07:14
Default
  #20
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by Burak_1984 View Post
Hello Maybe it's a long history but I couldn't find the answer

I have terrain map I want to add roughness lenght to z0.I am trying to convert the simpleFOAM case for wind turbine siting;There the z0 roughness height is defined in ABLconditions as a single value.I would like to include a matrix to define the roughness on the ground patch.

At least I would like to create a patch saying "the points inside the patch should have z0=0.1 instead of z0=0.05"so being able to manually include the variable roughness crudely.

Is this possible? Here Mr. Hanael compiled a code that implements Mr.Tapia's Master Thesis as basis.

https://github.com/hananel/roughnessToFoam

However I don't have wasp *.map file, only coordinates and roughness values and I don't quite get the idea to implement a OpenFOAM source code.

How does for example internalField nonuniform List<Vector> work out?How can I call the <Vector> part from another file.I guess my solution lies there.

Many thanks
Regards
Burak
Hello Burak,
Have you found any solutions to this?
Before reading your post, I was dividing my ground surface into multiple surfaces using my CAD program, and then in the next step, I defined each of those surfaces as separate wall boundary conditions, and at last in openFOAM while assigning boundary conditions, I set different z0 values for each of those surfaces. I mean something like this:

ground_rough
{
type nutkAtmRoughWallFunction;
value uniform 0;
z0 $z0_rough;
}

ground_smooth
{
type nutkAtmRoughWallFunction;
value uniform 0;
z0 $z0_smooth;
}

But, I think this is wrong. because I see some discontinuities between borders of these surfaces.
Now that I have read your post, I think it is a great idea to use nonuniform List<Vector> to define various z0 values to a surface and not by dividing it into multiple surfaces. but right now I have no idea how to define z0 value for each surface cells. Do you have anything in mind to share with me?

Thank you,
Warmest wishes,
Mojtaba
__________________
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


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
Surface roughness Rajesh CFX 1 February 10, 2008 17:36
surface roughness in HTC Trang CFX 0 August 4, 2007 04:51
CCM+ Surface Roughness AJ Siemens 3 March 8, 2006 19:14
surface roughness sankar Siemens 1 November 8, 2004 11:36
Surface roughness Peter Main CFD Forum 9 July 19, 2001 12:29


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