Skip to content
Snippets Groups Projects
Commit af3fbf90 authored by Henry's avatar Henry
Browse files

wallDist: Set BCs for y and n appropriately for solving PDEs

parent f524fa1e
Branches
Tags
No related merge requests found
......@@ -126,6 +126,12 @@ public:
// Member Functions
//- Return the patchIDs
const labelHashSet& patchIDs() const
{
return patchIDs_;
}
//- Update cached geometry when the mesh moves
virtual bool movePoints()
{
......
......@@ -24,7 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "wallDist.H"
#include "wallFvPatch.H"
#include "wallPolyPatch.H"
#include "fixedValueFvPatchFields.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -34,6 +36,26 @@ namespace Foam
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
Foam::wordList Foam::wallDist::patchTypes(const labelHashSet& patchIDs) const
{
wordList yTypes
(
mesh().boundary().size(),
zeroGradientFvPatchField<Type>::typeName
);
forAllConstIter(labelHashSet, patchIDs, iter)
{
yTypes[iter.key()] = fixedValueFvPatchField<Type>::typeName;
}
return yTypes;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallDist::wallDist(const fvMesh& mesh)
......@@ -57,7 +79,8 @@ Foam::wallDist::wallDist(const fvMesh& mesh)
mesh
),
mesh,
dimensionedScalar("yWall", dimLength, GREAT)
dimensionedScalar("yWall", dimLength, GREAT),
patchTypes<scalar>(pdm_->patchIDs())
),
n_(NULL)
{
......@@ -74,18 +97,18 @@ Foam::wallDist::wallDist(const fvMesh& mesh)
mesh
),
mesh,
dimensionedVector("nWall", dimless, vector::zero)
dimensionedVector("nWall", dimless, vector::zero),
patchTypes<vector>(pdm_->patchIDs())
)
);
const labelHashSet& patchIDs = pdm_->patchIDs();
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
forAllConstIter(labelHashSet, patchIDs, iter)
{
if (isA<wallFvPatch>(patches[patchi]))
{
n_().boundaryField()[patchi] = patches[patchi].nf();
}
label patchi = iter.key();
n_().boundaryField()[patchi] == patches[patchi].nf();
}
movePoints();
......
......@@ -68,6 +68,11 @@ class wallDist
// Private Member Functions
//- Return the patch types for y and n
// These are fixedValue for the set provided otherwise zero-gradient
template<class Type>
wordList patchTypes(const labelHashSet& patchIDs) const;
//- Disallow default bitwise copy construct
wallDist(const wallDist&);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment