STY: Improving log info in stabilityBlendingFactor

This commit is contained in:
sergio
2018-06-14 12:44:43 -07:00
parent b76d6b5cb5
commit d77df7aa11

View File

@ -73,18 +73,25 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
const IOField<scalar>* residualPtr = const IOField<scalar>* residualPtr =
mesh_.lookupObjectPtr<IOField<scalar>>(residualName_); mesh_.lookupObjectPtr<IOField<scalar>>(residualName_);
if (log)
{
Log << nl << type() << " : " << nl;
}
if (residuals_) if (residuals_)
{ {
if (!residualPtr) if (!residualPtr)
{ {
WarningInFunction WarningInFunction
<< "Could not find residual file : " << residualName_ << nl << "Could not find residual file : " << residualName_
<< "The residual mode won't be considered for the blended " << ".The residual mode won't be " << nl
<< "field in the stability blending factor. " << nl << " considered for the blended field in the stability "
<< "blending factor. " << nl
<< " Add the corresponding residual function object. " << nl << " Add the corresponding residual function object. " << nl
<< "If the residual function object is already set " << nl << " If the residual function object is already set "
<< "you might need to wait for the first iteration." << "you might need to wait " << nl
<< endl; << " for the first iteration."
<< nl << endl;
} }
else else
{ {
@ -284,6 +291,13 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
if (Co_) if (Co_)
{ {
if (Co1_ >= Co2_)
{
FatalErrorInFunction
<< " Co2 should be larger than Co1."
<< exit(FatalError);
}
tmp<volScalarField> CoPtr tmp<volScalarField> CoPtr
( (
new volScalarField new volScalarField
@ -321,6 +335,11 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
} }
} }
if (log)
{
Log << nl;
}
indicator_.correctBoundaryConditions(); indicator_.correctBoundaryConditions();
indicator_.min(1.0); indicator_.min(1.0);
indicator_.max(0.0); indicator_.max(0.0);
@ -535,6 +554,8 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor
} }
init(true); init(true);
writeFileHeader(file());
} }
@ -590,6 +611,37 @@ bool Foam::functionObjects::stabilityBlendingFactor::read
<< tolerance_ << exit(FatalError); << tolerance_ << exit(FatalError);
} }
Info<< type() << " " << name() << ":" << nl;
if (nonOrthogonality_)
{
Info<< " Including nonOrthogonality between: "
<< minNonOrthogonality_ << " and " << maxNonOrthogonality_ << endl;
}
if (gradCc_)
{
Info<< " Including gradient between: "
<< minGradCc_ << " and " << maxGradCc_ << endl;
}
if (residuals_)
{
Info<< " Including residuals" << endl;
}
if (faceWeight_)
{
Info<< " Including faceWeight between: "
<< minFaceWeight_ << " and " << maxFaceWeight_ << endl;
}
if (skewness_)
{
Info<< " Including skewness between: "
<< minSkewness_ << " and " << maxSkewness_ << endl;
}
if (Co_)
{
Info<< " Including Co between: "
<< Co2_ << " and " << Co1_ << endl;
}
return true; return true;
} }
else else
@ -627,7 +679,8 @@ bool Foam::functionObjects::stabilityBlendingFactor::write()
reduce(nCellsScheme2, sumOp<label>()); reduce(nCellsScheme2, sumOp<label>());
reduce(nCellsBlended, sumOp<label>()); reduce(nCellsBlended, sumOp<label>());
Log << " scheme 1 cells : " << nCellsScheme1 << nl Log << nl << type() << " : " << nl
<< " scheme 1 cells : " << nCellsScheme1 << nl
<< " scheme 2 cells : " << nCellsScheme2 << nl << " scheme 2 cells : " << nCellsScheme2 << nl
<< " blended cells : " << nCellsBlended << nl << " blended cells : " << nCellsBlended << nl
<< endl; << endl;
@ -635,9 +688,9 @@ bool Foam::functionObjects::stabilityBlendingFactor::write()
writeTime(file()); writeTime(file());
file() file()
<< token::TAB << nCellsScheme1 << tab << nCellsScheme1
<< token::TAB << nCellsScheme2 << tab << nCellsScheme2
<< token::TAB << nCellsBlended << tab << nCellsBlended
<< endl; << endl;
return true; return true;