53 void Foam::fv::meanVelocityForce::readCoeffs()
55 UName_ = coeffs().lookupOrDefault<word>(
"U",
"U");
56 Ubar_ = coeffs().lookup<
vector>(
"Ubar");
57 relaxation_ = coeffs().lookupOrDefault<scalar>(
"relaxation", 1);
61 void Foam::fv::meanVelocityForce::writeProps
67 if (
mesh().time().writeTime())
73 name() +
"Properties",
92 const word& modelType,
113 if (propsFile.
good())
115 Info<<
" Reading pressure gradient from file" <<
endl;
117 propsDict.
lookup(
"gradient") >> gradP0_;
120 Info<<
" Initial pressure gradient = " << gradP0_ <<
nl <<
endl;
132 Foam::scalar Foam::fv::meanVelocityForce::magUbarAve
140 scalar magUbarAve = 0;
143 const label celli = cells[i];
144 magUbarAve += (
normalised(Ubar_) & U[celli])*cv[celli];
147 magUbarAve /= set_.V();
156 const word& fieldName
163 name() + fieldName +
"Sup",
173 const scalar gradP = gradP0_ + dGradP_;
200 rAPtr_() = 1/eqn.
A();
221 const label celli = cells[i];
222 rAUave += rAU[celli]*cv[celli];
227 const scalar magUbarAve = this->magUbarAve(U);
231 dGradP_ = relaxation_*(
mag(Ubar_) - magUbarAve)/rAUave;
236 label celli = cells[i];
237 U[celli] +=
normalised(Ubar_)*rAU[celli]*dGradP_;
240 const scalar gradP = gradP0_ + dGradP_;
242 Info<<
"Pressure gradient source: uncorrected Ubar = " << magUbarAve
243 <<
", pressure gradient = " << gradP <<
endl;
260 set_.topoChange(map);
272 set_.distribute(map);
IOdictionary propsDict(systemDict("particleTracksDict", args, runTime))
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
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.
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)
virtual bool movePoints()
Update for mesh motion.
A class for handling words, derived from string.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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 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 void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool read(const dictionary &dict)
Read source dictionary.
Class containing mesh-to-mesh mapping information.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
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