|October 7, 2015, 10:52||
How to calculate yPlus in DNS
Join Date: Sep 2014
Posts: 47Rep Power: 4
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:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv)
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
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;
volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
const fvPatchList& patches = mesh.boundary();
dimensionedScalar uTauAvg("uTauAvg", dimVelocity, 0);
const volScalarField nuLam(sgsModel->nu());
scalar nPatch = 0;
Info<< "Summary: " << nl << endl;
const fvPatch& currPatch = patches[patchi];
if (typeid(currPatch) == typeid(wallFvPatch))//isA<wallFvPatch>(currPatch))
const scalarField& YpTemp = yPlusTemp.boundaryField()[patchi];
//effective viscosity used in the calculation of u*
const fvPatchScalarField& uTauWall = uTau.boundaryField()[patchi];
dimensionedScalar uTauTmp("uTauTmp", dimVelocity, average(uTauWall));
uTauAvg += uTauTmp;
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;
// Info<< "Writing yPlus to field "
// << yPlus.name() << nl << endl;
Info<< "End\n" << endl;
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.
|April 15, 2016, 10:37||
Join Date: May 2013
Posts: 9Rep Power: 5
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....
|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||29||January 29, 2016 10:58|
|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 03:57|
|DNS in Turbulent S.O.S. Urgent||Hengky||FLUENT||11||September 28, 2006 10:07|