mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: forces/forceCoeffs - corrected behaviour for case that input fields are not available. Fixes #107
This commit is contained in:
@ -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_;
|
||||
|
||||
@ -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.
|
||||
@ -279,8 +279,8 @@ void Foam::forces::initialiseBins()
|
||||
// Allocate storage for forces and moments
|
||||
forAll(force_, i)
|
||||
{
|
||||
force_[i].setSize(nBin_);
|
||||
moment_[i].setSize(nBin_);
|
||||
force_[i].setSize(nBin_, vector::zero);
|
||||
moment_[i].setSize(nBin_, vector::zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -841,8 +841,8 @@ Foam::forces::forces
|
||||
|
||||
forAll(force_, i)
|
||||
{
|
||||
force_[i].setSize(nBin_);
|
||||
moment_[i].setSize(nBin_);
|
||||
force_[i].setSize(nBin_, vector::zero);
|
||||
moment_[i].setSize(nBin_, vector::zero);
|
||||
}
|
||||
}
|
||||
|
||||
@ -944,8 +944,8 @@ void Foam::forces::read(const dictionary& dict)
|
||||
// Allocate storage for forces and moments
|
||||
forAll(force_, i)
|
||||
{
|
||||
force_[i].setSize(1);
|
||||
moment_[i].setSize(1);
|
||||
force_[i].setSize(1, vector::zero);
|
||||
moment_[i].setSize(1, vector::zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user