CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   yPlusLam() in RASModel.C (http://www.cfd-online.com/Forums/openfoam-bugs/67487-ypluslam-rasmodel-c.html)

 guanghaowu August 17, 2009 02:41

yPlusLam() in RASModel.C

In \$SRC/turbulenceModels/incompressible/RAS/RASModel.C, Line148

scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
{
scalar ypl = 11.0;

for (int i=0; i<10; i++) <== ???
{
ypl = log(max(E*ypl, 1))/kappa;
}

return ypl;
}

I cant understand the for{...}, how about as follows?

scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
{
scalar ypl = 11.0;

ypl = log(max(E*ypl, 1))/kappa;

return ypl;
}

Also, in \$SRC/turbulenceModels/compressible/RAS/RASModel.C, Line153

scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
{
scalar ypl = 11.0;

for (int i=0; i<10; i++)
{
ypl = log(E*ypl)/kappa;
}

return ypl;
}

=>

scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
{
scalar ypl = 11.0;

ypl = log(max(E*ypl, 1))/kappa;

return ypl;
}

 ngj August 17, 2009 03:12

Good morning

It is because it is a non-linear equation, hence you need to solve it in an iterative manner.

Best regards,

NIels

 guanghaowu August 17, 2009 03:20

Hi, NLels

Just now I found its my misunderstanding.
You've replied before I delete my thread.

However, thank you very much.

 feldy77 March 20, 2012 20:45

Dear friends,
I am also puzzled about the above for loop.
Can you please explain in more detais which non linear equation it
supposed to solve and how it does it
Mnay tahnks, Yuri

 AlexC March 18, 2014 15:06