Skip to content
Snippets Groups Projects
Commit 82ccea2a authored by Henry Weller's avatar Henry Weller
Browse files

meanVelocityForce: Updated and corrected documentation

parent 256be264
Branches
Tags
No related merge requests found
...@@ -91,7 +91,7 @@ Foam::fv::meanVelocityForce::meanVelocityForce ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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,20 +25,19 @@ Class ...@@ -25,20 +25,19 @@ 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 relaxation 0.2; // Optional relaxation factor
flowDir (1 0 0); // flow direction
relaxation 0.2; // Optional relaxation factor
} }
\endverbatim \endverbatim
...@@ -91,7 +90,7 @@ class meanVelocityForce ...@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment