# y+ and u+ values with low-Re RANS turbulence models: utility + testcase

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

 May 11, 2014, 07:13 #101 New Member   Hans Barósz Join Date: May 2014 Posts: 22 Rep Power: 4 Hello, I have the same problem like aylalisa. The post-Processing utility "wallShearStress" actually only works for RANS-Simulation. I actually dont understand why it is so but ok. I found a thread here on the forum how to calculate the wall shear stress tau_w for LES( http://www.cfd-online.com/Forums/ope...imulation.html ) but this does not work for OP2.3.0 anymore. I had a look in wallShearStress.C, but there is no reference to #include "incompressible/RAS/RASModel/RASModel.H" anymore as mentioned in the above thread. I want to plot u+ over y+ as well, therefor I need u+. When I extract u_tau from y+, is it possible to calculate u+ then with u+ = u / u_tau? I am unsure about the directions. In which direction points u_tau, when you have a simple Channel flow in x-direction? When I extract it from y+, does it point in x-direction then? The u+ over y+ graph is actually a dimensionless velocity profile, so it is velocity in x over wall distance in y. But i am unsure about u_tau. Any tips?

May 11, 2014, 12:22
#102
Senior Member

ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 7
Quote:
 Originally Posted by HanSolo123 Hello, I have the same problem like aylalisa. The post-Processing utility "wallShearStress" actually only works for RANS-Simulation. I actually dont understand why it is so but ok. I found a thread here on the forum how to calculate the wall shear stress tau_w for LES( http://www.cfd-online.com/Forums/ope...imulation.html ) but this does not work for OP2.3.0 anymore. I had a look in wallShearStress.C, but there is no reference to #include "incompressible/RAS/RASModel/RASModel.H" anymore as mentioned in the above thread. I want to plot u+ over y+ as well, therefor I need u+. When I extract u_tau from y+, is it possible to calculate u+ then with u+ = u / u_tau? I am unsure about the directions. In which direction points u_tau, when you have a simple Channel flow in x-direction? When I extract it from y+, does it point in x-direction then? The u+ over y+ graph is actually a dimensionless velocity profile, so it is velocity in x over wall distance in y. But i am unsure about u_tau. Any tips?
Here my answer to the same question about u+ vs y+ calculation.

The u_tau calculated is the magnitude of the friction velocity utau (u_taux, u_tauy , u_tauz); same thing for the wallshearstress. Obviously if you study a 1-D case the values over that direction are the ones to study hence their value over the other 2 directions are negligeble.

 May 22, 2014, 00:11 #103 Senior Member     Mostafa Mahmoudi Join Date: Jan 2012 Posts: 314 Rep Power: 7 hi, I have some problem in making compressibleyPlusLES utility. when I want to make it the following error is appeared: Code: In file included from compressibleyPlusLES.C:70:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:112:57: error: no matching function for call to ‘Foam::compressible::LESModel::New(Foam::volScalarField&, Foam::volVectorField&, Foam::surfaceScalarField&, Foam::basicThermo&)’ createFields.H:112:57: note: candidate is: /home/mostafa/OpenFOAM/OpenFOAM-2.2.2/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:150:34: note: static Foam::autoPtr Foam::compressible::LESModel::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::fluidThermo&, const Foam::word&) /home/mostafa/OpenFOAM/OpenFOAM-2.2.2/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:150:34: note: no known conversion for argument 4 from ‘Foam::basicThermo’ to ‘const Foam::fluidThermo&’ make: *** [Make/linux64GccDPOpt/compressibleyPlusLES.o] Error 1 anybody knows what should I do? Regards, Mostafa Edit: I'm using OF-2.2.2

May 22, 2014, 01:24
#104
Senior Member

Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 314
Rep Power: 7
Hi dear FOAMERs, specially LES fans!

I decided to change the compressibleyPlusLES to incompressibleyPlusLES utility. I made the changes and fortunately it was made without any errors.
I attach the final utility and if it's possible for you guys to check it and if I made some mistakes in writing the codes, please let me know.

Regards,
Mostafa
Attached Files
 incompressibleyPlusLES.tar.gz (2.5 KB, 30 views)

September 9, 2014, 13:23
#105
New Member

Chrissy Stanford
Join Date: Oct 2013
Location: South Africa
Posts: 11
Rep Power: 4
Quote:
 Originally Posted by lakeat Hey guys, 1. I found calculate wall distance twice is unnecessary, so I disable it. 2. Here are the two utilities doing the same job as before, with small changes. Tested on OpenFOAM-2.2.x 3. I have also added a few write-out control. Please use "-help" to find more info. yPlus: Attachment 26083 yStar: Attachment 26084
Hi,

I have a question about your utility. Please forgive if it is an ignorant question, but I haven't been able to find the answers elsewhere. I read that you wrote it for low Re numbers, is it valid for high Re turbulence models (in my case realizable k-eps)?

Also when I build and run your utility (in OF version 2.3.x) it only displays the yPlus values for one of my patches and the value displayed is much lower than the y* values calculated by the yPlusRAS utility. Is it working correctly, or could you suggest how to modify it? Or is there something else I am missing?

Chrissy.

October 15, 2014, 12:06
#106
Senior Member

ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 7
Quote:
 Originally Posted by New_OpenFOAM_user .................................

yplus and ystar have different relations so they will obviously give different values. They have a comparable results only in the log layer because the assumption to define ystar depends on the log layer.

this utility gives the possibility to calculate yplus when you are using a wall resolved case where nut at wall must be set as calculated. However the yPlusRAS calculate yplus only if it is declared a nutWallFunction (whatever it is) so for the wall resolved case, it will give you errors and no yplus will be clculated.

For high Re meshes use teh yPlusRAS included in OF, take care on how it is defined yplus in the wallfunction, because the utility yPlusRAS does only call the function to calculate yplus inside the nutWallFunction chosen in /0/nut. Some of them use ystar others not, I Advice you to read teh code and you'll understand better (see the unige and chalmers course for OF they are really good).

January 13, 2015, 15:13
#107
Senior Member

Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 196
Rep Power: 6
Quote:
 Originally Posted by lakeat Hi again, I think I have fixed the bug. yPlus utility: Attachment 17317 yStar utility: Attachment 17318 Equations used for incompressible flow: Code: y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{{\nu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\nu_{lam}} Equations used for compressible flow: Code: y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{\rho{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\mu_{lam}}
Hello I beleive this is for OpenFOAM V2.1.0
but when I try to compile I am getting this error
Code:
Making dependency list for source file yPlus.C
SOURCE=yPlus.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/meshTools/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/transportModels -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/thermophysicalModels/basic/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude   -fPIC -c \$SOURCE -o Make/linux64GccDPOpt/yPlus.o
yPlus.C: In function ‘int main(int, char**)’:
yPlus.C:160:38: error: no matching function for call to ‘Foam::basicThermo::New(Foam::fvMesh&)’
yPlus.C:160:38: note: candidate is:
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note: static Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Foam::Istream&)
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note:   no known conversion for argument 1 from ‘Foam::fvMesh’ to ‘Foam::Istream&’
yPlus.C:222:46: error: no matching function for call to ‘Foam::basicThermo::New(Foam::fvMesh&)’
yPlus.C:222:46: note: candidate is:
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note: static Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Foam::Istream&)
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note:   no known conversion for argument 1 from ‘Foam::fvMesh’ to ‘Foam::Istream&’
make: *** [Make/linux64GccDPOpt/yPlus.o] Error 1
What is happening here

Hasan K.J
__________________
"Real knowledge is to know the extent of one's ignorance." - Confucius

 March 14, 2015, 10:21 plusPostRANS #108 New Member   Petteri Join Date: Feb 2014 Posts: 9 Rep Power: 4 I have a question about the plusPostRANS utility. If I understood correctly, the average(uTauWall) function calculates the wall-average of u_tau. So for a flat plate flow ,for example, if I wanted to plot the dimensionless velocity profile at certain x-coordinate location using the u+ and y+ values output from the utility, the values are actually quite far off? Has anyone come up with a nice way to plot the accurate dimensionless velocity profile with low-Re models? So far I've always calculated the u+ and y+ manually using the velocity gradient (wallGradU) at certain point but for more complex geometries this is quite tedious. Is it possible to modify the utility so that it uses the same location for the surface normal gradient of the velocity and the point at the wall it calculates the distance to?

June 9, 2015, 08:13
#109
Senior Member

Join Date: Mar 2015
Posts: 173
Rep Power: 3
Quote:
 Originally Posted by lakeat Hey guys, 1. I found calculate wall distance twice is unnecessary, so I disable it. 2. Here are the two utilities doing the same job as before, with small changes. Tested on OpenFOAM-2.2.x 3. I have also added a few write-out control. Please use "-help" to find more info. yPlus: Attachment 26083 yStar: Attachment 26084
Hello,

when I try to compile it I get the attached output.

I'm running OpenFOAM 2.3.1 on OS X Yosemite. I'd appreciate it if anyone could answer my questions:

1) Has anyone successfully compiled the tool on 2.3.x?
2) What is the compiler complaining about?
3) How can I make it work?

Best regards,

Kate
Attached Files
 yPlus_compiler_output.txt (29.6 KB, 18 views)

March 24, 2016, 08:36
#110
Member

Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 46
Rep Power: 4
Quote:
 Originally Posted by lakeat Equations used for compressible flow: Code: y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{\rho{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\mu_{lam}}
Although this might be true, you apparently also changed the calculation of , which appears to be wrong:

while your current code (line 314 [(int) pi*100, yeah])

The fact that has the in the nominator is due to the in the nominator of the -Equation:

At least that's my take at those equations. Maybe someone should re-check, I got a bit confused with all the mu, nu, muEff, nuEff, y+ and y* reading.
Anyway, thanks for the utility, works great so far (tested with 2.3.x).

April 21, 2016, 11:54
#111
Member

Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 46
Rep Power: 4
Hi there, me again.

For whoever is interested, I updated lakeat's code with the above mentioned correction for , since so far no one complained. Apart from that I added a -newTimes option, which is just like the -newTimes option in reconstructPar. And finally I update the Make/files to build the tool in the FOAM_USER_APPBIN, not in the global one, so it can be compiled by everyone.

Tested with OF 2.3.x. Both tools in one package. And zipped. I hate .tar.gz.
Attached Files
 yTools.zip (6.8 KB, 5 views)

 Tags low-re rans, y* value, y+ value

 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 vmlxb6 CFX 1 February 2, 2011 06:13 achinta OpenFOAM 4 May 27, 2010 10:35 haider FLUENT 0 March 8, 2006 00:58 Alan FLUENT 3 November 22, 2005 05:46 lego CFX 9 October 25, 2002 11:55

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