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()
88 ? - gHat & (locations_[li] -
set.pointCoord(0))
90 reduce(hLB, maxOp<scalar>());
95 scalar sumLength = 0, sumLengthAlpha = 0;
96 for(
label si = 0; si <
set.size() - 1; ++ si)
98 if (
set.segments()[si] !=
set.segments()[si+1])
103 const vector& p0 =
set.pointCoord(si), p1 =
set.pointCoord(si+1);
104 const label c0 =
set.cells()[si],
c1 =
set.cells()[si+1];
105 const label f0 =
set.faces()[si],
f1 =
set.faces()[si+1];
106 const scalar a0 = interpolator->interpolate(p0, c0, f0);
107 const scalar a1 = interpolator->interpolate(p1,
c1,
f1);
109 const scalar l = - gHat & (p1 - p0);
111 sumLengthAlpha += l*(a0 + a1)/2;
114 reduce(sumLength, sumOp<scalar>());
115 reduce(sumLengthAlpha, sumOp<scalar>());
122 liquid_ ? sumLengthAlpha : sumLength - sumLengthAlpha;
123 const scalar hIL = hIB - hLB;
126 const point p = locations_[li] - gHat*hIL;
130 file(fileID::heightFile) << w << hIB << w << hIL;
131 file(fileID::positionFile) <<
'(' << w << p.x() << w << p.y()
132 << valueWidth() << p.z() <<
") ";
138 file(fileID::heightFile).endl();
139 file(fileID::positionFile).endl();
160 case fileID::heightFile:
165 "Interface height above the boundary" 171 "Interface height above the location" 174 case fileID::positionFile:
175 writeHeaderValue(
file(i),
"p",
"Interface position");
181 writeCommented(
file(i),
"Location");
186 case fileID::heightFile:
187 file(i) << w << li << w <<
' ';
189 case fileID::positionFile:
190 file(i) << w << li << w <<
' ' << w <<
' ' <<
" ";
196 writeCommented(
file(i),
"Time");
201 case fileID::heightFile:
202 file(i) << w <<
"hB" << w <<
"hL";
204 case fileID::positionFile:
205 file(i) << w <<
"p" << w <<
' ' << w <<
' ' <<
" ";
227 interpolationScheme_(
"cellPoint")
247 dict.
lookup(
"locations") >> locations_;
248 dict.
readIfPresent(
"interpolationScheme", interpolationScheme_);
250 resetNames({
"height",
"position"});
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write function.
FvWallInfoData< WallInfo, label > 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)
List< word > wordList
A List of words.
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...
virtual wordList fields() const
Return the list of fields required.
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...