CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Wrong results after Modifying yPlus.C & OP 1.6-ext (

sasanghomi September 22, 2013 07:47

Wrong results after Modifying yPlus.C & OP 1.6-ext
1 Attachment(s)
Hi Foamers ,

I am using OP 1.6-ext . I understood yPlusRAS have a bug and Actually it calculates Y* instead of Y+ . So I searched in the forums and I didn't find any correct yPlus.C for 1.6-ext . {there was some codes for standard versions}. I modified the yPlus.C for 1.6-ext and after compiling I checked this utility for a case but unfortunately I got zero values for Y+ everywhere in all times. I attached this code . Please anybody help me for finding the problem in this code .

I appreciate any help from you.
Thanks and best regards,

P.S. I only changed compressible and incompressible parts and I didn't change two phase part .

nimasam September 22, 2013 09:48

Dear Sasan

prepare a simple test case which we can examine your code there ;)

sasanghomi September 22, 2013 09:57

1 Attachment(s)
Hi Dr.Sam

I attached a cavity case that the solver of that is rhoPisoFoam so you should use yPlusRAS -compressible for getting Y+ .

Thank you very much
best regards

nimasam September 22, 2013 11:56

1 Attachment(s)
Hello Dear Sasan

i feel the code should be like that :

yPlus.boundaryField()[patchi] =y[patchi]
* sqrt
* mag(U.boundaryField()[patchi].snGrad())
/ rho.boundaryField()[patchi]
/ (RASModel->mu().boundaryField()[patchi]/rho.boundaryField()[patchi]);
actually i replace

with this:

i guess we should use mu in that equation not mut :), however im not turbulent expert :)

sasanghomi September 22, 2013 14:03

I really appreciate your help and your attention ;) replacing RASModel->mu().boundaryField()[patchi] eliminate the problem in the code.I think this formula is good for Y+<5 because when Y+ is lower than 5 So mut is very low comparing to mu . Do you know about order of Y+ in openfoam? is it similar to fluent or not ? Actually I can't set Y+ between 30 and 300 in my case (engine) .In my case the order of Y+ is low. So I want to set it lower than 5 and I want to know this order of Y+ in openfoam for standard wall Functions is acceptable or not ?:confused:

Anyway thank you very much Dr.Sam
Your help solved the problem.;)
Best regards,

nimasam September 22, 2013 14:11

you can define muEff = mu + mut :D
However as i said before im not turbulent expert :), so i dont know

All times are GMT -4. The time now is 05:43.