Go to the documentation of this file.
44 namespace functionObjects
54 void Foam::functionObjects::interfaceHeight::writePositions()
60 if (
mag(direction_) > 0.0)
62 gHat = direction_/
mag(direction_);
66 gHat =
g.value()/
mag(
g.value());
72 autoPtr<interpolation<scalar>>
87 const midPointAndFaceSet
set
98 scalar hLB =
set.size() ? - gHat & (locations_[li] -
set[0]) : - GREAT;
99 reduce(hLB, maxOp<scalar>());
104 scalar sumLength = 0, sumLengthAlpha = 0;
105 for(label si = 0; si <
set.size() - 1; ++ si)
107 if (
set.segments()[si] !=
set.segments()[si+1])
113 const label c0 =
set.cells()[si],
c1 =
set.cells()[si+1];
114 const label f0 =
set.faces()[si], f1 =
set.faces()[si+1];
115 const scalar
a0 = interpolator->interpolate(
p0, c0, f0);
116 const scalar a1 = interpolator->interpolate(p1,
c1, f1);
118 const scalar l = - gHat & (p1 -
p0);
120 sumLengthAlpha += l*(
a0 + a1)/2;
123 reduce(sumLength, sumOp<scalar>());
124 reduce(sumLengthAlpha, sumOp<scalar>());
131 liquid_ ? sumLengthAlpha : sumLength - sumLengthAlpha;
132 const scalar hIL = hIB - hLB;
135 const point p = locations_[li] - gHat*hIL;
139 files(fileID::heightFile) << w << hIB << w << hIL;
140 files(fileID::positionFile) <<
'(' << w <<
p.x() << w <<
p.y()
147 files(fileID::heightFile).endl();
169 case fileID::heightFile:
175 "Interface height above the boundary"
181 "Interface height above the location"
185 case fileID::positionFile:
187 writeHeaderValue(files(fid),
"p",
"Interface position");
194 writeCommented(files(fid),
"Location");
199 case fileID::heightFile:
200 files(fid) << w << li << w <<
' ';
202 case fileID::positionFile:
203 files(fid) << w << li << w <<
' ' << w <<
' ' <<
" ";
209 writeCommented(files(fid),
"Time");
214 case fileID::heightFile:
215 files(fid) << w <<
"hB" << w <<
"hL";
217 case fileID::positionFile:
218 files(fid) << w <<
"p" << w <<
' ' << w <<
' ' <<
" ";
239 interpolationScheme_(
"cellPoint"),
252 dict.readIfPresent(
"alpha", alphaName_);
253 dict.readIfPresent(
"liquid", liquid_);
254 dict.readEntry(
"locations", locations_);
255 dict.readIfPresent(
"interpolationScheme", interpolationScheme_);
256 dict.readIfPresent(
"direction", direction_);
void set(List< bool > &bools, const labelRange &range)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
virtual bool read(const dictionary &)
const dimensionedScalar alpha
bool read(const char *buf, int32_t &val)
PtrList< OFstream > & files()
static word timeName(const scalar t, const int precision=precision_)
static bool master(const label communicator=worldComm)
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
const dimensionedScalar c1
static autoPtr< interpolation< Type > > New(const word &interpolationType, const GeometricField< Type, fvPatchField, volMesh > &psi)
Omanip< int > valueWidth(const label offset=0) const
UniformDimensionedField< vector > uniformDimensionedVectorField
Istream and Ostream manipulators taking arguments.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const Type & lookupObject(const word &name, const bool recursive=false) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
const uniformDimensionedVectorField & g
Vector< scalar > vector
A scalar version of the templated Vector.
functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged...
virtual void resetNames(const wordList &names)
const boundBox & bounds() const
const dimensionedScalar a0
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
defineTypeNameAndDebug(ObukhovLength, 0)
word name(const expressions::valueTypeCode typeCode)
const Time & time() const
const volScalarField & p0
vector point
Point is a vector.
interfaceHeight(const word &name, const Time &runTime, const dictionary &dict)
virtual void writeFileHeader(const fileID fid)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...