mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
meanVelocityForce: Updated and corrected documentation
This commit is contained in:
@ -91,7 +91,7 @@ Foam::fv::meanVelocityForce::meanVelocityForce
|
|||||||
dGradP_(0.0),
|
dGradP_(0.0),
|
||||||
flowDir_(Ubar_/mag(Ubar_)),
|
flowDir_(Ubar_/mag(Ubar_)),
|
||||||
relaxation_(coeffs_.lookupOrDefault<scalar>("relaxation", 1.0)),
|
relaxation_(coeffs_.lookupOrDefault<scalar>("relaxation", 1.0)),
|
||||||
invAPtr_(NULL)
|
rAPtr_(NULL)
|
||||||
{
|
{
|
||||||
coeffs_.lookup("fieldNames") >> fieldNames_;
|
coeffs_.lookup("fieldNames") >> fieldNames_;
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ Foam::fv::meanVelocityForce::meanVelocityForce
|
|||||||
|
|
||||||
void Foam::fv::meanVelocityForce::correct(volVectorField& U)
|
void Foam::fv::meanVelocityForce::correct(volVectorField& U)
|
||||||
{
|
{
|
||||||
const scalarField& rAU = invAPtr_().internalField();
|
const scalarField& rAU = rAPtr_().internalField();
|
||||||
|
|
||||||
// Integrate flow variables over cell set
|
// Integrate flow variables over cell set
|
||||||
scalar magUbarAve = 0.0;
|
scalar magUbarAve = 0.0;
|
||||||
@ -225,15 +225,15 @@ void Foam::fv::meanVelocityForce::constrain
|
|||||||
const label
|
const label
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (invAPtr_.empty())
|
if (rAPtr_.empty())
|
||||||
{
|
{
|
||||||
invAPtr_.reset
|
rAPtr_.reset
|
||||||
(
|
(
|
||||||
new volScalarField
|
new volScalarField
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
name_ + ":invA",
|
name_ + ":rA",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -245,7 +245,7 @@ void Foam::fv::meanVelocityForce::constrain
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
invAPtr_() = 1.0/eqn.A();
|
rAPtr_() = 1.0/eqn.A();
|
||||||
}
|
}
|
||||||
|
|
||||||
gradP0_ += dGradP_;
|
gradP0_ += dGradP_;
|
||||||
|
|||||||
@ -25,19 +25,18 @@ Class
|
|||||||
Foam::fv::meanVelocityForce
|
Foam::fv::meanVelocityForce
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Creates a pressure gradient source
|
Calculates and applies the force necessary to maintain the specified mean
|
||||||
|
velocity.
|
||||||
|
|
||||||
Note: Currently only handles kinematic pressure
|
Note: Currently only handles kinematic pressure (incompressible solvers).
|
||||||
|
|
||||||
\heading Source usage
|
\heading Source usage
|
||||||
Example usage:
|
Example usage:
|
||||||
\verbatim
|
\verbatim
|
||||||
meanVelocityForceCoeffs
|
meanVelocityForceCoeffs
|
||||||
{
|
{
|
||||||
fieldNames (U); // name of velocity field
|
fieldNames (U); // Name of velocity field
|
||||||
Ubar (10.0 0 0); // desired average velocity
|
Ubar (10.0 0 0); // Desired mean velocity
|
||||||
gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient
|
|
||||||
flowDir (1 0 0); // flow direction
|
|
||||||
relaxation 0.2; // Optional relaxation factor
|
relaxation 0.2; // Optional relaxation factor
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
@ -91,7 +90,7 @@ class meanVelocityForce
|
|||||||
scalar relaxation_;
|
scalar relaxation_;
|
||||||
|
|
||||||
//- Matrix 1/A coefficients field pointer
|
//- Matrix 1/A coefficients field pointer
|
||||||
autoPtr<volScalarField> invAPtr_;
|
autoPtr<volScalarField> rAPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user