mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: adding runTime selectable wallDist calculation to inverseDistanceDiffusivity
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
#include "zeroGradientFvPatchFields.H"
|
#include "zeroGradientFvPatchFields.H"
|
||||||
|
#include "wallDist.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -68,42 +69,18 @@ Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::inverseDistanceDiffusivity::y() const
|
|
||||||
{
|
|
||||||
labelHashSet patchSet(mesh().boundaryMesh().patchSet(patchNames_));
|
|
||||||
|
|
||||||
if (patchSet.size())
|
|
||||||
{
|
|
||||||
return tmp<scalarField>
|
|
||||||
(
|
|
||||||
new scalarField(patchWave(mesh(), patchSet, false).distance())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return tmp<scalarField>(new scalarField(mesh().nCells(), 1.0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::inverseDistanceDiffusivity::correct()
|
void Foam::inverseDistanceDiffusivity::correct()
|
||||||
{
|
{
|
||||||
volScalarField y_
|
faceDiffusivity_ =
|
||||||
|
1.0
|
||||||
|
/fvc::interpolate
|
||||||
(
|
(
|
||||||
IOobject
|
wallDist::New
|
||||||
(
|
(
|
||||||
"y",
|
|
||||||
mesh().time().timeName(),
|
|
||||||
mesh()
|
|
||||||
),
|
|
||||||
mesh(),
|
mesh(),
|
||||||
dimless,
|
mesh().boundaryMesh().patchSet(patchNames_)
|
||||||
zeroGradientFvPatchScalarField::typeName
|
).y()
|
||||||
);
|
);
|
||||||
y_.primitiveFieldRef() = y();
|
|
||||||
y_.correctBoundaryConditions();
|
|
||||||
|
|
||||||
faceDiffusivity_ = 1.0/fvc::interpolate(y_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -60,8 +60,6 @@ class inverseDistanceDiffusivity
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Return patch-cell-centre distance field
|
|
||||||
tmp<scalarField> y() const;
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
inverseDistanceDiffusivity(const inverseDistanceDiffusivity&);
|
inverseDistanceDiffusivity(const inverseDistanceDiffusivity&);
|
||||||
|
|||||||
Reference in New Issue
Block a user