Evaluate when auxiliary fields are not present

This commit is contained in:
Hrvoje Jasak 2012-01-29 11:46:02 +00:00
parent b5d1c30299
commit 43674c372f

View file

@ -111,6 +111,26 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
return;
}
// If variables are not found, evaluate as zero gradient
// HJ, 17/Jan/2012
if
(
!db().foundObject<uniformDimensionedVectorField>("g")
|| !db().foundObject<volScalarField>(rhoName_)
)
{
InfoIn
(
"void buoyantPressureFvPatchScalarField::updateCoeffs()"
) << "Fields required for evaluation not found for patch "
<< patch().name() << endl;
gradient() = 0;
fixedGradientFvPatchScalarField::updateCoeffs();
return;
}
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");