55 void Foam::fv::actuationDisk::readCoeffs(
const dictionary&
dict)
60 dict.lookupOrDefault<word>
70 <<
"disk direction vector is approximately zero"
74 Cp_ =
dict.lookup<scalar>(
"Cp");
75 Ct_ =
dict.lookup<scalar>(
"Ct");
76 if (
Cp_ <= vSmall ||
Ct_ <= vSmall)
79 <<
"Cp and Ct must be greater than zero"
87 <<
"diskArea is approximately zero"
102 template<
class AlphaFieldType,
class RhoFieldType>
103 void Foam::fv::actuationDisk::addActuationDiskAxialInertialResistance
108 const AlphaFieldType&
alpha,
109 const RhoFieldType&
rho,
113 const scalar a = 1 - Cp_/Ct_;
114 const vector dHat(diskDir_/
mag(diskDir_));
116 scalar dHatUo(vGreat);
117 if (upstreamCellId_ != -1)
119 dHatUo = dHat &
U[upstreamCellId_];
121 reduce(dHatUo, minOp<scalar>());
123 const vector T = 2*diskArea_*
sqr(dHatUo)*a*(1 - a)*dHat;
138 const word& modelType,
145 phaseName_(
word::null),
147 diskDir_(
vector::uniform(NaN)),
151 upstreamPoint_(
vector::uniform(NaN)),
172 addActuationDiskAxialInertialResistance
191 addActuationDiskAxialInertialResistance
211 addActuationDiskAxialInertialResistance
232 zone_.topoChange(map);
244 zone_.distribute(map);
252 zone_.read(coeffs(
dict));
253 readCoeffs(coeffs(
dict));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static word groupName(Name name, const word &group)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
virtual bool read(const dictionary &dict)
Read source dictionary.
const fvMesh & mesh() const
Return const access to the mesh database.
virtual bool movePoints()
Update for mesh motion.
virtual void addSup(const volVectorField &U, fvMatrix< vector > &eqn) const
Source term to momentum equation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
scalar Cp_
Power coefficient.
word UName_
Name of the velocity field.
word phaseName_
The name of the phase to which this fvModel applies.
vector diskDir_
Disk area normal.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
point upstreamPoint_
Upstream point sample.
actuationDisk(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
label upstreamCellId_
Upstream cell ID.
scalar diskArea_
Disk area.
scalar Ct_
Thrust coefficient.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
label findCell(const point &p, const pointInCellShapes=pointInCellShapes::tets) const
Find the cell containing the given point.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
static const word null
An empty word.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
addBackwardCompatibleToRunTimeSelectionTable(fvConstraint, fixedTemperature, dictionary, fixedTemperatureConstraint, "fixedTemperatureConstraint")
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)