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;
108 List<point> monitorPoints;
110 const dictionary* coeffsDictPtr =
dict.findDict(
"monitorCoeffs");
113 coeffsDictPtr->readIfPresent(
"points", monitorPoints);
117 monitorPoints.resize(1);
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; }
216 UvsCpPtr_(Function1<scalar>::New(
"Cp", coeffs_, &
mesh)),
217 UvsCtPtr_(Function1<scalar>::New(
"Ct", coeffs_, &
mesh)),
220 setMonitorCells(coeffs_);
222 fieldNames_.resize(1,
"U");
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...
A class for handling words, derived from Foam::string.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void resize(const label len)
const dimensionedScalar alpha
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Ostream & endl(Ostream &os)
static const Enum< monitorMethodType > monitorMethodTypeNames
static void writeHeader(Ostream &os, const word &fieldName)
Vector< Cmpt > & normalise()
A HashTable with keys but without contents that is similar to std::unordered_set.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
actuationDiskSource()=delete
virtual bool read(const dictionary &dict)
enum forceMethodType forceMethod_
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
static const Enum< forceMethodType > forceMethodTypeNames
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void writeFileHeader(Ostream &os)
#define FatalErrorInFunction
static MinMax< T > ge(const T &minVal)
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)
virtual bool read(const dictionary &dict)
A special matrix type and solver, designed for finite volume solutions of scalar equations....
word name(const expressions::valueTypeCode typeCode)
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalIOErrorInFunction(ios)
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
Generic GeometricField class.
#define WarningInFunction
A min/max value pair with additional methods. In addition to conveniently storing values,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const