# yPlusLam() in RASModel.C

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 17, 2009, 02:41 yPlusLam() in RASModel.C #1 New Member   Guanghao Wu Join Date: Mar 2009 Location: Tokyo, Japan Posts: 15 Rep Power: 8 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; } Thanks in advance.

 August 17, 2009, 03:12 #2 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Rotterdam, The Netherlands Posts: 1,595 Rep Power: 24 Good morning It is because it is a non-linear equation, hence you need to solve it in an iterative manner. Best regards, NIels

 August 17, 2009, 03:20 #3 New Member   Guanghao Wu Join Date: Mar 2009 Location: Tokyo, Japan Posts: 15 Rep Power: 8 Hi, NLels Just now I found its my misunderstanding. You've replied before I delete my thread. However, thank you very much.

 March 20, 2012, 20:45 #4 Member   Yuri Feldman Join Date: Mar 2011 Posts: 30 Rep Power: 6 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

March 18, 2014, 15:06
#5
New Member

Alex Chan
Join Date: Jan 2014
Location: Amherst, MA
Posts: 10
Rep Power: 3

I am getting an error where the product E*ypl was negative in:

Quote:
 ypl = log(E*ypl)/kappa;
I ran gdb and here's the output that shows a log of a negative number, and the values of kappa, and E:

Quote:
 (gdb) bt #0 0x00007ffff162ead4 in log () from /lib64/libm.so.6 #1 0x00007ffff5bd67ad in Foam::log (s=-0.0072670797110974744) at /home/achan/foam/foam-extend-3.0/src/foam/lnInclude/Scalar.H:242 #2 0x00007ffff3af7d9e in Foam::compressible::RASModel::yPlusLam (this=0xd3bb10, kappa=0.40999999999999998, E=0.95255364484361649) at RASModel/RASModel.C:162 #3 0x00007ffff3bca35a in Foam::compressible::RASModels::mutRoughWallFunctio nFvPatchScalarField::calcMut ( this=0xd41d10) at derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C:98 #4 0x00007ffff3bc9321 in Foam::compressible::RASModels::mutWallFunctionFvPa tchScalarField::updateCoeffs ( this=0xd41d10) at derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C:192 #5 0x00000000004c0ff5 in Foam::fvPatchField::evaluate (this=0xd41d10) at /home/achan/foam/foam-extend-3.0/src/finiteVolume/lnInclude/fvPatchField.C:237 #6 0x00000000004b12d9 in Foam::GeometricField::GeometricBoundaryField::evaluate (this=0xd3c350) at /home/achan/foam/foam-extend-3.0/src/foam/lnInclude/GeometricBoundaryField.C:308 #7 0x000000000049ba1e in Foam::GeometricField::correctBoundaryConditions (this=0xd3c278) at /home/achan/foam/foam-extend-3.0/src/foam/lnInclude/GeometricField.C:880 #8 0x00007ffff3b37e4c in Foam::compressible::RASModels::kEpsilon::correct (this=0xd3bb10) at kEpsilon/kEpsilon.C:335
How could that product be negative?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

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