Go to the documentation of this file.
58 if (mesh_.time().outputTime())
65 mesh_.time().timeName(),
82 const word& sourceName,
83 const word& modelType,
89 Ubar_(coeffs_.lookup(
"Ubar")),
92 flowDir_(Ubar_/
mag(Ubar_)),
93 relaxation_(coeffs_.lookupOrDefault<scalar>(
"relaxation", 1.0)),
96 coeffs_.lookup(
"fieldNames") >> fieldNames_;
98 if (fieldNames_.size() != 1)
104 applied_.setSize(fieldNames_.size(),
false);
109 mesh_.time().timePath()/
"uniform"/(name_ +
"Properties")
112 if (propsFile.
good())
114 Info<<
" Reading pressure gradient from file" <<
endl;
119 Info<<
" Initial pressure gradient = " << gradP0_ <<
nl <<
endl;
130 scalar magUbarAve = 0.0;
135 label cellI = cells_[i];
136 scalar volCell = cv[cellI];
137 magUbarAve += (flowDir_ &
U[cellI])*volCell;
158 scalar volCell = cv[cellI];
159 rAUave +=
rAU[cellI]*volCell;
183 Info<<
"Pressure gradient source: uncorrected Ubar = " <<
magUbarAve
184 <<
", pressure gradient = " <<
gradP <<
endl;
200 name_ + fieldNames_[fieldI] +
"Sup",
201 mesh_.time().timeName(),
210 scalar
gradP = gradP0_ + dGradP_;
225 this->addSup(eqn, fieldI);
244 mesh_.time().timeName(),
255 rAPtr_() = 1.0/eqn.
A();
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual void addSup(fvMatrix< vector > &eqn, const label fieldI)
Add explicit contribution to momentum equation.
A class for handling words, derived from string.
Cell-set options abtract base class. Provides a base set of controls, e.g.
#define forAll(list, i)
Loop across all elements in list.
scalar V_
Sum of cell volumes.
autoPtr< volScalarField > rAPtr_
Matrix 1/A coefficients field pointer.
const dimensionSet & dimensions() const
scalar relaxation_
Relaxation factor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeProps(const scalar gradP) const
Write the pressure gradient to file (for restarts etc)
dimensioned< scalar > mag(const dimensioned< Type > &)
const fvMesh & mesh_
Reference to the mesh database.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
vector flowDir_
Flow direction.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
vector Ubar_
Average velocity.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
scalar dGradP_
Change in pressure gradient.
labelList cells_
Set of cells to apply source to.
IOdictionary propsDict(IOobject("particleTrackProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED))
virtual void constrain(fvMatrix< vector > &eqn, const label fieldI)
Set 1/A coefficient.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
tmp< volScalarField > A() const
Return the central coefficient.
dimensionedVector gradP("gradP", dimensionSet(0, 1, -2, 0, 0), vector::zero)
meanVelocityForce(const meanVelocityForce &)
Disallow default bitwise copy construct.
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
volScalarField rAU("rAU", 1.0/UEqn().A())
defineTypeNameAndDebug(option, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
virtual scalar magUbarAve(const volVectorField &U) const
Calculate and return the magnitude of the mean velocity.
scalar gradP0_
Pressure gradient before correction.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
A List with indirect addressing.
bool good() const
Return true if next operation might succeed.
const dimensionSet dimVolume(pow3(dimLength))
Generic GeometricField class.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void correct(volVectorField &U)
Correct the pressure gradient.