CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

How to calculate yPlus in DNS

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 7, 2015, 10:52
Default How to calculate yPlus in DNS
  #1
Member
 
Jason Tan
Join Date: Sep 2014
Posts: 47
Rep Power: 11
tzqfly is on a distinguished road
Hello,
everybody, I'm a new openFoamer and I want to calculate the yPlus of inter cell in DNS. I read threads but they all about LES's yPlus, so I want to change it into DNS's yPlus. Fortunately, I found a perfect unity to calculate LES's yPlus, the codes are:


#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/LES/LESModel/LESModel.H"
#include "LESModel.H"

//aali
//#include "compressible/LES/LESModel/LESModel.H"

//#include "basicThermo.H"
//ali
#include "wallFvPatch.H"

#include "nearWallDist.H"
#include "wallDist.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"

forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
fvMesh::readUpdateState state = mesh.readUpdate();

// Wall distance
wallDist y(mesh, true);
if (timeI == 0 || state != fvMesh::UNCHANGED)
{
Info<< "Calculating wall distance\n" << endl;

Info<< "Writing wall distance to field "
<< y.name() << nl << endl;
y.write();
}

#include "createFields.H"

volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
volScalarField nuEff(sgsModel->nuEff());

const fvPatchList& patches = mesh.boundary();

dimensionedScalar uTauAvg("uTauAvg", dimVelocity, 0);

const volScalarField nuLam(sgsModel->nu());

scalar nPatch = 0;

Info<< "Summary: " << nl << endl;

forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];

if (typeid(currPatch) == typeid(wallFvPatch))//isA<wallFvPatch>(currPatch))
{
yPlusTemp.boundaryField()[patchi] =
d[patchi]
*sqrt
(
nuEff.boundaryField()[patchi]
*mag(U.boundaryField()[patchi].snGrad())
)
/nuLam.boundaryField()[patchi];
const scalarField& YpTemp = yPlusTemp.boundaryField()[patchi];

//effective viscosity used in the calculation of u*
uTau.boundaryField()[patchi] =
sqrt
(
sgsModel->nuEff()
*mag(U.boundaryField()[patchi].snGrad())
);
const fvPatchScalarField& uTauWall = uTau.boundaryField()[patchi];

dimensionedScalar uTauTmp("uTauTmp", dimVelocity, average(uTauWall));

uTauAvg += uTauTmp;

nPatch ++;

Info<< "Patch " << patchi
<< " named " << currPatch.name()
<< " y+ : min: " << min(YpTemp) << " max: " << max(YpTemp)
<< " average: " << average(YpTemp)
<< " avgUGradWall: " << average(mag(U.boundaryField()[patchi].snGrad()))
<< nl << endl;

}
}

uTauAvg /= nPatch;

Info << " avg. friction velocity uTau is: "
<< uTauAvg.value() << " (averaged over " << nPatch << " wall(s))" << nl <<endl;
//yPlus is = u* x y/nu
yPlus = y.y() * uTauAvg / ((sgsModel->nu()));

uPlus = U / uTauAvg;

Info << "Writing yPlus and uPlus to corresponding fields." << nl <<endl;
yPlus.write();
uPlus.write();

// Info<< "Writing yPlus to field "
// << yPlus.name() << nl << endl;
//
// yPlus.write();
}

Info<< "End\n" << endl;

return 0;
}


and now, the problem is how to chang it into calculate DNS's yPlus. and I make some effort, I know "sgsModel->nuEff() " is using in LES and DNS has nothing about model. So I don't know how to deal with "sgsModel->nuEff()“、”nuEff.boundaryField()[patchi]“ and " sgsModel->nuEff()*mag(U.boundaryField()[patchi].snGrad())"

Can someone help me ? Or somebody has the unity about calculating DNS's yPlus ,please show me!!


Thank you all.
tzqfly is offline   Reply With Quote

Old   April 15, 2016, 10:37
Default
  #2
New Member
 
Dan Pearce
Join Date: May 2013
Posts: 9
Rep Power: 12
Dan Pearce is on a distinguished road
Hi tzqfly,
Did you make any progress on this issue? I am trying to modify the LES yplus utility and I'm trying to understand the difference between nuLam and nuEff....
Dan Pearce is offline   Reply With Quote

Old   June 25, 2019, 23:01
Default
  #3
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
is the postProcess yPlus tool available for DNS?
calf.Z is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Everything you need to compute DNS in channel vs OF 2.1.0 levka OpenFOAM Running, Solving & CFD 41 October 30, 2023 11:17
DNS of Re 3900 cylinder flow cfdnewbie Main CFD Forum 8 May 30, 2013 15:30
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57
DNS in Turbulent S.O.S. Urgent Hengky FLUENT 11 September 28, 2006 10:07


All times are GMT -4. The time now is 23:31.