wallDist: now a MeshObject cached and updated automatically with a run-time selected algorithm

When using models which require the wallDist e.g. kOmegaSST it will
request the method to be used from the wallDist sub-dictionary in
fvSchemes e.g.

wallDist
{
    method meshWave;
}

specifies the mesh-wave method as hard-coded in previous OpenFOAM versions.
This commit is contained in:
Henry
2015-01-08 10:40:23 +00:00
parent 9dc6b54c3d
commit 69ff8aa4d2
76 changed files with 778 additions and 294 deletions

View File

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::patchDistMethod
Description
Specialisation of patchDist for wall distance calculation
SourceFiles
patchDistMethod.C
\*---------------------------------------------------------------------------*/
#ifndef patchDistMethod_H
#define patchDistMethod_H
#include "dictionary.H"
#include "HashSet.H"
#include "volFieldsFwd.H"
#include "mapPolyMesh.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class fvMesh;
/*---------------------------------------------------------------------------*\
Class patchDistMethod Declaration
\*---------------------------------------------------------------------------*/
class patchDistMethod
{
protected:
// Protected Member Data
//- Reference to the mesh
const fvMesh& mesh_;
//- Set of patch IDs
const labelHashSet patchIDs_;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
patchDistMethod(const patchDistMethod&);
//- Disallow default bitwise assignment
void operator=(const patchDistMethod&);
public:
//- Runtime type information
TypeName("patchDistMethod");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
patchDistMethod,
dictionary,
(
const dictionary& dict,
const fvMesh& mesh,
const labelHashSet& patchIDs
),
(dict, mesh, patchIDs)
);
// Constructors
//- Construct from mesh and patch ID set
patchDistMethod
(
const fvMesh& mesh,
const labelHashSet& patchIDs
);
// Selectors
static autoPtr<patchDistMethod> New
(
const dictionary& dict,
const fvMesh& mesh,
const labelHashSet& patchIDs
);
//- Destructor
virtual ~patchDistMethod();
// Member Functions
//- Update cached geometry when the mesh moves
virtual bool movePoints()
{
return true;
}
//- Update cached topology and geometry when the mesh changes
virtual void updateMesh(const mapPolyMesh&)
{}
//- Correct the given distance-to-patch field
virtual bool correct(volScalarField& y) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //