53 void Foam::fv::meanVelocityForce::readCoeffs(
const dictionary&
dict)
55 UName_ =
dict.lookupOrDefault<word>(
"U",
"U");
57 relaxation_ =
dict.lookupOrDefault<scalar>(
"relaxation", 1);
61 void Foam::fv::meanVelocityForce::writeProps
73 name() +
"Properties",
92 const word& modelType,
100 Ubar_(
vector::uniform(NaN)),
113 if (propsFile.
good())
120 Info<<
indent <<
"Initial pressure gradient = " << gradP0_ <<
endl;
132 Foam::scalar Foam::fv::meanVelocityForce::magUbarAve
140 scalar magUbarAve = 0;
144 magUbarAve += (
normalised(Ubar_) &
U[celli])*cv[celli];
147 magUbarAve /= zone_.V();
156 const word& fieldName
165 name() + fieldName +
"Sup",
175 const scalar
gradP = gradP0_ + dGradP_;
202 rAPtr_() = 1/eqn.
A();
224 rAUave +=
rAU[celli]*cv[celli];
229 const scalar magUbarAve = this->magUbarAve(
U);
233 dGradP_ = relaxation_*(
mag(Ubar_) - magUbarAve)/rAUave;
242 const scalar
gradP = gradP0_ + dGradP_;
245 <<
"Pressure gradient source: uncorrected Ubar = " << magUbarAve
246 <<
", pressure gradient = " <<
gradP <<
endl;
263 zone_.topoChange(map);
275 zone_.distribute(map);
283 zone_.read(coeffs(
dict));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool good() const
Return true if next operation might succeed.
fileName timePath() const
Return current time path.
A List with indirect addressing.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
static const dictionary null
Null dictionary.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const dictionary & coeffs(const dictionary &) const
Return the coefficients sub-dictionary.
const fvMesh & mesh() const
Return const access to the mesh database.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
tmp< volScalarField > A() const
Return the central coefficient.
const dimensionSet & dimensions() const
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, fvMesh > & V() const
Return cell volumes.
Calculates and applies the force necessary to maintain the specified mean velocity.
virtual bool movePoints()
Update for mesh motion.
virtual bool constrain(fvMatrix< vector > &eqn, const word &fieldName) const
Add the momentum source and set the 1/A coefficient.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
meanVelocityForce(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
volScalarField rAU(1.0/UEqn.A())
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimVolume
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionSet normalised(const dimensionSet &)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Ostream & indent(Ostream &os)
Indent stream.
dimensionedVector gradP("gradP", dimensionSet(0, 1, -2, 0, 0), Zero)
IOdictionary propsDict(systemDict("particleTracksDict", args, runTime))