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

yPlusLam() in RASModel.C

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 17, 2009, 02:41
Default yPlusLam() in RASModel.C
  #1
New Member
 
Guanghao Wu
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 15
Rep Power: 8
guanghaowu is on a distinguished road
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.
guanghaowu is offline   Reply With Quote

Old   August 17, 2009, 03:12
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Good morning

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

Best regards,

NIels
ngj is offline   Reply With Quote

Old   August 17, 2009, 03:20
Default
  #3
New Member
 
Guanghao Wu
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 15
Rep Power: 8
guanghaowu is on a distinguished road
Hi, NLels

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

However, thank you very much.
guanghaowu is offline   Reply With Quote

Old   March 20, 2012, 20:45
Default
  #4
Member
 
Yuri Feldman
Join Date: Mar 2011
Posts: 30
Rep Power: 6
feldy77 is on a distinguished road
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
feldy77 is offline   Reply With Quote

Old   March 18, 2014, 15:06
Default
  #5
New Member
 
Alex Chan
Join Date: Jan 2014
Location: Amherst, MA
Posts: 10
Rep Power: 3
AlexC is on a distinguished road
Two years later, I too have a question about this - why only iterate 10 times?

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<double>::evaluate (this=0xd41d10)
at /home/achan/foam/foam-extend-3.0/src/finiteVolume/lnInclude/fvPatchField.C:237
#6 0x00000000004b12d9 in Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate (this=0xd3c350) at /home/achan/foam/foam-extend-3.0/src/foam/lnInclude/GeometricBoundaryField.C:308
#7 0x000000000049ba1e in Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::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?
AlexC is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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



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