mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Simplified the wallShearStress function object
This commit is contained in:
@ -99,7 +99,6 @@ Foam::wallShearStress::wallShearStress
|
|||||||
obr_(obr),
|
obr_(obr),
|
||||||
active_(true),
|
active_(true),
|
||||||
log_(false),
|
log_(false),
|
||||||
phiName_("phi"),
|
|
||||||
patchSet_()
|
patchSet_()
|
||||||
{
|
{
|
||||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||||
@ -136,7 +135,6 @@ void Foam::wallShearStress::read(const dictionary& dict)
|
|||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
|
||||||
|
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||||
@ -231,38 +229,27 @@ void Foam::wallShearStress::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
|
||||||
obr_.lookupObject<surfaceScalarField>(phiName_);
|
|
||||||
|
|
||||||
tmp<volSymmTensorField> Reff;
|
tmp<volSymmTensorField> Reff;
|
||||||
if (phi.dimensions() == dimMass/dimTime)
|
if (mesh.foundObject<cmpModel>("turbulenceModel"))
|
||||||
{
|
{
|
||||||
if (!mesh.foundObject<cmpModel>("turbulenceModel"))
|
|
||||||
{
|
|
||||||
FatalErrorIn("void Foam::wallShearStress::write()")
|
|
||||||
<< "Unable to find compressible turbulence model in the "
|
|
||||||
<< "database" << exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const cmpModel& model =
|
const cmpModel& model =
|
||||||
mesh.lookupObject<cmpModel>("turbulenceModel");
|
mesh.lookupObject<cmpModel>("turbulenceModel");
|
||||||
|
|
||||||
Reff = model.devRhoReff();
|
Reff = model.devRhoReff();
|
||||||
}
|
}
|
||||||
else
|
else if (mesh.foundObject<icoModel>("turbulenceModel"))
|
||||||
{
|
{
|
||||||
if (!mesh.foundObject<icoModel>("turbulenceModel"))
|
|
||||||
{
|
|
||||||
FatalErrorIn("void Foam::wallShearStress::write()")
|
|
||||||
<< "Unable to find incompressible turbulence model in the "
|
|
||||||
<< "database" << exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const icoModel& model =
|
const icoModel& model =
|
||||||
mesh.lookupObject<icoModel>("turbulenceModel");
|
mesh.lookupObject<icoModel>("turbulenceModel");
|
||||||
|
|
||||||
Reff = model.devReff();
|
Reff = model.devReff();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("void Foam::wallShearStress::write()")
|
||||||
|
<< "Unable to find incompressible turbulence model in the "
|
||||||
|
<< "database" << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
calcShearStress(mesh, Reff(), wallShearStress);
|
calcShearStress(mesh, Reff(), wallShearStress);
|
||||||
|
|||||||
@ -113,9 +113,6 @@ protected:
|
|||||||
//- Switch to send output to Info as well as to file
|
//- Switch to send output to Info as well as to file
|
||||||
Switch log_;
|
Switch log_;
|
||||||
|
|
||||||
//- Name of mass/volume flux field (optional, default = phi)
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Optional list of patches to process
|
//- Optional list of patches to process
|
||||||
labelHashSet patchSet_;
|
labelHashSet patchSet_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user