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

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

Register Blogs Community New Posts Updated Threads Search

Like Tree81Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2014, 07:13
Default
  #101
New Member
 
Hans Barósz
Join Date: May 2014
Posts: 22
Rep Power: 11
HanSolo123 is on a distinguished road
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?
HanSolo123 is offline   Reply With Quote

Old   May 11, 2014, 12:22
Default
  #102
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by HanSolo123 View Post
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.
ArathoN is offline   Reply With Quote

Old   May 22, 2014, 00:11
Default
  #103
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
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> 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
adambarfi is offline   Reply With Quote

Old   May 22, 2014, 01:24
Default
  #104
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
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
File Type: gz incompressibleyPlusLES.tar.gz (2.5 KB, 63 views)
benqing and Gang Wang like this.
adambarfi is offline   Reply With Quote

Old   September 9, 2014, 13:23
Default
  #105
New Member
 
Chrissy Stanford
Join Date: Oct 2013
Location: South Africa
Posts: 11
Rep Power: 12
New_OpenFOAM_user is on a distinguished road
Quote:
Originally Posted by lakeat View Post
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,

Thank you for continually updating and uploading your utility for newer versions of OF.

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?

Thank youin advance, your help is greatly appreciated!
Chrissy.
New_OpenFOAM_user is offline   Reply With Quote

Old   October 15, 2014, 12:06
Default
  #106
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by New_OpenFOAM_user View Post
.................................

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).
ArathoN is offline   Reply With Quote

Old   January 13, 2015, 14:13
Default
  #107
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 200
Rep Power: 15
Alhasan is on a distinguished road
Quote:
Originally Posted by lakeat View Post
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
Alhasan is offline   Reply With Quote

Old   March 14, 2015, 09:21
Default plusPostRANS
  #108
New Member
 
Petteri
Join Date: Feb 2014
Posts: 11
Rep Power: 12
hamsteri15 is on a distinguished road
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?
hamsteri15 is offline   Reply With Quote

Old   June 9, 2015, 08:13
Default
  #109
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by lakeat View Post
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
File Type: txt yPlus_compiler_output.txt (29.6 KB, 34 views)
KateEisenhower is offline   Reply With Quote

Old   March 24, 2016, 07:36
Default
  #110
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
Quote:
Originally Posted by lakeat View Post
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 u_\tau, which appears to be wrong:
u_\tau = \sqrt{\frac{\tau_w}{\rho}} = \sqrt{\frac{\mu_{eff} \left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}
while your current code (line 314 [(int) pi*100, yeah])
u_\tau = \sqrt{\rho \cdot \mu_{eff} \left(\frac{\partial U}{\partial y}\right)_{y=0}}
The fact that y^+ has the \rho in the nominator is due to the \nu in the nominator of the y^+-Equation:
y^+ = \frac{u_\tau y}{\nu} = \frac{u_\tau y \cdot \rho}{\mu}
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).
Astrodan is offline   Reply With Quote

Old   April 21, 2016, 11:54
Default
  #111
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
Hi there, me again.

For whoever is interested, I updated lakeat's code with the above mentioned correction for u_{\tau}, 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
File Type: zip yTools.zip (6.8 KB, 94 views)
Astrodan is offline   Reply With Quote

Old   April 28, 2018, 09:35
Default erro compilation
  #112
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
Quote:
Originally Posted by florian_krause View Post
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<incompressible::RASModel> RASModel
^
createFields.H:75:34: error: template argument 1 is invalid
autoPtr<incompressible::RASModel> 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
gu1 is offline   Reply With Quote

Old   May 4, 2018, 09:09
Default
  #113
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
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
wouter is offline   Reply With Quote

Old   June 25, 2019, 00:58
Default
  #114
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
how can I plot y+ and u+ in OpenFOAM. Dose anyone modify the tools? Thank you.
calf.Z is offline   Reply With Quote

Old   August 23, 2023, 05:37
Default
  #115
New Member
 
Shenhui Ruan
Join Date: Nov 2021
Location: Karlsruhe
Posts: 12
Rep Power: 4
fly_light is on a distinguished road
Hello everyone,

I did not read all the threads. But I have done sth about calculating the yPlus value for all cells. I modified the code of chegdan for calculating yPlus for all cells. Thanks for his contribution.
This is the link to the old code: https://github.com/chegdan/yPlusUplus.
This is the link to my code: https://github.com/Ruansh233/RshOpen.../main/yPlusCFD

The old version is run on OF-2.1. And my new version can run on OF-v2106
I delete some redundant steps and omit to create too many new objects. My code is running much faster compared to the old version.
fly_light is offline   Reply With Quote

Reply

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


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
Low values of Lift force vmlxb6 CFX 1 February 2, 2011 05:13
Incompressible Turbulence models achinta OpenFOAM 4 May 27, 2010 10:35
turbulence models? haider FLUENT 0 March 7, 2006 23:58
Turbulence Models and external flow. Alan FLUENT 3 November 22, 2005 04:46
Turbulence boundary values lego CFX 9 October 25, 2002 11:55


All times are GMT -4. The time now is 18:57.