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;
|
<< 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);
|
read(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,18 +248,11 @@ void Foam::wallShearStress::write()
|
|||||||
|
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
volVectorField wallShearStress
|
volVectorField& wallShearStress =
|
||||||
(
|
const_cast<volVectorField&>
|
||||||
IOobject
|
|
||||||
(
|
(
|
||||||
"wallShearStress",
|
mesh.lookupObject<volVectorField>(type())
|
||||||
mesh.time().timeName(),
|
);
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedVector("0", sqr(dimLength)/sqr(dimTime), vector::zero)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
@ -256,7 +278,7 @@ void Foam::wallShearStress::write()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("void Foam::wallShearStress::write()")
|
FatalErrorIn("void Foam::wallShearStress::write()")
|
||||||
<< "Unable to find incompressible turbulence model in the "
|
<< "Unable to find turbulence model in the "
|
||||||
<< "database" << exit(FatalError);
|
<< "database" << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,7 +287,8 @@ void Foam::wallShearStress::write()
|
|||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
Info<< " writing field " << wallShearStress.name() << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
|
<< " writing field " << wallShearStress.name() << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user