Go to the documentation of this file.
52 { forceMethodType::FROUDE,
"Froude" },
53 { forceMethodType::VARIABLE_SCALING,
"variableScaling" },
63 { monitorMethodType::POINTS,
"points" },
64 { monitorMethodType::CELLSET,
"cellSet" },
73 writeFile::writeCommented(os,
"Time");
74 writeFile::writeCommented(os,
"Uref");
75 writeFile::writeCommented(os,
"Cp");
76 writeFile::writeCommented(os,
"Ct");
80 writeFile::writeCommented(os,
"a");
81 writeFile::writeCommented(os,
"T");
83 else if (
forceMethod_ == forceMethodType::VARIABLE_SCALING)
85 writeFile::writeCommented(os,
"Udisk");
86 writeFile::writeCommented(os,
"CpStar");
87 writeFile::writeCommented(os,
"CtStar");
88 writeFile::writeCommented(os,
"T");
89 writeFile::writeCommented(os,
"P");
98 void Foam::fv::actuationDiskSource::setMonitorCells(
const dictionary&
dict)
100 switch (monitorMethod_)
102 case monitorMethodType::POINTS:
104 Info<<
" - selecting cells using points" <<
endl;
118 dict.readEntry(
"upstreamPoint", monitorPoints.first());
121 for (
const auto& monitorPoint : monitorPoints)
123 const label celli = mesh_.findCell(monitorPoint);
126 selectedCells.
insert(celli);
129 const label globalCelli =
returnReduce(celli, maxOp<label>());
133 <<
"Unable to find owner cell for point "
134 << monitorPoint <<
endl;
138 monitorCells_ = selectedCells.
sortedToc();
141 case monitorMethodType::CELLSET:
143 Info<<
" - selecting cells using cellSet "
144 << cellSetName_ <<
endl;
146 monitorCells_ = cellSet(mesh_, cellSetName_).sortedToc();
152 <<
"Unknown type for monitoring of incoming velocity"
153 << monitorMethodTypeNames[monitorMethod_]
154 <<
". Valid monitor method types : "
155 << monitorMethodTypeNames
167 const word& modelType,
173 writeFile(
mesh,
name, modelType, coeffs_),
176 forceMethodTypeNames.getOrDefault
180 forceMethodType::FROUDE
185 monitorMethodTypeNames.getOrDefault
189 monitorMethodType::POINTS
194 coeffs_.getOrDefault<
bool>(
"sink",
true)
198 writeFileStart_(coeffs_.getOrDefault<scalar>(
"writeFileStart", 0)),
199 writeFileEnd_(coeffs_.getOrDefault<scalar>(
"writeFileEnd", VGREAT)),
202 coeffs_.getCheck<scalar>
213 [&](
const vector& vec){ return mag(vec) > VSMALL; }
220 setMonitorCells(coeffs_);
222 fieldNames_.setSize(1,
"U");
224 applied_.setSize(fieldNames_.size(),
false);
226 Info<<
" - creating actuation disk zone: " << this->
name() <<
endl;
228 Info<<
" - force computation method: "
229 << forceMethodTypeNames[forceMethod_] <<
endl;
231 writeFileHeader(file());
283 dict.readIfPresent(
"sink", sink_);
284 dict.readIfPresent(
"writeFileStart", writeFileStart_);
285 dict.readIfPresent(
"writeFileEnd", writeFileEnd_);
286 dict.readIfPresent(
"diskArea", diskArea_);
287 if (diskArea_ < VSMALL)
290 <<
"Actuator disk has zero area: "
291 <<
"diskArea = " << diskArea_
295 dict.readIfPresent(
"diskDir", diskDir_);
296 diskDir_.normalise();
297 if (
mag(diskDir_) < VSMALL)
300 <<
"Actuator disk surface-normal vector is zero: "
301 <<
"diskDir = " << diskDir_
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
monitorMethodType
Options for the incoming velocity monitoring method types.
A class for handling words, derived from Foam::string.
Cell-set options abstract base class. Provides a base set of controls, e.g.:
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
static void writeHeader(Ostream &os, const word &fieldName)
Vector< Cmpt > & normalise()
Normalise the vector by its magnitude.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
actuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual bool read(const dictionary &dict)
Read source dictionary.
enum forceMethodType forceMethod_
The type of the force computation method.
void resize(const label newSize)
Adjust allocated size of list.
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.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
Mesh data needed to do the Finite Volume discretisation.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void writeFileHeader(Ostream &os)
Output file header information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
virtual bool read(const dictionary &dict)
Read dictionary.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
forceMethodType
Options for the force computation method types.
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
#define WarningInFunction
Report a warning using Foam::Warning.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const