53 { forceMethodType::FROUDE,
"Froude" },
54 { forceMethodType::VARIABLE_SCALING,
"variableScaling" },
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");
93 writeFile::writeCommented(
os,
"diskDir");
101void Foam::fv::actuationDiskSource::setMonitorCells(
const dictionary&
dict)
103 switch (monitorMethod_)
105 case monitorMethodType::POINTS:
107 Info<<
" - selecting cells using points" <<
endl;
111 List<point> monitorPoints;
116 coeffsDictPtr->readIfPresent(
"points", monitorPoints);
120 monitorPoints.resize(1);
121 dict.readEntry(
"upstreamPoint", monitorPoints.first());
124 for (
const point&
p : monitorPoints)
126 const label celli = mesh_.findCell(
p);
128 const bool found = (celli >= 0);
132 selectedCells.insert(celli);
138 <<
"No owner cell found for point "
143 monitorCells_ = selectedCells.
sortedToc();
146 case monitorMethodType::CELLSET:
148 Info<<
" - selecting cells using cellSet "
149 << zoneName() <<
endl;
151 monitorCells_ = cellSet(mesh_, zoneName()).sortedToc();
157 <<
"Unknown type for monitoring of incoming velocity"
158 << monitorMethodTypeNames[monitorMethod_]
159 <<
". Valid monitor method types : "
160 << monitorMethodTypeNames
172 const word& modelType,
178 writeFile(
mesh,
name, modelType, coeffs_),
181 forceMethodTypeNames.getOrDefault
185 forceMethodType::FROUDE
190 monitorMethodTypeNames.getOrDefault
194 monitorMethodType::POINTS
199 coeffs_.getOrDefault<bool>(
"sink", true)
203 writeFileStart_(coeffs_.getOrDefault<scalar>(
"writeFileStart", 0)),
204 writeFileEnd_(coeffs_.getOrDefault<scalar>(
"writeFileEnd", VGREAT)),
207 coeffs_.getCheck<scalar>
214 UvsCpPtr_(Function1<scalar>::
New(
"Cp", coeffs_, &
mesh)),
215 UvsCtPtr_(Function1<scalar>::
New(
"Ct", coeffs_, &
mesh)),
224 Info<<
" - creating actuation disk zone: " << this->
name() << endl;
226 Info<<
" - force computation method: "
237 const scalar t = mesh_.time().timeOutputValue();
238 const vector dir(diskDir_->value(t));
244 <<
"Actuator disk surface-normal vector is zero: " << dir
300 dict.readIfPresent(
"sink", sink_);
301 dict.readIfPresent(
"writeFileStart", writeFileStart_);
302 dict.readIfPresent(
"writeFileEnd", writeFileEnd_);
303 dict.readIfPresent(
"diskArea", diskArea_);
304 if (diskArea_ < VSMALL)
307 <<
"Actuator disk has zero area: "
308 <<
"diskArea = " << diskArea_
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,...
T & first()
Access first element of the list, position [0].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
wordList sortedToc() const
Return the sorted table of contents.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
virtual OFstream & file()
Return access to the file (if only 1).
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.
autoPtr< Function1< scalar > > UvsCtPtr_
Velocity vs thrust coefficients.
vector diskDir() const
Normal disk direction, evaluated at timeOutputValue.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
monitorMethodType
Options for the incoming velocity monitoring method types.
@ POINTS
"A set of points"
scalar writeFileEnd_
End time for file output.
virtual bool read(const dictionary &dict)
Read dictionary.
autoPtr< Function1< vector > > diskDir_
Surface-normal vector of the actuator disk pointing downstream as a function of time.
scalar writeFileStart_
Start time for file output.
enum monitorMethodType monitorMethod_
The type of incoming velocity monitoring method.
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"
labelList monitorCells_
Set of cells whereat the incoming velocity is monitored.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
virtual void writeFileHeader(Ostream &os)
Output file header information.
autoPtr< Function1< scalar > > UvsCpPtr_
Velocity vs power coefficients.
label sink_
Flag for body forces to act as a source (false) or a sink (true).
scalar diskArea_
Actuator disk planar surface area [m2].
scalar V() const noexcept
Return const access to the total cell volume.
virtual bool read(const dictionary &dict)
Read source dictionary.
cellSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Base abstract class for handling finite volume options (i.e. fvOption).
const word & name() const noexcept
Return const access to the source name.
const fvMesh & mesh_
Reference to the mesh database.
static autoPtr< option > New(const word &name, const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected fvOption model.
wordList fieldNames_
Field names to apply source to - populated by derived models.
dictionary coeffs_
Dictionary containing source coefficients.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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.
Namespace for finite-volume.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
MinMax< scalar > scalarMinMax
A scalar min/max range.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)