Go to the documentation of this file.
37 template<
class RhoFieldType>
38 void Foam::fv::radialActuationDiskSource::
39 addRadialActuationDiskAxialInertialResistance
44 const RhoFieldType&
rho,
55 const Field<vector> zoneCellCentres(
mesh().cellCentres(),
cells);
56 const Field<scalar> zoneCellVolumes(
mesh().cellVolumes(),
cells);
58 const vector avgCentre =
gSum(zoneCellVolumes*zoneCellCentres)/
V();
59 const scalar maxR =
gMax(
mag(zoneCellCentres - avgCentre));
61 const scalar intCoeffs =
63 + radialCoeffs_[1]*
sqr(maxR)/2.0
64 + radialCoeffs_[2]*
pow4(maxR)/3.0;
66 if (
mag(intCoeffs) < VSMALL)
69 <<
"Radial distribution coefficients lead to zero polynomial." <<
nl
70 <<
"radialCoeffs = " << radialCoeffs_
82 rhoRef = rhoRef +
rho[celli];
84 reduce(Uref, sumOp<vector>());
85 reduce(rhoRef, sumOp<scalar>());
86 reduce(szMonitorCells, sumOp<label>());
88 if (szMonitorCells == 0)
91 <<
"No cell is available for incoming velocity monitoring."
95 Uref /= szMonitorCells;
96 rhoRef /= szMonitorCells;
101 if (
Cp <= VSMALL || Ct <= VSMALL)
104 <<
"Cp and Ct must be greater than zero." <<
nl
105 <<
"Cp = " <<
Cp <<
", Ct = " << Ct
109 const scalar a = 1.0 -
Cp/Ct;
118 *(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*
sqr(r2))
121 Usource[
cells[i]] += ((Vcells[
cells[i]]/
V_)*Tr[i]*E) & Uref;
140 <<
"Average centre: " << avgCentre <<
nl
141 <<
"Maximum radius: " << maxR <<
endl;
List< label > labelList
A List of labels.
scalar timeOutputValue() const
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void writeCurrentTime(Ostream &os) const
const word & name() const noexcept
const labelList & cells() const noexcept
virtual OFstream & file()
static constexpr const zero Zero
Ostream & endl(Ostream &os)
Type gSum(const FieldField< Field, Type > &f)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
scalar V() const noexcept
dimensionedScalar pow4(const dimensionedScalar &ds)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< Function1< scalar > > UvsCtPtr_
OBJstream os(runTime.globalPath()/outputName)
Vector< scalar > vector
A scalar version of the templated Vector.
autoPtr< Function1< scalar > > UvsCpPtr_
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
const fvMesh & mesh() const noexcept
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volScalarField & Cp
const Time & time() const
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Type gMax(const FieldField< Field, Type > &f)