34 template<
class RhoFieldType>
35 void Foam::fv::radialActuationDiskSource::
36 addRadialActuationDiskAxialInertialResistance
41 const RhoFieldType& rho,
50 E.xx() = uniDiskDir.x();
51 E.yy() = uniDiskDir.y();
52 E.zz() = uniDiskDir.z();
54 const Field<vector> zoneCellCentres(
mesh().cellCentres(), cells);
55 const Field<scalar> zoneCellVolumes(
mesh().cellVolumes(), cells);
57 const vector avgCentre =
gSum(zoneCellVolumes*zoneCellCentres)/
set_.V();
58 const scalar maxR =
gMax(
mag(zoneCellCentres - avgCentre));
62 + radialCoeffs_[1]*
sqr(maxR)/2.0
63 + radialCoeffs_[2]*
pow4(maxR)/3.0;
66 scalar upRho = vGreat;
72 reduce(upU, minOp<vector>());
73 reduce(upRho, minOp<scalar>());
78 scalar r2 =
magSqr(
mesh().cellCentres()[cells[i]] - avgCentre);
82 *(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*
sqr(r2))
85 Usource[cells[i]] += ((Vcells[cells[i]]/
set_.V())*Tr[i]*E) & upU;
91 <<
"Average centre: " << avgCentre <<
nl 92 <<
"Maximum radius: " << maxR <<
endl;
vector diskDir_
Disk area normal.
label upstreamCellId_
Upstream cell ID.
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return const access to the source name.
fvCellSet set_
The set of cells the fvConstraint applies to.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
volVectorField vectorField(fieldObject, mesh)
Vector< scalar > vector
A scalar version of the templated Vector.
const fvMesh & mesh() const
Return const access to the mesh database.
Type gSum(const FieldField< Field, Type > &f)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
volScalarField scalarField(fieldObject, mesh)
scalar Cp_
Power coefficient.
Type gMax(const FieldField< Field, Type > &f)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
scalar Ct_
Thrust coefficient.
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar diskArea_
Disk area.
Tensor< scalar > tensor
Tensor of scalars.