wallShearStress: utility replaced by functionObject used with the '-postProcess' option

This commit is contained in:
Henry Weller
2016-06-09 16:05:13 +01:00
parent 2c61071f99
commit 8eabf85f9a
9 changed files with 48 additions and 262 deletions

View File

@ -52,5 +52,6 @@ MachNo/MachNo.C
turbulenceFields/turbulenceFields.C
yPlus/yPlus.C
wallShearStress/wallShearStress.C
LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects

View File

@ -67,7 +67,6 @@ void Foam::functionObjects::wallShearStress::calcShearStress
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();
const polyPatch& pp = mesh.boundaryMesh()[patchi];
vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh.Sf().boundaryField()[patchi];
@ -75,21 +74,6 @@ void Foam::functionObjects::wallShearStress::calcShearStress
const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp;
vector minSsp = gMin(ssp);
vector maxSsp = gMax(ssp);
if (Pstream::master())
{
file() << mesh.time().value()
<< token::TAB << pp.name()
<< token::TAB << minSsp
<< token::TAB << maxSsp
<< endl;
}
Log << " min/max(" << pp.name() << ") = "
<< minSsp << ", " << maxSsp << endl;
}
}
@ -212,8 +196,6 @@ bool Foam::functionObjects::wallShearStress::execute(const bool postProcess)
typedef compressible::turbulenceModel cmpModel;
typedef incompressible::turbulenceModel icoModel;
writeFiles::write();
const fvMesh& mesh = refCast<const fvMesh>(obr_);
volVectorField& wallShearStress =
@ -222,9 +204,6 @@ bool Foam::functionObjects::wallShearStress::execute(const bool postProcess)
mesh.lookupObject<volVectorField>(type())
);
Log << type() << " " << name() << " output:" << nl;
tmp<volSymmTensorField> Reff;
if (mesh.foundObject<cmpModel>(turbulenceModel::propertiesName))
{
@ -260,12 +239,37 @@ bool Foam::functionObjects::wallShearStress::write(const bool postProcess)
const volVectorField& wallShearStress =
obr_.lookupObject<volVectorField>(type());
Log << type() << " " << name() << " output:" << nl
<< " writing field " << wallShearStress.name() << nl
<< endl;
Log << type() << " " << name() << " write:" << nl
<< " writing field " << wallShearStress.name() << endl;
wallShearStress.write();
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const fvPatchList& patches = mesh.boundary();
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();
const fvPatch& pp = patches[patchi];
const vectorField& ssp = wallShearStress.boundaryField()[patchi];
vector minSsp = gMin(ssp);
vector maxSsp = gMax(ssp);
if (Pstream::master())
{
file() << mesh.time().value()
<< token::TAB << pp.name()
<< token::TAB << minSsp
<< token::TAB << maxSsp
<< endl;
}
Log << " min/max(" << pp.name() << ") = "
<< minSsp << ", " << maxSsp << endl;
}
return true;
}

View File

@ -1,4 +1,3 @@
wallShearStress/wallShearStress.C
forces/forces.C
forceCoeffs/forceCoeffs.C