41 namespace functionObjects
51 void Foam::functionObjects::interfaceHeight::writePositions()
55 const vector gHat = g.value()/
mag(g.value());
60 autoPtr<interpolation<scalar>>
68 writeTime(
file(fileID::heightFile));
69 writeTime(
file(fileID::positionFile));
75 const sampledSets::lineCellFace
set 81 locations_[li] + gHat*mesh_.bounds().mag(),
82 locations_[li] - gHat*mesh_.bounds().mag()
86 scalar hLB =
set.size() ? - gHat & (locations_[li] -
set[0]) : - vGreat;
87 reduce(hLB, maxOp<scalar>());
92 scalar sumLength = 0, sumLengthAlpha = 0;
93 for(
label si = 0; si <
set.size() - 1; ++ si)
95 if (
set.segments()[si] !=
set.segments()[si+1])
100 const vector& p0 =
set[si], p1 =
set[si+1];
101 const label c0 =
set.cells()[si],
c1 =
set.cells()[si+1];
102 const label f0 =
set.faces()[si],
f1 =
set.faces()[si+1];
103 const scalar a0 = interpolator->interpolate(p0, c0, f0);
104 const scalar a1 = interpolator->interpolate(p1,
c1,
f1);
106 const scalar l = - gHat & (p1 - p0);
108 sumLengthAlpha += l*(a0 + a1)/2;
111 reduce(sumLength, sumOp<scalar>());
112 reduce(sumLengthAlpha, sumOp<scalar>());
119 liquid_ ? sumLengthAlpha : sumLength - sumLengthAlpha;
120 const scalar hIL = hIB - hLB;
123 const point p = locations_[li] - gHat*hIL;
127 file(fileID::heightFile) << w << hIB << w << hIL;
128 file(fileID::positionFile) <<
'(' << w << p.x() << w << p.y()
129 << valueWidth() << p.z() <<
") ";
135 file(fileID::heightFile).endl();
136 file(fileID::positionFile).endl();
157 case fileID::heightFile:
162 "Interface height above the boundary" 168 "Interface height above the location" 171 case fileID::positionFile:
172 writeHeaderValue(
file(i),
"p",
"Interface position");
178 writeCommented(
file(i),
"Location");
183 case fileID::heightFile:
184 file(i) << w << li << w <<
' ';
186 case fileID::positionFile:
187 file(i) << w << li << w <<
' ' << w <<
' ' <<
" ";
193 writeCommented(
file(i),
"Time");
198 case fileID::heightFile:
199 file(i) << w <<
"hB" << w <<
"hL";
201 case fileID::positionFile:
202 file(i) << w <<
"p" << w <<
' ' << w <<
' ' <<
" ";
224 interpolationScheme_(
"cellPoint")
244 dict.
lookup(
"locations") >> locations_;
245 dict.
readIfPresent(
"interpolationScheme", interpolationScheme_);
247 resetNames({
"height",
"position"});
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write function.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
UniformDimensionedField< vector > uniformDimensionedVectorField
A list of keyword definitions, which are a keyword followed by any number of values (e...
static autoPtr< interpolation< scalar > > New(const word &interpolationType, const GeometricField< scalar, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static bool master(const label communicator=0)
Am I the master process.
Vector< scalar > vector
A scalar version of the templated Vector.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar c1
First radiation constant: default SI units: [W/m^2].
virtual ~interfaceHeight()
Destructor.
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
virtual void writeFileHeader(const label i=0)
Output file header information.
A class for handling words, derived from string.
virtual bool write()
Write.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
virtual bool execute()
Execute.
interfaceHeight(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Istream and Ostream manipulators taking arguments.
virtual bool end()
Execute at the final time-loop.
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.
defineTypeNameAndDebug(Qdot, 0)
vector point
Point is a vector.
virtual bool read(const dictionary &)
Read.
dimensioned< scalar > mag(const dimensioned< Type > &)
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...