mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: wallShearStress function object - store result on mesh database
This commit is contained in:
@ -121,6 +121,35 @@ Foam::wallShearStress::wallShearStress
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volVectorField* wallShearStressPtr
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector
|
||||
(
|
||||
"0",
|
||||
sqr(dimLength)/sqr(dimTime),
|
||||
vector::zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(wallShearStressPtr);
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
@ -219,17 +248,10 @@ void Foam::wallShearStress::write()
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volVectorField wallShearStress
|
||||
volVectorField& wallShearStress =
|
||||
const_cast<volVectorField&>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"wallShearStress",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("0", sqr(dimLength)/sqr(dimTime), vector::zero)
|
||||
mesh.lookupObject<volVectorField>(type())
|
||||
);
|
||||
|
||||
if (log_)
|
||||
@ -256,7 +278,7 @@ void Foam::wallShearStress::write()
|
||||
else
|
||||
{
|
||||
FatalErrorIn("void Foam::wallShearStress::write()")
|
||||
<< "Unable to find incompressible turbulence model in the "
|
||||
<< "Unable to find turbulence model in the "
|
||||
<< "database" << exit(FatalError);
|
||||
}
|
||||
|
||||
@ -265,7 +287,8 @@ void Foam::wallShearStress::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< " writing field " << wallShearStress.name() << nl
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
<< " writing field " << wallShearStress.name() << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user