BUG: forces/forceCoeffs - corrected behaviour for case that input fields are not available. Fixes #107

This commit is contained in:
Andrew Heather
2016-04-28 14:23:38 +01:00
parent 200c490f44
commit cfcaaa85e4
2 changed files with 15 additions and 9 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -219,7 +219,7 @@ Foam::forceCoeffs::forceCoeffs
CdBinFilePtr_(),
ClBinFilePtr_()
{
if (readFields)
if (active_ && readFields)
{
read(dict);
if (log_) Info << endl;
@ -310,6 +310,12 @@ void Foam::forceCoeffs::execute()
forces::calcForcesMoment();
// Need to re-check active_ flag - may have been reset in calcForcesMoment
if (!active_)
{
return;
}
createFiles();
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;