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
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "HashSet.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "wallDist.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -68,42 +69,18 @@ Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity()
|
||||
|
||||
// * * * * * * * * * * * * * * * 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()
|
||||
{
|
||||
volScalarField y_
|
||||
(
|
||||
IOobject
|
||||
faceDiffusivity_ =
|
||||
1.0
|
||||
/fvc::interpolate
|
||||
(
|
||||
"y",
|
||||
mesh().time().timeName(),
|
||||
mesh()
|
||||
),
|
||||
mesh(),
|
||||
dimless,
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
y_.primitiveFieldRef() = y();
|
||||
y_.correctBoundaryConditions();
|
||||
|
||||
faceDiffusivity_ = 1.0/fvc::interpolate(y_);
|
||||
wallDist::New
|
||||
(
|
||||
mesh(),
|
||||
mesh().boundaryMesh().patchSet(patchNames_)
|
||||
).y()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,8 +60,6 @@ class inverseDistanceDiffusivity
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Return patch-cell-centre distance field
|
||||
tmp<scalarField> y() const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
inverseDistanceDiffusivity(const inverseDistanceDiffusivity&);
|
||||
|
||||
Reference in New Issue
Block a user