|
[Sponsors] |
nutRoughWallFunction and Surface Roughness Documented |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 31, 2009, 01:48 |
nutRoughWallFunction and Surface Roughness Documented
|
#1 |
Member
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 17 |
In the interest of documentation, I offer the following:
I'm modeling atmospheric boundary layer flow and need to use rough walls with carefully defined surface roughness. A forum search turned up a nice piece of code to implement the FLUENT surface roughness http://www.cfd-online.com/Forums/ope...roughness.html. I decided to try it - only to find that it's obsoleted by a new function in 1.6 - which I didn't see in the release notes. Using a standard RAS k-epsilon turbulence model, in the /0/nut file replace 'nutWallFunction' with 'nutRoughWallFunction.' To make this work, you need to specify Ks (sand grain roughness height in meters) and Cs, the roughness constant (the link above takes you to the wiki and a good explanation of the model. After some trial and error, I found the correct syntax (for roughness height = 1 mm and Cs = 0.5 is the FLUENT default value - appropriate for pipe flow). { type nutRoughWallFunction::Ks; value uniform 0.001; type nutRoughWallFunction::Cs; value uniform 0.5; } After finding this, I searched nutRoughWallFunction in the forums. There is a thread in bug fixes: apparently the code in 1.6 resets itself and gives very low values of roughness. This was fixed in version 1.6.x (reported in October). The current git version of 1.6.x should work correctly. For anyone interested in atmospheric roughness, there's a simple conversion. This was part of my master's thesis (my research done in Fluent, I'm now switching to OpenFOAM). Ks = atmospheric roughness height * 30. Cs = 0.327. I found this in a peer reviewed journal, tested it in FLUENT simulations, and subsequently found very similar conversions in other journal articles. Please correct my documentation if anyone finds mistakes - I'm still pretty new at this. Also, please feel free to add. I spent several hours today figuring this out - I learned quite a bit and got surface roughness working in my simulation. I have learned a lot from this forum over the last few months - today, I'm taking the opportunity to give something in return. |
|
February 12, 2010, 09:56 |
|
#2 |
Member
Aniko Rakai
Join Date: Oct 2009
Location: Geneva
Posts: 30
Rep Power: 16 |
Hi Alan, I followed your instructions and so far everythings goes fine, thanks, I think you saved me a few hours of forum search at least, I used the git version straigh.
And I'm also trying to use it for atmospheric flows |
|
February 12, 2010, 14:20 |
|
#3 |
Member
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 17 |
Ancsa, I'm glad the message was useful to someone - you are the first to reply.
How are you generating meshes? I'm having my share of problems with snappyHexMesh - I can only get down 10 meter resolution before I run into problems - cells in the x direction get refined and in the y direction do not. Do you have a good method? Thanks, Alan |
|
February 15, 2010, 03:43 |
|
#4 |
Member
Aniko Rakai
Join Date: Oct 2009
Location: Geneva
Posts: 30
Rep Power: 16 |
I'm sorry but I have no good method, I have just started with OpenFOAM and I'm using an ex-fluent mesh to compare the results.
|
|
February 16, 2010, 08:43 |
|
#5 |
Member
Sylvain Aguinaga
Join Date: Feb 2010
Posts: 41
Rep Power: 16 |
Hi Alan,
Thanks for the contribution. I’m also working on the surface roughness problem for atmospheric flow. I followed your advices, it’s working but it seems that the values you specify in the nut file are not taken into account. For example, if you specify negative values or extremely high values for Ks an Cs, the results are always the same. I have recompiled the git version and specified Ks and Cs as you did, but it is always the same. Did you try to specify obvious rubbish (Chris Greeshields all rights reserved)? I have asked my colleagues regarding the atmospheric roughness, you can indeed specify Ks=30*atmospheric roughness, but you have also to modify Cs to compensate. The problem is that the Ks you obtain is much more important than the wall cell size. Ks cannot be greater than half the wall cell size. Following a paper from Blocken 2007 you can specify Ks as half the wall cell size (almost) and you specify Cs according a formula Cs=E/Ks*z0 with E=9.73 and z0 the real roughness value. In Fluent, it seems that you cannot specify a Cs greater than 1, expect via an UDF. That’s why it would be nice if you could do it in OpenFOAM. Regarding the snappyHexMesh thing I’m not yet so confident, but the cells should be split by 2^level in the three directions. More, if you use the add_layers you should be able to specify a small cell size at the wall. Meshing complex topology will be my next step, once I have understood how the roughness is working on a simple plate. Thanks again for you help. Sylvain |
|
February 16, 2010, 09:36 |
|
#6 |
Member
Aniko Rakai
Join Date: Oct 2009
Location: Geneva
Posts: 30
Rep Power: 16 |
Isn't it from the nutRoughWallFunctionFvPatchScalarField.C filter out the small Ks values?:
scalar Edash = E_; if (KsPlus > 2.25) { Edash /= fnRough(KsPlus, Cs_[faceI]); } if Ks is too small the original E is taken into consideration as I understand. I will also check the difference running with nut and nutRough wall function. |
|
March 22, 2010, 10:20 |
roughnessHeight and roughnessConstant
|
#7 |
New Member
Join Date: Mar 2010
Posts: 6
Rep Power: 16 |
Hi Sylvain
I have just seen your message and I have the same problem as you: reconstructing the results of Blocken et al. (2007) does not work. Specifying different values for Ks and Cs always leads to the same result. I suppose this is the reason for the strange plots I get. Have you already managed to solve the problem? It would be nice if you could give me a hint how to get a (more or less) horizontally homogeneous wind profile. Thanks in advance. Irina |
|
March 22, 2010, 10:29 |
|
#8 |
Member
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 17 |
Irina,
I ran a simulation over a flat domain yesterday (by mistake actually) and ended up with a nicely converged solution and a consistent profile. I set Ks = 1.2 and Cs = 0.327. The model was simpleFoam, K-epsilon. I set the inlet profile using timeVeryingMappedFixedValue and it hardly changed across the domain - roughly 1 km wide. You also need to be careful with k and epsilon, both of which can affect the profile across the domain. Alan |
|
April 16, 2010, 08:38 |
Sensitivity of Ks value for nutRoughwallfunction
|
#9 |
Member
Maruthamuthu Venkatraman
Join Date: Mar 2009
Location: Norway
Posts: 80
Rep Power: 17 |
Hello,
I tried to set various values for Ks in the input to account for roughness by using nutroughwallFunction. But its seems the results are same for ks = 0 and ks=0.01. cs = 0.5 for both cases. yplus is set for 30, k is set to kqRwallfunction and omega as omegaWallfunction. Any hints will be useful Thanks |
|
April 16, 2010, 10:56 |
|
#10 |
Member
Sylvain Aguinaga
Join Date: Feb 2010
Posts: 41
Rep Power: 16 |
Hello,
I didn’t succeed to solve this problem and unfortunately I have no many time to work on this subject. Anyway I ran simulations in a very simple case (2D, log profile at the inlet) with different values of roughness, even negative, always leading to the same result regarding the pressure and velocity field. I thought that the model didn’t read the values prescribed in the nut file. But if you turn on the debug mode associated with the nutRoughwallfunction you can see that the model do take into account the values ( you have Kplus negative also). So I guess the problem is not in the nutRoughwallfunction model, but rather in the way it is communicating with the turbulence model. I really don’t know, but this roughness issue is annoying me!!! Regards |
|
April 16, 2010, 12:15 |
|
#11 |
Member
Maruthamuthu Venkatraman
Join Date: Mar 2009
Location: Norway
Posts: 80
Rep Power: 17 |
Thanks for your reply. Iam attending OF Workshop in Chalmers, may be we will discuss about this issue and shall see the possibilities to fix it. In the meanwhile we shall wait for some other foam users or the developers comments about it.
Have a good weekend! |
|
April 29, 2010, 04:13 |
|
#12 |
New Member
Adrian Stalder
Join Date: Mar 2010
Posts: 10
Rep Power: 16 |
Hello everyone
I encountered the same problem as most of you, the Ks and Cs values are not taken into account. I was working with a 2D domain and a pressure difference implemented between two sides. The logarithmic profile develops nicely but it only changes with the pressure, not with the Ks/Cs values. So did anyone find out something new about this problem? Cheers Adrian |
|
May 5, 2010, 04:53 |
Bug in nutRoughWallFunction
|
#13 |
New Member
Join Date: Mar 2010
Posts: 6
Rep Power: 16 |
I started a new thread
http://www.cfd-online.com/Forums/ope...ues-ks-cs.html and finally got the answer to this problem from gocarts: "nutRoughWallFunction in OpenFOAM 1.6 doesn't work correctly due to a bug. Try the latest 1.6.x from the git repository for the corrected version." Kind regards, Irina |
|
May 5, 2010, 05:38 |
|
#14 |
Member
Sylvain Aguinaga
Join Date: Feb 2010
Posts: 41
Rep Power: 16 |
Thanks Irina for your help.
I didn't succeed in compiling the whole git version and couldn't test it. Did it solve your problem, is it working now? I can recompile "by hand" the nutRoughWallFunction of the git, but is the problem just located in this function or in another one (turbulence model for example). Thanks again for your help. Sylvain |
|
May 5, 2010, 06:11 |
|
#15 |
Member
Aniko Rakai
Join Date: Oct 2009
Location: Geneva
Posts: 30
Rep Power: 16 |
In the first post of this thread Alan also mentioned the bug.
So all your problem is because you didn't use the git version? I think it's better using that one, since all new bug fixes are there, while the compiled version is not getting newer as I see. For example there was also a bug in omegaNutWallFunction. There is a good script at in the forum somewhere to do that. If with the git version you manage, please post here. |
|
May 5, 2010, 08:17 |
|
#16 |
Member
Sylvain Aguinaga
Join Date: Feb 2010
Posts: 41
Rep Power: 16 |
Alan indeed mentions that bug. As I wasn't able to compile the whole git version (the compilation is crashing on OpenSuse and I didn't found why) I only recompiled the nutRoughWallFunction, but it didn't change anything. I took a look inside the function and I didn't see much difference, maybe I have to take a closer look. So my point is that maybe the problem is occurring elsewhere (but where?). I will try to find a computer where the git version is compiling so that I can try and see if the bug is solved with the latest version.
|
|
May 28, 2010, 10:11 |
Specify different roughness
|
#17 |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 |
Dear all,
I would like to specify different roughness on a same surface. I am thinking on something like: if x < 1 than Cs = n1 Ks = m1Alternatively, I can divide the surface in different patches, and specify the roughness for each one. Does anybody know if one of these two solution is already implemented in OF? Any other suggestion is welcome! Thank you, maddalena |
|
May 28, 2010, 16:19 |
|
#18 | |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 |
Quote:
mad |
||
June 3, 2010, 13:04 |
|
#19 |
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 |
Hi
I'm trying to simulate an atmospheric boundary layer, for K and epsilon what kind of boundary conditions impose you on top and bottom? Thanks |
|
June 4, 2010, 11:48 |
|
#20 |
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 |
In my atmospheric boundary layer simulation, i have this problem, I impose a logarithmic velocity profile at inlet, but when I plot it in paraview in a semilog plot, I don't have a straight line, but two always at 1m from the bottom...I don't understand...the plot of a log in a semilog plot would a straight line. Help me please!
Thanks |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Surface roughness in Flow-3d | Marco | FLOW-3D | 3 | June 3, 2018 02:15 |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 11:05 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 02:09 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 12:43 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 12, 2001 23:19 |