52 void Foam::fv::meanVelocityForce::readCoeffs()
54 UName_ = coeffs().lookupOrDefault<word>(
"U",
"U");
55 Ubar_ = coeffs().lookup<
vector>(
"Ubar");
56 relaxation_ = coeffs().lookupOrDefault<scalar>(
"relaxation", 1);
60 void Foam::fv::meanVelocityForce::writeProps
66 if (
mesh().time().writeTime())
72 name() +
"Properties",
91 const word& modelType,
112 if (propsFile.
good())
114 Info<<
" Reading pressure gradient from file" <<
endl;
116 propsDict.
lookup(
"gradient") >> gradP0_;
119 Info<<
" Initial pressure gradient = " << gradP0_ <<
nl <<
endl;
131 Foam::scalar Foam::fv::meanVelocityForce::magUbarAve
139 scalar magUbarAve = 0;
142 const label celli = cells[i];
143 magUbarAve += (
normalised(Ubar_) & U[celli])*cv[celli];
146 magUbarAve /= set_.V();
155 const word& fieldName
162 name() + fieldName +
"Sup",
172 const scalar gradP = gradP0_ + dGradP_;
199 rAPtr_() = 1/eqn.
A();
220 const label celli = cells[i];
221 rAUave += rAU[celli]*cv[celli];
226 const scalar magUbarAve = this->magUbarAve(U);
230 dGradP_ = relaxation_*(
mag(Ubar_) - magUbarAve)/rAUave;
235 label celli = cells[i];
236 U[celli] +=
normalised(Ubar_)*rAU[celli]*dGradP_;
239 const scalar gradP = gradP0_ + dGradP_;
241 Info<<
"Pressure gradient source: uncorrected Ubar = " << magUbarAve
242 <<
", pressure gradient = " << gradP <<
endl;
252 set_.updateMesh(mpm);
IOdictionary propsDict(systemDict("particleTracksDict", args, runTime))
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
fileName timePath() const
Return current time path.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual bool constrain(fvMatrix< vector > &eqn, const word &fieldName) const
Add the momentum source and set the 1/A coefficient.
dimensionedVector gradP("gradP", dimensionSet(0, 1, -2, 0, 0), Zero)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
const Time & time() const
Return the top-level database.
bool good() const
Return true if next operation might succeed.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
meanVelocityForce(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
A class for handling words, derived from string.
static const dictionary null
Null dictionary.
static const word null
An empty word.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
tmp< volScalarField > A() const
Return the central coefficient.
tmp< volScalarField > rAU
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const dimensionSet dimVolume
static Vector< scalar > uniform(const scalar &s)
Return a VectorSpace with all elements = s.
dimensioned< scalar > mag(const dimensioned< Type > &)
const tmp< volScalarField::Internal > & Su
virtual bool read(const dictionary &dict)
Read source dictionary.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Finite volume options abstract base class.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dimensionSet & dimensions() const