42int 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();
68 scalar r = ::pow(
sqr(c & xT) +
sqr(c & yT), 0.5);
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
Return const reference to value.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const dimensionedScalar c
Speed of light in a vacuum.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar j1(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
constexpr scalar rpmToRads(const scalar rpm) noexcept
Conversion from revolutions/minute to radians/sec.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar j0(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.