mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects/forces: The 'rhoInf' entry is now only required if 'rho' is set to 'rhoInf'
This commit is contained in:
@ -180,23 +180,23 @@ void Foam::functionObjects::forces::initialise()
|
|||||||
(
|
(
|
||||||
!obr_.foundObject<volVectorField>(UName_)
|
!obr_.foundObject<volVectorField>(UName_)
|
||||||
|| !obr_.foundObject<volScalarField>(pName_)
|
|| !obr_.foundObject<volScalarField>(pName_)
|
||||||
|| (
|
|
||||||
rhoName_ != "rhoInf"
|
|
||||||
&& !obr_.foundObject<volScalarField>(rhoName_)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Could not find " << UName_ << ", " << pName_
|
<< "Could not find " << UName_ << ", " << pName_
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
if (rhoName_ != "rhoInf")
|
if
|
||||||
{
|
(
|
||||||
Info<< " or " << rhoName_;
|
rhoName_ != "rhoInf"
|
||||||
}
|
&& !obr_.foundObject<volScalarField>(rhoName_)
|
||||||
|
)
|
||||||
Info<< " in database." << nl
|
{
|
||||||
<< " De-activating forces." << endl;
|
FatalErrorInFunction
|
||||||
|
<< "Could not find " << rhoName_
|
||||||
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,7 +633,10 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||||
|
|
||||||
// Reference density needed for incompressible calculations
|
// Reference density needed for incompressible calculations
|
||||||
rhoRef_ = readScalar(dict.lookup("rhoInf"));
|
if (rhoName_ == "rhoInf")
|
||||||
|
{
|
||||||
|
rhoRef_ = readScalar(dict.lookup("rhoInf"));
|
||||||
|
}
|
||||||
|
|
||||||
// Reference pressure, 0 by default
|
// Reference pressure, 0 by default
|
||||||
pRef_ = dict.lookupOrDefault<scalar>("pRef", 0.0);
|
pRef_ = dict.lookupOrDefault<scalar>("pRef", 0.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user