
[Sponsors] 
September 20, 2013, 08:22 

#21  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Quote:
For more information on wall functions and how they are used you can also take a look at Pope, Turbulent Flows, 2000, pp 442443 and Versteeg and Malalasekera, An introduction to computational fluid dynamics: The finite volume method, pp. 276277
__________________
~roman Last edited by romant; September 20, 2013 at 08:24. Reason: books added 

April 5, 2014, 04:40 
su and sp treatment when epsilon gets redined in the first cell

#22  
Member
Manan
Join Date: Oct 2013
Location: Göteborg
Posts: 37
Rep Power: 5 
Hello
I have a question related to what is being discussed in this thread. Say for example, I wish to set epsilon in the first cell as a function of k in the first cell. Is simply calling the appropriate wall function sufficient to implement that? From what I understand, Quote:
Subsequent to this, the solving happens. But what I wonder is, shouldn't the sp and the su terms for the first cell also be modified so that the solver does not overwrite the newly calculated first cell values for epsilon? For example, if we consider a 1D discretised equation: ap*eps_p=ae*eps_e+aw*eps_w+su (1) ap=ae+awsp Now if I set sp and su such as: su (@first_cell_next_to_wall)=1e10*epsilon_new sp (@first_cell_next_to_wall)=1e10 (where epsilon_new is the new value calculated as a function of k) then, sp>>aw, sp>>ae. su>>ae, su>>aw. Hence eq. 1 gives sp*eps_p=su => eps_p=su/sp=1e10*epsilon_new/1e10=epsilon_new Shouldn't such a treatment as above also be there? Please let me know if I haven't made myself clear. Thanks. 

April 5, 2014, 10:08 

#23 
Senior Member
Join Date: Jan 2013
Posts: 315
Rep Power: 7 
Hi All,
I have a question about the wall functions implemented in Openfoam. Theoretically, when wall function is used, the velocity at the wall is not zero and instead the velocity there is the friction velocity which is solved from the loglaw or linear law. (If the zero velocity is emposed there, then it is equivalent to the nonslip boundary condition.) Then the wall shear stress is obtained tau_w=rho*u_tau**2. Then this wall shear stress can be used for the discretization of the momentum equations in the finite volume appraoch. However, in openfoam's specifications, when wall function is applied, the velocity at the wall is still (0 0 0). Why can we still use (0 0 0) for the wall velocity here? Thank you in advance. OFFO 

April 5, 2014, 17:28 

#24  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Quote:
where is the the wall shear stress calculated from As you can see from that it is not the velocity at the wall, but the velocity gradient at the wall that plays a role.
__________________
~roman 

April 5, 2014, 17:48 

#25  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Quote:
I think when you look into the code you can see that you don't need the newly calculated epsilon in the first cell anymore, after you have solved the system. http://foam.sourceforge.net/docs/cpp/a10359_source.html The only part where you need to use epsilon again is in line 329 and following to calculate mut, however, in the case of wall functions, mut will be set in the first cell anyway and therefore it doesn't matter if your epsilon is wrong or not. So epsilon in the first cell only needs to be correct before we solve epsilon, not after.
__________________
~roman 

April 5, 2014, 18:27 

#26 
Senior Member
Join Date: Jan 2013
Posts: 315
Rep Power: 7 
Dear Roman,
Thank you for your reply. In the practical CFD implementations, if we use cell centered finite volume method as is done in the OF, the velocity gradient is needed to calculate the numerical flux for the diffusion term in the momentum equations. Is this understanding correct? Is the following line of reasoning correct: 1, use the log law or linear linear law to get the friction velocity 2, use the equation you mentioned to predict the wall shear stress, which can be used for the momentum equation discretizations. Is the above understanding correct? Thank you. I am working on the wall function implementations and thus would like to have these knowledge for my work. Thanks. OFFO 

April 7, 2014, 03:06 

#27  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Quote:
For the other parts: 1. you use the log law or the linear law to find the velocity in the first point away from the wall away from the grid, not he friction velocity. This velocity can then be used to calculate the wall shear stress as you know the velocity at the wall (either no slip, partial slip or whatever you define). I describe here http://www.cfdonline.com/Forums/ope...function.html how the nut wall function works, which is the wall function for the velocity. Since setting the velocity in the first point is a bad choice (it will be overwritten), setting a source on the wall strong enough to make the velocity in the first grid point exactly what you need it much better. Take a look at the references given in the mentioned post and also in this thread. These are:
__________________
~roman 

April 7, 2014, 03:19 

#28 
Senior Member
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 19 
Manan, I thought about the same thing. As far as I understand it, this is done with the "boundaryManipulate" function, called before solving.
I found it in "src/finiteVolume/lnInclude/fvMatrix.C". It calls a "manipulateMatrix"function for all the boundary patches. This function can be found in the wall function file. Here I am lost, because I don't know which of the functions (from which .C file) "setValues(...)" and "manipulateMatrix" is called. But this pretty much looks like the right spot! Cheers, Philipp.
__________________
The skeleton ran out of shampoo in the shower. 

April 7, 2014, 07:15 

#29 
Senior Member
Join Date: Jan 2013
Posts: 315
Rep Power: 7 
Dear Roman,
Thank you so much for your reply about the wall function implementations. Very helpful for me. About the following: Code:
1. you use the log law or the linear law to find the velocity in the first point away from the wall away from the grid, not he friction velocity. Please directly point out if what I am saying is not correct. Thank you. OFFO 

April 7, 2014, 08:01 

#30  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Quote:
I am not sure what you mean with calculating the friction velocity, because it results directly from the solution without having to know the law of the wall. As the friction velocity is and where the last part can just be calculated from As you can see there is not need to calculate the shear velocity using the law of the wall and iterations
__________________
~roman 

April 7, 2014, 08:05 

#31 
Senior Member
Join Date: Jan 2013
Posts: 315
Rep Power: 7 
Ok, thanks. But in your line of reasoning, what did you mean by setting the velocity in the first grid point? Besides, how was the u_w obtained? I think if we calculate the tau_w directly from the third equations you provided, there will be some inaccuracies. Please comment if any. Thanks.


April 7, 2014, 08:11 

#32 
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Wall functions predict the velocity in the first grid point based on theory. However, it is very hard to just prescribe the velocity in the first grid point and keep it fixed. In order to achieve the predicted velocity in the first grid point and not "fix" and thereby destabilize the differential equation (look at Pope, 2000 for this one), we generally introduce a source term, which in openfoam is introduced through the nut/mut wall function.
__________________
~roman 

April 7, 2014, 18:50 

#33 
Senior Member
Join Date: Jan 2013
Posts: 315
Rep Power: 7 
Thank you for your explanation, Roman.
In Openfoam, when we use wall function for both RANS and LES, the velocity at the walls are zero. So here the nonslip velocity is still applied. Can the slip velocity boundary conditions be used in Openfoam? best regards, OFFO 

April 8, 2014, 02:42 

#34 
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: London, UK
Posts: 368
Rep Power: 13 
Hej,
when you take a look here http://www.openfoam.org/docs/cpp/ all the way at the bottom, there is a link to boundary conditions. It will take you to the boundary conditions that can be found in OpenFOAM togther (not the wall function, these are separate because they are part of the specific turbulence models). Take a look there. You can find wall boundary conditions and all the explanations how to use them, i.e. how to set them up in the variable files. Under wall boundaries there is something called a partial slip, and there should of course also be a complete slip (otherwise partial can be used as complete slip and no slip based on how large the partial slip is).
__________________
~roman 

December 18, 2016, 21:13 
Wall Function Implementation in OpenFOAM

#35 
Senior Member
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 150
Rep Power: 6 
Hello OpenFOAM community,
I know I am reviving a very old thread, but I thought I'd try this before possibly starting a new thread. I have recently started using OpenFOAM and have found all the different types of solvers, tools and postprocessing utilities very useful and well documented. As a researcher in turbulence modelling, I am currently learning about and implementing wall functions for compressible RANS. Having explored the documentation and the source code, I've improved my understanding of the nutUSpaldingWallFunction. This is being used for the eddyviscosity transport equation at the solid walls and I've decided to use a boundaryFoam solver to establish ideal boundary layers and assess the wallfunction performance on coarse grids () relative to fullyresolved fine grid results. 1) I want to get a clear understanding of the changes being made to the transport equations. From my understanding, upon application of the nutUSpaldingWallFunction, a correction friction velocity is calculated from the NewtonRaphson solver, then the corrective eddyviscosity is computed. So essentially, the velocity field should remain unchanged and there is a higher effective viscosity which is applied at the walladjacent cells to account for the lower velocity gradient (due to the coarser grid resolution) and thus achieve the corrected wall shear stress. Using the wallShearStress function I found that the results from 30 grid with the wallfunction being as close as 34% of the fullyresolved wall shear stress result and that is well within acceptable bounds especially for larger, industrialscale problems. From the source code, nutUSpaldingWallFunction.C this is the algorithm being used  a) calcNut() requires corrections, since the user selected wallfunction BC and the lies within the accepted bounds of applicability. b) is calculated based on the flow variables and SA transport equation as . Additionally, corrections are to be made. d) The velocity field isn't affected by this but the value of is taken from calcUTau and this is where the NewtonRaphson solver resides. 2) Based on the above, how is the wallfunction viscosity which is being computed from the related to the eddyviscosity in the SA transport equation? Does anyone have a good academic reference for this? From my understanding, the wallfunction should only affect the first walladjacent cells and the flux calculation at the walls. The momentum terms require and after the wallfunction is applied, is it basically ?
I am interested in the shear stress and also the force coefficients which are calculated from solid walls.
__________________
 Mechanical Engineering Sydney, Australia 

December 27, 2016, 22:43 

#36 
Senior Member
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 150
Rep Power: 6 
Hey everyone,
Can someone please direct me to some resources which describe the theory behind implementation of this nutUSpaldingWallFunction? Any assistance is greatly appreciated. Thank you
__________________
 Mechanical Engineering Sydney, Australia 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF Wall functions in Fluent  syler3321  Fluent UDF and Scheme Programming  2  September 20, 2014 12:37 
Water subcooled boiling  Attesz  CFX  7  January 5, 2013 04:32 
wall functions and boundary conditions in OF 1.7.1  cristobal  OpenFOAM  2  May 6, 2011 04:10 
UDF for wall slipping  HFLUENT  Fluent UDF and Scheme Programming  0  April 27, 2011 12:03 
komega simulation without wall functions  vkrastev  OpenFOAM  2  January 24, 2010 18:45 