CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   y+ (yPlus) in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-solving/64066-y-yplus-openfoam.html)

raagh77 April 28, 2009 08:31

y+ (yPlus) in OpenFOAM
 
Hello all,

Is there any script available in OpenFOAM to calculate y+ value ?

Regards
Raghavendra

raagh77 April 28, 2009 08:45

compiling yPlusRAS
 
I tried using the utility yPlusRAS but I had some problem during compilingg

$ wmake
Making dependency list for source file yPlusRAS.C
SOURCE=yPlusRAS.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/apps/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/apps/OpenFOAM/OpenFOAM-1.5/src/turbulenceModels/RAS -I/apps/OpenFOAM/OpenFOAM-1.5/src/transportModels -IlnInclude -I. -I/apps/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/apps/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/yPlusRAS.o
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/apps/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/apps/OpenFOAM/OpenFOAM-1.5/src/turbulenceModels/RAS -I/apps/OpenFOAM/OpenFOAM-1.5/src/transportModels -IlnInclude -I. -I/apps/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/apps/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC Make/linux64GccDPOpt/yPlusRAS.o -L/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt \
-lincompressibleRASModels -lincompressibleTransportModels -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/yPlusRAS
/usr/bin/ld: cannot open output file /apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/yPlusRAS: Permission denied
collect2: ld returned 1 exit status
make: *** [/apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/yPlusRAS] Error 1


( installation path of OF is /apps/OpenFOAM )

olesen April 29, 2009 03:21

compiling yPlusRAS
 
Quote:

Originally Posted by raagh77 (Post 214477)
I tried using the utility yPlusRAS but I had some problem during compiling
...
/usr/bin/ld: cannot open output file /apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/yPlusRAS: Permission denied
collect2: ld returned 1 exit status
make: *** [/apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/yPlusRAS] Error 1

As the error message clearly indicates, you do not have write permission for this directory. Either set/get write permissions for this directory, or else compile with the target as $FOAM_USER_APPBIN instead of $FOAM_APPBIN.

raagh77 April 29, 2009 03:59

Hi Olesen ,

Thanks for your reply..

Yes I have copied the directory to $FOAM_USER_APPBIN and I tried to compile there only..(Where I have read/write permission)

Regards
Raghavendra

olesen April 29, 2009 04:05

Quote:

Originally Posted by raagh77 (Post 214566)
Yes I have copied the directory to $FOAM_USER_APPBIN and I tried to compile there only..(Where I have read/write permission)

I have absolutely no idea why you would even consider placing the source code in $FOAM_USER_APPBIN.
The issue is not about read/write permission for the source code, but for the resulting executable (as stated in the error message).
Please see the EXE = ... entry in Make/files for settting the target.

raagh77 April 29, 2009 04:58

Hi Olesen,

as you said
the problem was not setting the path in file EXE = ...

now i am able to compile :)

Thanks for your support

Regards
Raghavendra

sanjibdsharma August 11, 2009 01:42

Hi Mark,

I am trying to compile yPlusRAS.C with turbFoam.C. While compiling, I am getting the following error:

Make/linuxGccDPOpt/yPlusRAS.o: In function 'main':
yPlusRAS.C:(.text+0x70):multiple definition of 'main'
Make/linuxGccDPOpt/newturbFoam.o:newturbFoam.C:(.text+0x70):first defined here
collect 2: ld returned 1 exit status

The above error is clearly due to multiple "main" functions in the C files yPlusRAS.C and turbFoam.C. I tried by not including the main in yPlusRAS.C, but that did not work. Can you suggest a way out ?

Thanks,

Sanjib

olesen August 11, 2009 03:10

Quote:

Originally Posted by sanjibdsharma (Post 225891)
The above error is clearly due to multiple "main" functions in the C files yPlusRAS.C and turbFoam.C. I tried by not including the main in yPlusRAS.C, but that did not work. Can you suggest a way out ?

The obvious thing would be to only steal what you actually need from yPlusRAS.C instead of copying the entire file.

sanjibdsharma August 11, 2009 03:17

Thanks Mark.

So, I would just copy the portion of y+ calculation from yPlusRAS.C to createfields.H ? I did that but it did not work.

The error message is:

RASModel not declared in this scope.

I tried to include the RASModel.H file at the beginning in the createfields.H file, but that did not solve the problem either.

matejfor August 11, 2009 04:59

The problem is - why do you copy the bits of yPlusRAS to CreateFields.H.
Assuming your goal is to have y+ computed during the run and not in postprocessing step, you want to evaluate the y+ value at the end of the PISO time step computation.
The CreateFields.H is just a way how to keep the code tidy by putting all variables instantiation away from the main code. It means that in your CreateFields you want to add only the bit defining y+ field. The most tricky part is which bits you really need to put into the new solver. From my experience it is allways good to try how the whole thing work by implementing some dummy crazy bit of code before fighting with more complicated parts, like your y+.


good luck
matej

mturcios777 June 1, 2010 14:29

What about compressible flow?
 
I was able to modify and compile yPlusRAS for OF 1.4.1 (need to maintain compatibility with some in-house software) and it seems to have worked well.

Having just learned about yPlus and its use, I was wondering what modifications would be needed to make it work for compressible, reacting flow. At first I thought all we would need is to change the turbulence model creation, but then I saw the incompressible transport model is used in some of the calculation. How do the two interact?

ehsan November 21, 2011 05:21

LES and Yplus
 
Dear All

Is there a way to calculate y+ from our LES simulations?

Thanks

Bernhard November 21, 2011 05:46

Did you consider the yPlusLES utility?

ehsan November 21, 2011 06:06

Not yet. I will consider it. Thanks. And I like to calculate lift and drag forces over the airfoil but the forces that openFOAM utility gives are incorrect. Could you help me in this regard as well?

Thanks

jaydeepKhajure September 8, 2015 07:46

yPlusRAS error
 
Hello,

Currently I am running the case in OpenFOAM 2.3.0. I am having a problem calculating the y plus value. My case is in sonicfoam having Re 3e6 and I am using K-Epsilon RAS model. However, after post processing I type the command yPlusRAS in terminal, I get following error message,

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Create time

Create mesh for time = 0

Time = 0
Calculating wall distance

Writing wall distance to field y

Reading field U

Reading/calculating face flux field phi



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/cae/OpenFOAM/cae-2.3.0/run/jaydeep/Pen_3D_4.5/constant/transportProperties at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Can anybody suggest a possible solution to overcome this error message ?

Thanks and Regards
jaydeep

jaydeepKhajure September 10, 2015 04:05

Hello everybody,

I tried yPlusRAS -compressible and it worked. Thanks for the suggestions. However, it gives me an output

"no rho field
Writing yPlus to field yPlus"

It did not give y plus for any time step. Does anybody know anything about this?

jaydeep

matejfor September 10, 2015 04:15

Hi,

the transportProperties is a file with a specification of viscosity. For compressible flow, viscosity could be a function of temperature typical, therefore it is prescribed in thermophysicalProperties.
Without a compressible switch the utility does not know this.

With compressible switch the utility looks for a rho - density and apparently could not find the field in the time directories. Now the rho does not exist in the 0 directory with initial conditions.

Solution: run your utility with a -time 1:10 to get y+ for times from 1 to 10 seconds.

happy foaming


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