mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated wallShearStress function object to handle specific patches
This commit is contained in:
@ -53,12 +53,11 @@ void Foam::wallShearStress::calcShearStress
|
||||
volVectorField& shearStress
|
||||
)
|
||||
{
|
||||
forAll(shearStress.boundaryField(), patchI)
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchI = iter.key();
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||
|
||||
if (isA<wallPolyPatch>(pp))
|
||||
{
|
||||
vectorField& ssp = shearStress.boundaryField()[patchI];
|
||||
const vectorField& Sfp = mesh.Sf().boundaryField()[patchI];
|
||||
const scalarField& magSfp = mesh.magSf().boundaryField()[patchI];
|
||||
@ -83,7 +82,6 @@ void Foam::wallShearStress::calcShearStress
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -101,7 +99,8 @@ Foam::wallShearStress::wallShearStress
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
phiName_("phi")
|
||||
phiName_("phi"),
|
||||
patchSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
@ -138,6 +137,54 @@ void Foam::wallShearStress::read(const dictionary& dict)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
patchSet_ =
|
||||
mesh.boundaryMesh().patchSet
|
||||
(
|
||||
wordReList(dict.lookupOrDefault("patches", wordReList()))
|
||||
);
|
||||
|
||||
Info<< type() << " output:" << nl;
|
||||
|
||||
if (patchSet_.empty())
|
||||
{
|
||||
forAll(pbm, patchI)
|
||||
{
|
||||
if (isA<wallPolyPatch>(pbm[patchI]))
|
||||
{
|
||||
patchSet_.insert(patchI);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< " processing all wall patches" << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " processing wall patches: " << nl;
|
||||
labelHashSet filteredPatchSet;
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchI = iter.key();
|
||||
if (isA<wallPolyPatch>(pbm[patchI]))
|
||||
{
|
||||
filteredPatchSet.insert(patchI);
|
||||
Info<< " " << pbm[patchI].name() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningIn("void wallShearStress::read(const dictionary&)")
|
||||
<< "Requested wall shear stress on non-wall boundary "
|
||||
<< "type patch: " << pbm[patchI].name() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
patchSet_ = filteredPatchSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,15 +36,34 @@ Description
|
||||
Stress = R \dot n
|
||||
\f]
|
||||
|
||||
The shear stress (symmetrical) tensor field is retrieved from the
|
||||
turbulence model.
|
||||
|
||||
where
|
||||
\vartable
|
||||
R | stress tensor
|
||||
n | patch normal vector (into the domain)
|
||||
\endvartable
|
||||
|
||||
The shear stress (symmetrical) tensor field is retrieved from the
|
||||
turbulence model. All wall patches are included by default; to restrict
|
||||
the calculation to certain patches, use the optional 'patches' entry.
|
||||
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
wallShearStress1
|
||||
{
|
||||
type wallShearStress;
|
||||
functionObjectLibs ("libutilityFunctionObjects.so");
|
||||
...
|
||||
patches (".*Wall");
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
\heading Function object usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: wallShearStress | yes |
|
||||
patches | list of patches to process | no | all wall patches
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
wallShearStress.C
|
||||
IOwallShearStress.H
|
||||
@ -97,6 +116,9 @@ protected:
|
||||
//- Name of mass/volume flux field (optional, default = phi)
|
||||
word phiName_;
|
||||
|
||||
//- Optional list of patches to process
|
||||
labelHashSet patchSet_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user