Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev/

This commit is contained in:
andy
2008-05-13 16:34:10 +01:00
5 changed files with 67 additions and 52 deletions

View File

@ -26,7 +26,7 @@ Application
yPlusLES yPlusLES
Description Description
Calculates the yPlus of the near-wall cells for an LES. Calculates and reports yPlus for all wall patches, for each time.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,7 +39,6 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "addTimeOptions.H" #include "addTimeOptions.H"
#include "setRootCase.H" #include "setRootCase.H"
@ -63,9 +62,6 @@ int main(int argc, char *argv[])
mesh.readUpdate(); mesh.readUpdate();
# include "createFields.H"
volScalarField nuEff = sgsModel->nuEff();
volScalarField yPlus volScalarField yPlus
( (
IOobject IOobject
@ -80,6 +76,32 @@ int main(int argc, char *argv[])
dimensionedScalar("yPlus", dimless, 0.0) dimensionedScalar("yPlus", dimless, 0.0)
); );
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<LESmodel> sgsModel
(
LESmodel::New(U, phi, laminarTransport)
);
volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
volScalarField nuEff = sgsModel->nuEff();
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi) forAll(patches, patchi)
@ -96,6 +118,11 @@ int main(int argc, char *argv[])
*mag(U.boundaryField()[patchi].snGrad()) *mag(U.boundaryField()[patchi].snGrad())
) )
/sgsModel->nu().boundaryField()[patchi]; /sgsModel->nu().boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << currPatch.name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
} }
} }

View File

@ -5,14 +5,14 @@
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// checkYPlus tool definition // yPlusRAS tool definition
description "Create the y+ field"; description "Create the y+ field";
checkYPlusDict checkYPlusDict
{ {
type dictionary; type dictionary;
description "checkYPlus control dictionary"; description "yPlusRAS control dictionary";
dictionaryPath "system"; dictionaryPath "system";
entries entries

View File

@ -23,11 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application Application
checkYPlus yPlusRAS
Description Description
Calculates and reports yPlus for all wall patches, for each time in a Calculates and reports yPlus for all wall patches, for each time.
database.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -40,7 +39,6 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "addTimeOptions.H" #include "addTimeOptions.H"
#include "setRootCase.H" #include "setRootCase.H"
@ -64,18 +62,18 @@ int main(int argc, char *argv[])
mesh.readUpdate(); mesh.readUpdate();
Info << "Reading field p\n" << endl; volScalarField yPlus
volScalarField p
( (
IOobject IOobject
( (
"p", "yPlus",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::NO_WRITE
), ),
mesh mesh,
dimensionedScalar("yPlus", dimless, 0.0)
); );
Info << "Reading field U\n" << endl; Info << "Reading field U\n" << endl;
@ -92,20 +90,6 @@ int main(int argc, char *argv[])
mesh mesh
); );
volScalarField yPlus
(
IOobject
(
"yPlus",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("yPlus", dimless, 0.0)
);
#include "createPhi.H" #include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);
@ -115,15 +99,19 @@ int main(int argc, char *argv[])
turbulenceModel::New(U, phi, laminarTransport) turbulenceModel::New(U, phi, laminarTransport)
); );
forAll (mesh.boundary(), patchI) const fvPatchList& patches = mesh.boundary();
{
if (typeid(mesh.boundary()[patchI]) == typeid(wallFvPatch))
{
yPlus.boundaryField()[patchI] = turbulence->yPlus(patchI);
const scalarField& Yp = yPlus.boundaryField()[patchI];
Info<< "Patch " << patchI forAll(patches, patchi)
<< " named " << mesh.boundary()[patchI].name() {
const fvPatch& currPatch = patches[patchi];
if (typeid(currPatch) == typeid(wallFvPatch))
{
yPlus.boundaryField()[patchi] = turbulence->yPlus(patchi);
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << currPatch.name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp) << " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl; << " average: " << average(Yp) << nl << endl;
} }