42 int main(
int argc,
char *argv[])
46 "Generate a swirl flow for engine calculations" 52 #include "createFields.H" 56 scalar Vphi = (swirlRPMRatio * rpm *
rpmToRads()).value();
57 scalar b1 =
j1(swirlProfile).
value();
58 scalar b2 = 2.0*b1/swirlProfile.value() -
j0(swirlProfile).
value();
60 scalar omega = 0.125*(Vphi*bore*swirlProfile/b2).value();
62 scalar cylinderRadius = 0.5*bore.value();
70 if (r <= cylinderRadius)
72 scalar
b =
j1(swirlProfile*r/cylinderRadius).
value();
73 scalar vEff = omega*
b;
75 U[celli] = ((vEff/r)*(
c & yT))*xT + (-(vEff/r)*(
c & xT))*yT;
76 Umax =
max(Umax,
mag(
U[celli]));
const Type & value() const noexcept
Return const reference to value.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr scalar rpmToRads(const scalar rpm) noexcept
Conversion from revolutions/minute to radians/sec.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar j1(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionedScalar c
Speed of light in a vacuum.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensionedScalar j0(const dimensionedScalar &ds)