mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: forces FO - corrected after bugs introduced by last merging effort
This commit is contained in:
@ -180,7 +180,7 @@ void Foam::functionObjects::forces::initialise()
|
||||
if (!foundObject<volVectorField>(fDName_))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Could not find " << fDName_ << " in database."
|
||||
<< "Could not find " << fDName_ << " in database"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -194,14 +194,15 @@ void Foam::functionObjects::forces::initialise()
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Could not find " << UName_ << ", " << pName_
|
||||
<< "Could not find U: " << UName_ << " or p:" << pName_
|
||||
<< " in database"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (rhoName_ != "rhoInf" && !foundObject<volScalarField>(rhoName_))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Could not find " << rhoName_
|
||||
<< "Could not find rho:" << rhoName_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -269,6 +270,7 @@ void Foam::functionObjects::forces::initialiseBins()
|
||||
{
|
||||
binPoints_[i] = (i + 0.5)*binDir_*binDx_;
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate storage for forces and moments
|
||||
forAll(force_, i)
|
||||
@ -277,7 +279,6 @@ void Foam::functionObjects::forces::initialiseBins()
|
||||
moment_[i].setSize(nBin_, vector::zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::forces::resetFields()
|
||||
@ -908,9 +909,10 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
||||
}
|
||||
else if (nBin_ == 0)
|
||||
{
|
||||
// Case of no bins equates to a single bin to collect all data
|
||||
nBin_ = 1;
|
||||
}
|
||||
else if ((nBin_ == 0) || (nBin_ == 1))
|
||||
else
|
||||
{
|
||||
binDict.lookup("cumulative") >> binCumulative_;
|
||||
binDict.lookup("direction") >> binDir_;
|
||||
@ -918,16 +920,6 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
||||
}
|
||||
}
|
||||
|
||||
if (nBin_ == 1)
|
||||
{
|
||||
// Allocate storage for forces and moments
|
||||
forAll(force_, i)
|
||||
{
|
||||
force_[i].setSize(1, vector::zero);
|
||||
moment_[i].setSize(1, vector::zero);
|
||||
}
|
||||
}
|
||||
|
||||
writeFields_ = dict.lookupOrDefault("writeFields", false);
|
||||
|
||||
if (writeFields_)
|
||||
|
||||
Reference in New Issue
Block a user