mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added pressure reference
This commit is contained in:
@ -190,6 +190,7 @@ Foam::forces::forces
|
||||
directForceDensity_(false),
|
||||
fDName_(""),
|
||||
rhoRef_(VGREAT),
|
||||
pRef_(0),
|
||||
CofR_(vector::zero),
|
||||
forcesFilePtr_(NULL)
|
||||
{
|
||||
@ -282,13 +283,15 @@ void Foam::forces::read(const dictionary& dict)
|
||||
Info<< " or " << rhoName_;
|
||||
}
|
||||
|
||||
Info<< " in database." << nl
|
||||
<< " De-activating forces."
|
||||
Info<< " in database." << nl << " De-activating forces."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Reference density needed for incompressible calculations
|
||||
rhoRef_ = readScalar(dict.lookup("rhoInf"));
|
||||
|
||||
// Reference pressure, 0 by default
|
||||
pRef_ = dict.lookupOrDefault<scalar>("pRef", 0.0);
|
||||
}
|
||||
|
||||
// Centre of rotation for moment calculations
|
||||
@ -443,13 +446,16 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const
|
||||
const volSymmTensorField::GeometricBoundaryField& devRhoReffb
|
||||
= tdevRhoReff().boundaryField();
|
||||
|
||||
// Scale pRef by density for incompressible simulations
|
||||
scalar pRef = pRef_/rho(p);
|
||||
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
|
||||
vectorField Md = mesh.C().boundaryField()[patchi] - CofR_;
|
||||
|
||||
vectorField pf = Sfb[patchi]*p.boundaryField()[patchi];
|
||||
vectorField pf = Sfb[patchi]*(p.boundaryField()[patchi] - pRef);
|
||||
|
||||
fm.first().first() += rho(p)*sum(pf);
|
||||
fm.second().first() += rho(p)*sum(Md ^ pf);
|
||||
|
||||
@ -144,6 +144,9 @@ protected:
|
||||
//- Reference density needed for incompressible calculations
|
||||
scalar rhoRef_;
|
||||
|
||||
//- Reference pressure
|
||||
scalar pRef_;
|
||||
|
||||
//- Centre of rotation
|
||||
vector CofR_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user