53 { forceMethodType::FROUDE,
"Froude" },
54 { forceMethodType::VARIABLE_SCALING,
"variableScaling" },
64 { monitorMethodType::POINTS,
"points" },
65 { monitorMethodType::CELLSET,
"cellSet" },
74 writeFile::writeCommented(
os,
"Time");
75 writeFile::writeCommented(
os,
"Uref");
76 writeFile::writeCommented(
os,
"Cp");
77 writeFile::writeCommented(
os,
"Ct");
81 writeFile::writeCommented(
os,
"a");
82 writeFile::writeCommented(
os,
"T");
84 else if (
forceMethod_ == forceMethodType::VARIABLE_SCALING)
86 writeFile::writeCommented(
os,
"Udisk");
87 writeFile::writeCommented(
os,
"CpStar");
88 writeFile::writeCommented(
os,
"CtStar");
89 writeFile::writeCommented(
os,
"T");
90 writeFile::writeCommented(
os,
"P");
99 void Foam::fv::actuationDiskSource::setMonitorCells(
const dictionary&
dict)
101 switch (monitorMethod_)
103 case monitorMethodType::POINTS:
105 Info<<
" - selecting cells using points" <<
endl;
109 List<point> monitorPoints;
111 const dictionary* coeffsDictPtr =
dict.findDict(
"monitorCoeffs");
114 coeffsDictPtr->readIfPresent(
"points", monitorPoints);
118 monitorPoints.resize(1);
119 dict.readEntry(
"upstreamPoint", monitorPoints.first());
122 for (
const point&
p : monitorPoints)
124 const label celli = mesh_.findCell(
p);
126 const bool found = (celli >= 0);
130 selectedCells.insert(celli);
136 <<
"No owner cell found for point " 141 monitorCells_ = selectedCells.sortedToc();
144 case monitorMethodType::CELLSET:
146 Info<<
" - selecting cells using cellSet " 147 << zoneName() <<
endl;
149 monitorCells_ = cellSet(mesh_, zoneName()).sortedToc();
155 <<
"Unknown type for monitoring of incoming velocity" 156 << monitorMethodTypeNames[monitorMethod_]
157 <<
". Valid monitor method types : " 158 << monitorMethodTypeNames
170 const word& modelType,
176 writeFile(
mesh,
name, modelType, coeffs_),
179 forceMethodTypeNames.getOrDefault
183 forceMethodType::FROUDE
188 monitorMethodTypeNames.getOrDefault
192 monitorMethodType::POINTS
197 coeffs_.getOrDefault<bool>(
"sink", true)
201 writeFileStart_(coeffs_.getOrDefault<scalar>(
"writeFileStart", 0)),
202 writeFileEnd_(coeffs_.getOrDefault<scalar>(
"writeFileEnd", VGREAT)),
205 coeffs_.getCheck<scalar>
216 [&](const
vector& vec){
return mag(vec) > VSMALL; }
219 UvsCpPtr_(Function1<scalar>::New(
"Cp", coeffs_, &
mesh)),
220 UvsCtPtr_(Function1<scalar>::New(
"Ct", coeffs_, &
mesh)),
223 setMonitorCells(coeffs_);
225 fieldNames_.resize(1,
"U");
229 Info<<
" - creating actuation disk zone: " << this->
name() <<
endl;
231 Info<<
" - force computation method: " 232 << forceMethodTypeNames[forceMethod_] <<
endl;
234 writeFileHeader(file());
286 dict.readIfPresent(
"sink", sink_);
287 dict.readIfPresent(
"writeFileStart", writeFileStart_);
288 dict.readIfPresent(
"writeFileEnd", writeFileEnd_);
289 dict.readIfPresent(
"diskArea", diskArea_);
290 if (diskArea_ < VSMALL)
293 <<
"Actuator disk has zero area: " 294 <<
"diskArea = " << diskArea_
298 dict.readIfPresent(
"diskDir", diskDir_);
299 diskDir_.normalise();
300 if (
mag(diskDir_) < VSMALL)
303 <<
"Actuator disk surface-normal vector is zero: " 304 <<
"diskDir = " << diskDir_
static void writeHeader(Ostream &os, const word &fieldName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
forceMethodType
Options for the force computation method types.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
virtual void writeFileHeader(Ostream &os)
Output file header information.
virtual bool read(const dictionary &dict)
Read source dictionary.
Macros for easy insertion into run-time selection tables.
enum forceMethodType forceMethod_
The type of the force computation method.
actuationDiskSource()=delete
No default construct.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
virtual bool read(const dictionary &dict)
Read dictionary.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Mesh data needed to do the Finite Volume discretisation.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
messageStream Info
Information stream (stdout output on master, null elsewhere)
monitorMethodType
Options for the incoming velocity monitoring method types.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...