mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updates to function objects
This commit is contained in:
@ -65,25 +65,13 @@ void Foam::regionSizeDistribution::writeGraph
|
|||||||
const scalarField& values
|
const scalarField& values
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
|
||||||
|
|
||||||
const wordList valNames(1, valueName);
|
const wordList valNames(1, valueName);
|
||||||
|
|
||||||
fileName outputPath = baseFileDir()/name_;
|
fileName outputPath = baseTimeDir();
|
||||||
|
|
||||||
if (mesh.name() != fvMesh::defaultRegion)
|
|
||||||
{
|
|
||||||
outputPath = outputPath/mesh.name();
|
|
||||||
}
|
|
||||||
|
|
||||||
outputPath = outputPath/mesh.time().timeName();
|
|
||||||
|
|
||||||
mkDir(outputPath);
|
mkDir(outputPath);
|
||||||
OFstream str
|
|
||||||
(
|
OFstream str(outputPath/formatterPtr_().getFileName(coords, valNames));
|
||||||
outputPath
|
|
||||||
/ formatterPtr_().getFileName(coords, valNames)
|
|
||||||
);
|
|
||||||
Info<< "Writing distribution of " << valueName << " to " << str.name()
|
Info<< "Writing distribution of " << valueName << " to " << str.name()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|||||||
@ -166,8 +166,7 @@ void Foam::forceCoeffs::write()
|
|||||||
mag(binPoints_)
|
mag(binPoints_)
|
||||||
);
|
);
|
||||||
|
|
||||||
fileName forcesDir =
|
fileName forcesDir = baseTimeDir();
|
||||||
baseFileDir()/name_/obr_.time().timeName();
|
|
||||||
mkDir(forcesDir);
|
mkDir(forcesDir);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
|
|||||||
@ -228,7 +228,7 @@ void Foam::forces::writeBins() const
|
|||||||
autoPtr<writer<vector> > binWriterPtr(writer<vector>::New(binFormat_));
|
autoPtr<writer<vector> > binWriterPtr(writer<vector>::New(binFormat_));
|
||||||
coordSet axis("forces", "distance", binPoints_, mag(binPoints_));
|
coordSet axis("forces", "distance", binPoints_, mag(binPoints_));
|
||||||
|
|
||||||
fileName forcesDir = baseFileDir()/name_/obr_.time().timeName();
|
fileName forcesDir = baseTimeDir();
|
||||||
mkDir(forcesDir);
|
mkDir(forcesDir);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
|
|||||||
@ -66,12 +66,15 @@ void Foam::wallShearStress::calcShearStress
|
|||||||
|
|
||||||
ssp = (-Sfp/magSfp) & Reffp;
|
ssp = (-Sfp/magSfp) & Reffp;
|
||||||
|
|
||||||
vector minSsp = min(ssp);
|
vector minSsp = gMin(ssp);
|
||||||
vector maxSsp = max(ssp);
|
vector maxSsp = gMax(ssp);
|
||||||
|
|
||||||
file() << mesh.time().timeName() << token::TAB
|
if (Pstream::master())
|
||||||
<< pp.name() << token::TAB << minSsp
|
{
|
||||||
<< token::TAB << maxSsp << endl;
|
file() << mesh.time().timeName() << token::TAB
|
||||||
|
<< pp.name() << token::TAB << minSsp
|
||||||
|
<< token::TAB << maxSsp << endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,15 +84,15 @@ void Foam::yPlusLES::calcIncompressibleYPlus
|
|||||||
|
|
||||||
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
||||||
|
|
||||||
scalar minYp = min(Yp);
|
scalar minYp = gMin(Yp);
|
||||||
scalar maxYp = max(Yp);
|
scalar maxYp = gMax(Yp);
|
||||||
scalar avgYp = average(Yp);
|
scalar avgYp = gAverage(Yp);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
Info<< " patch " << currPatch.name()
|
Info<< " patch " << currPatch.name()
|
||||||
<< " y+ : min = " << min(Yp) << ", max = " << max(Yp)
|
<< " y+ : min = " << minYp << ", max = " << maxYp
|
||||||
<< ", average = " << average(Yp) << nl;
|
<< ", average = " << avgYp << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
@ -150,15 +150,15 @@ void Foam::yPlusLES::calcCompressibleYPlus
|
|||||||
|
|
||||||
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
||||||
|
|
||||||
scalar minYp = min(Yp);
|
scalar minYp = gMin(Yp);
|
||||||
scalar maxYp = max(Yp);
|
scalar maxYp = gMax(Yp);
|
||||||
scalar avgYp = average(Yp);
|
scalar avgYp = gAverage(Yp);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
Info<< " patch " << currPatch.name()
|
Info<< " patch " << currPatch.name()
|
||||||
<< " y+ : min = " << min(Yp) << ", max = " << max(Yp)
|
<< " y+ : min = " << minYp << ", max = " << maxYp
|
||||||
<< ", average = " << average(Yp) << nl;
|
<< ", average = " << avgYp << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
|
|||||||
@ -79,9 +79,9 @@ void Foam::yPlusRAS::calcIncompressibleYPlus
|
|||||||
yPlus.boundaryField()[patchI] = nutPw.yPlus();
|
yPlus.boundaryField()[patchI] = nutPw.yPlus();
|
||||||
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
||||||
|
|
||||||
scalar minYp = min(Yp);
|
scalar minYp = gMin(Yp);
|
||||||
scalar maxYp = max(Yp);
|
scalar maxYp = gMax(Yp);
|
||||||
scalar avgYp = average(Yp);
|
scalar avgYp = gAverage(Yp);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
@ -137,9 +137,9 @@ void Foam::yPlusRAS::calcCompressibleYPlus
|
|||||||
yPlus.boundaryField()[patchI] = mutPw.yPlus();
|
yPlus.boundaryField()[patchI] = mutPw.yPlus();
|
||||||
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
const scalarField& Yp = yPlus.boundaryField()[patchI];
|
||||||
|
|
||||||
scalar minYp = min(Yp);
|
scalar minYp = gMin(Yp);
|
||||||
scalar maxYp = max(Yp);
|
scalar maxYp = gMax(Yp);
|
||||||
scalar avgYp = average(Yp);
|
scalar avgYp = gAverage(Yp);
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user