53 { forceMethodType::FROUDE,
"Froude" },
54 { forceMethodType::VARIABLE_SCALING,
"variableScaling" },
64 { monitorMethodType::POINTS,
"points" },
65 { monitorMethodType::CELLSET,
"cellSet" },
73 writeFile::writeHeader(
os,
"Actuation disk source");
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");
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");
99void Foam::fv::actuationDiskSource::setMonitorCells(
const dictionary&
dict)
101 switch (monitorMethod_)
103 case monitorMethodType::POINTS:
105 Info<<
" - selecting cells using points" <<
endl;
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
188 monitorMethodTypeNames.getOrDefault
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; }
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_
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
T & first()
Return the first element of the list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Applies sources on velocity (i.e. U) within a specified region to enable actuator disk models for aer...
actuationDiskSource()=delete
No default construct.
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
monitorMethodType
Options for the incoming velocity monitoring method types.
enum forceMethodType forceMethod_
The type of the force computation method.
forceMethodType
Options for the force computation method types.
@ FROUDE
"Froude's ideal actuator disk method"
@ VARIABLE_SCALING
"Variable-scaling actuator disk method"
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
virtual void writeFileHeader(Ostream &os)
Output file header information.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Base abstract class for handling finite volume options (i.e. fvOption).
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector point
Point is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)