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");
93 writeFile::writeCommented(
os,
"diskDir");
101 void 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>
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_
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual OFstream & file()
Return access to the file (if only 1)
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)
wordList fieldNames_
Field names to apply source to - populated by derived models.
void resize(const label len)
Adjust allocated size of list.
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.
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.
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 expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
vector diskDir() const
Normal disk direction, evaluated at timeOutputValue.
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.
const word & name() const noexcept
Return const access to the source name.
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.
dictionary coeffs_
Dictionary containing source coefficients.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...