# 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, 08:13 #101 New Member   Hans Barósz Join Date: May 2014 Posts: 22 Rep Power: 8 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, 13:22
#102
Senior Member

ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 12
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, 01:11 #103 Senior Member     Mostafa Mahmoudi Join Date: Jan 2012 Posts: 322 Rep Power: 12 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, 02:24
#104
Senior Member

Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 12
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, 53 views)

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

Chrissy Stanford
Join Date: Oct 2013
Location: South Africa
Posts: 11
Rep Power: 9
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, 13:06
#106
Senior Member

ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 12
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: 200
Rep Power: 12
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 Thanks for your time, 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: 11 Rep Power: 8 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, 09:13 #109 Senior Member Join Date: Mar 2015 Posts: 250 Rep Power: 8 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, 32 views) March 24, 2016, 08:36 #110 Member Timm Severin Join Date: Mar 2014 Location: Munich Posts: 63 Rep Power: 8 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, 12:54 #111 Member Timm Severin Join Date: Mar 2014 Location: Munich Posts: 63 Rep Power: 8 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, 77 views) April 28, 2018, 10:35 erro compilation #112 Senior Member Guilherme Join Date: Apr 2017 Posts: 180 Rep Power: 5 Quote:  Originally Posted by florian_krause Dear all, This issue was already discussed in some length in various threads. Therefore I finally reviewed and attached my plusPostRANS utility. It calculates y+ and u+ values when using one of the available low-Re RANS turbulence models. I hope the code as well as the output will be self-explaining I also attached a case. It is a straight pipe (wedge) with periodic inlet/outlet boundary conditions. The Reynolds number based on the mean axial velocity is Re=5300. You can run the case using pisoFoam. I would appreciate any feedback, it might be still improved at some point! Best regards, Florian Hi, can you help me?! ERRO: Quote:  OpenFOAM/plusPostRANS$ wmake all g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/meshTools/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/RAS/RASModel -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/LES/LESModel -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/transportModels -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c plusPostRANS.C -o Make/linux64GccDPInt32Opt/plusPostRANS.o In file included from plusPostRANS.C:76:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:75:10: error: ‘incompressible’ was not declared in this scope autoPtr RASModel ^ createFields.H:75:34: error: template argument 1 is invalid autoPtr RASModel ^ createFields.H:77:13: error: ‘incompressible’ is not a class or namespace incompressible::RASModel::New(U, phi, laminarTransport) ^ plusPostRANS.C:90:45: error: ‘wallFvPatch’ was not declared in this scope if (typeid(currPatch) == typeid(wallFvPatch)) ^ plusPostRANS.C:96:33: error: base operand of ‘->’ is not a pointer RASModel->nu().boundaryField()[patchi] ^ plusPostRANS.C:99:29: error: base operand of ‘->’ is not a pointer /RASModel->nu().boundaryField()[patchi]; ^ plusPostRANS.C:106:15: error: base operand of ‘->’ is not a pointer RASModel->nu() ^ plusPostRANS.C:131:43: error: base operand of ‘->’ is not a pointer yPlus = y.y() * uTauAvg / RASModel->nu(); ^ /home/cae/OpenFOAM/OpenFOAM-3.0.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/plusPostRANS.o' failed make: *** [Make/linux64GccDPInt32Opt/plusPostRANS.o] Error 1

 May 4, 2018, 10:09 #113 Senior Member   Wouter van der Meer Join Date: May 2009 Location: Elahuizen, Netherlands Posts: 200 Rep Power: 14 Hello gu1, The utility was written for OF2.3.x. So compiling for OF3.0 can give problems. I cannot help you solve it, but you can download OF2.3.x and use that to run your model and the utility or you can find out what changed between OF2.3 and OF3.0 and adapt the utility to OF3.0 (please post the adapted utility if you do). Best regards, Wouter

 June 25, 2019, 01:58 #114 Senior Member   Jianrui Zeng Join Date: May 2018 Location: China Posts: 157 Rep Power: 4 how can I plot y+ and u+ in OpenFOAM. Dose anyone modify the tools? Thank you.

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