Renamed pressureGradientExplicitSource to meanVelocityForce

as it is the applied the force necessary to maintain the specified mean velocity
This commit is contained in:
Henry Weller 2015-06-30 19:13:16 +01:00
parent 1f7b3883ff
commit 256be2641f
5 changed files with 39 additions and 30 deletions

View File

@ -20,8 +20,8 @@ derivedSources=sources/derived
$(derivedSources)/actuationDiskSource/actuationDiskSource.C
$(derivedSources)/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C
$(derivedSources)/explicitPorositySource/explicitPorositySource.C
$(derivedSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C
$(derivedSources)/pressureGradientExplicitSource/pressureGradientExplicitSourceIO.C
$(derivedSources)/meanVelocityForce/meanVelocityForce.C
$(derivedSources)/meanVelocityForce/meanVelocityForceIO.C
$(derivedSources)/radialActuationDiskSource/radialActuationDiskSource.C
$(derivedSources)/rotorDiskSource/rotorDiskSource.C
$(derivedSources)/rotorDiskSource/bladeModel/bladeModel.C

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "pressureGradientExplicitSource.H"
#include "meanVelocityForce.H"
#include "fvMatrices.H"
#include "DimensionedField.H"
#include "IFstream.H"
@ -35,12 +35,12 @@ namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(pressureGradientExplicitSource, 0);
defineTypeNameAndDebug(meanVelocityForce, 0);
addToRunTimeSelectionTable
(
option,
pressureGradientExplicitSource,
meanVelocityForce,
dictionary
);
}
@ -49,7 +49,7 @@ namespace fv
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::fv::pressureGradientExplicitSource::writeProps
void Foam::fv::meanVelocityForce::writeProps
(
const scalar gradP
) const
@ -77,7 +77,7 @@ void Foam::fv::pressureGradientExplicitSource::writeProps
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
Foam::fv::meanVelocityForce::meanVelocityForce
(
const word& sourceName,
const word& modelType,
@ -90,6 +90,7 @@ Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
gradP0_(0.0),
dGradP_(0.0),
flowDir_(Ubar_/mag(Ubar_)),
relaxation_(coeffs_.lookupOrDefault<scalar>("relaxation", 1.0)),
invAPtr_(NULL)
{
coeffs_.lookup("fieldNames") >> fieldNames_;
@ -98,8 +99,8 @@ Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
{
FatalErrorIn
(
"Foam::fv::pressureGradientExplicitSource::"
"pressureGradientExplicitSource"
"Foam::fv::meanVelocityForce::"
"meanVelocityForce"
"("
"const word&, "
"const word&, "
@ -131,7 +132,7 @@ Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::pressureGradientExplicitSource::correct(volVectorField& U)
void Foam::fv::meanVelocityForce::correct(volVectorField& U)
{
const scalarField& rAU = invAPtr_().internalField();
@ -155,9 +156,13 @@ void Foam::fv::pressureGradientExplicitSource::correct(volVectorField& U)
magUbarAve /= V_;
rAUave /= V_;
// magUbarAve =
// gSum((flowDir_ & U.boundaryField()[0])*mesh_.boundary()[0].magSf())
// /gSum(mesh_.boundary()[0].magSf());
// Calculate the pressure gradient increment needed to adjust the average
// flow-rate to the desired value
dGradP_ = (mag(Ubar_) - magUbarAve)/rAUave;
dGradP_ = relaxation_*(mag(Ubar_) - magUbarAve)/rAUave;
// Apply correction to velocity field
forAll(cells_, i)
@ -175,7 +180,7 @@ void Foam::fv::pressureGradientExplicitSource::correct(volVectorField& U)
}
void Foam::fv::pressureGradientExplicitSource::addSup
void Foam::fv::meanVelocityForce::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -203,7 +208,7 @@ void Foam::fv::pressureGradientExplicitSource::addSup
}
void Foam::fv::pressureGradientExplicitSource::addSup
void Foam::fv::meanVelocityForce::addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
@ -214,7 +219,7 @@ void Foam::fv::pressureGradientExplicitSource::addSup
}
void Foam::fv::pressureGradientExplicitSource::constrain
void Foam::fv::meanVelocityForce::constrain
(
fvMatrix<vector>& eqn,
const label

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::pressureGradientExplicitSource
Foam::fv::meanVelocityForce
Description
Creates a pressure gradient source
@ -32,23 +32,24 @@ Description
\heading Source usage
Example usage:
\verbatim
pressureGradientExplicitSourceCoeffs
meanVelocityForceCoeffs
{
fieldNames (U); // name of velocity field
Ubar (10.0 0 0); // desired average velocity
gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient
flowDir (1 0 0); // flow direction
relaxation 0.2; // Optional relaxation factor
}
\endverbatim
SourceFiles
pressureGradientExplicitSource.C
meanVelocityForce.C
\*---------------------------------------------------------------------------*/
#ifndef pressureGradientExplicitSource_H
#define pressureGradientExplicitSource_H
#ifndef meanVelocityForce_H
#define meanVelocityForce_H
#include "autoPtr.H"
#include "topoSetSource.H"
@ -65,10 +66,10 @@ namespace fv
{
/*---------------------------------------------------------------------------*\
Class pressureGradientExplicitSource Declaration
Class meanVelocityForce Declaration
\*---------------------------------------------------------------------------*/
class pressureGradientExplicitSource
class meanVelocityForce
:
public cellSetOption
{
@ -86,6 +87,9 @@ class pressureGradientExplicitSource
//- Flow direction
vector flowDir_;
//- Relaxation factor
scalar relaxation_;
//- Matrix 1/A coefficients field pointer
autoPtr<volScalarField> invAPtr_;
@ -99,22 +103,22 @@ class pressureGradientExplicitSource
void update(fvMatrix<vector>& eqn);
//- Disallow default bitwise copy construct
pressureGradientExplicitSource(const pressureGradientExplicitSource&);
meanVelocityForce(const meanVelocityForce&);
//- Disallow default bitwise assignment
void operator=(const pressureGradientExplicitSource&);
void operator=(const meanVelocityForce&);
public:
//- Runtime type information
TypeName("pressureGradientExplicitSource");
TypeName("meanVelocityForce");
// Constructors
//- Construct from explicit source name and mesh
pressureGradientExplicitSource
meanVelocityForce
(
const word& sourceName,
const word& modelType,

View File

@ -23,15 +23,15 @@ License
\*---------------------------------------------------------------------------*/
#include "pressureGradientExplicitSource.H"
#include "meanVelocityForce.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::fv::pressureGradientExplicitSource::read(const dictionary& dict)
bool Foam::fv::meanVelocityForce::read(const dictionary& dict)
{
notImplemented
(
"bool Foam::fv::pressureGradientExplicitSource::read"
"bool Foam::fv::meanVelocityForce::read"
"("
"const dictionary&"
") const"

View File

@ -17,10 +17,10 @@ FoamFile
momentumSource
{
type pressureGradientExplicitSource;
type meanVelocityForce;
active yes;
pressureGradientExplicitSourceCoeffs
meanVelocityForceCoeffs
{
selectionMode all;