mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev/
This commit is contained in:
@ -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,21 +39,20 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#include "addTimeOptions.H"
|
||||||
|
#include "setRootCase.H"
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
#include "createTime.H"
|
||||||
# include "setRootCase.H"
|
|
||||||
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
// Get times list
|
// Get times list
|
||||||
instantList Times = runTime.times();
|
instantList Times = runTime.times();
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
// set startTime and endTime depending on -time and -latestTime options
|
||||||
# include "checkTimeOptions.H"
|
#include "checkTimeOptions.H"
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
runTime.setTime(Times[startTime], startTime);
|
||||||
|
|
||||||
# include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
for (label i=startTime; i<endTime; i++)
|
||||||
{
|
{
|
||||||
@ -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,8 +76,34 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("yPlus", dimless, 0.0)
|
dimensionedScalar("yPlus", dimless, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const fvPatchList& patches = mesh.boundary();
|
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();
|
||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -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,21 +39,20 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#include "addTimeOptions.H"
|
||||||
|
#include "setRootCase.H"
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
#include "createTime.H"
|
||||||
# include "setRootCase.H"
|
|
||||||
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
// Get times list
|
// Get times list
|
||||||
instantList Times = runTime.times();
|
instantList Times = runTime.times();
|
||||||
|
|
||||||
// set startTime and endTime depending on -time and -latestTime options
|
// set startTime and endTime depending on -time and -latestTime options
|
||||||
# include "checkTimeOptions.H"
|
#include "checkTimeOptions.H"
|
||||||
|
|
||||||
runTime.setTime(Times[startTime], startTime);
|
runTime.setTime(Times[startTime], startTime);
|
||||||
|
|
||||||
# include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
for (label i=startTime; i<endTime; i++)
|
for (label i=startTime; i<endTime; i++)
|
||||||
{
|
{
|
||||||
@ -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,21 +90,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField yPlus
|
#include "createPhi.H"
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"yPlus",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("yPlus", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
# 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;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user