36 Foam::label Foam::eddy::Gamma2Values[] = {1, 2, 3, 4, 5, 6, 7, 8};
43 bool Foam::eddy::setScales
54 static const scalar gamma2VsC2[8] =
55 {2, 1.875, 1.737, 1.75, 0.91, 0.825, 0.806, 1.5};
60 const scalar
c2 = gamma2VsC2[gamma2 - 1];
63 const label d1 = dir1_;
64 const label d2 = (d1 + 1) % 3;
65 const label d3 = (d1 + 2) % 3;
100 <<
", gamma2:" << gamma2
101 <<
", gamma:" <<
gamma 103 <<
", sigma2: " << sigma2
104 <<
", slos2: " << slos2
105 <<
", sigmaX:" << sigmaX
106 <<
", sigma:" <<
sigma 107 <<
", alpha:" <<
alpha 132 const label patchFaceI,
133 const point& position0,
140 patchFaceI_(patchFaceI),
141 position0_(position0),
163 Pout<<
"Rpg.T() & R & Rpg: " << (Rpg_.T() &
R & Rpg_) <<
endl;
179 const label gamma2 = Gamma2[i];
181 if (setScales(sigmaX, gamma2,
e,
lambda, sigma_, alpha_))
205 <<
"Unable to set eddy intensity for eddy: " << *
this 218 patchFaceI_(
e.patchFaceI_),
219 position0_(
e.position0_),
236 if (
mag(r) >= scalar(1))
251 return c1_*(Rpg_ & uPrimep);
262 os <<
"v " <<
p.x() <<
" " <<
p.y() <<
" " <<
p.z() <<
nl;
268 const label pointOffset,
279 static const label nFaceAxis = 20;
280 static const label nFaceTheta = 22;
281 static const label nEddyPoints = (nFaceAxis - 1)*nFaceTheta + 2;
282 static FixedList<point, nEddyPoints>
x;
287 label pointI = pointOffset;
295 const label dir2 = (dir1_ + 1) % 3;
296 const label dir3 = (dir1_ + 2) % 3;
299 x[0] = axisDir*
s[dir1_];
300 x[nEddyPoints - 1] = - axisDir*
s[dir1_];
303 for (label axisI = 1; axisI < nFaceAxis; ++axisI)
305 const scalar z =
s[dir1_]*
cos(axisI*dPhi);
308 for (label thetaI = 0; thetaI < nFaceTheta; ++thetaI)
310 const scalar theta = thetaI*dTheta;
313 p[dir2] = r*
sin(theta);
314 p[dir3] = r*
cos(theta);
321 const point p = position(
n) + (Rpg_ &
x[i]);
322 os <<
"v " <<
p.x() <<
" " <<
p.y() <<
" " <<
p.z() <<
nl;
326 for (label faceI = 0; faceI < nFaceTheta; ++faceI)
328 const label p1 = pointI + 1;
329 const label p2 = p1 + faceI + 1;
331 if (faceI == nFaceTheta - 1) p3 -= nFaceTheta;
332 os <<
"f " << p1 <<
" " << p2 <<
" " << p3 <<
nl;
334 const label q1 = pointI + nEddyPoints;
335 const label q2 = q1 - faceI - 1;
337 if (faceI == nFaceTheta - 1) q3 += nFaceTheta;
338 os <<
"f " << q1 <<
" " << q2 <<
" " << q3 <<
nl;
342 for (label axisI = 1; axisI < nFaceAxis - 1; ++axisI)
344 for (label thetaI = 0; thetaI < nFaceTheta; ++thetaI)
346 const label p1 = pointI + 1 + (axisI - 1)*nFaceTheta + thetaI + 1;
347 const label p2 = p1 + nFaceTheta;
351 if (thetaI == nFaceTheta - 1)
356 os <<
"f " << p1 <<
" " << p2 <<
" " << p3 <<
" " << p4 <<
nl;
Different types of constants.
Foam::UList< Foam::label > Foam::eddy::Gamma2 &[0] Gamma2Values
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Return the sum of components of a SphericalTensor.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label writeSurfaceOBJ(const label pointOffset, const vector &n, Ostream &os) const
Write the eddy surface in OBJ format.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
void writeCentreOBJ(const vector &n, Ostream &os) const
Write the eddy centre in OBJ format.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
#define forAll(list, i)
Loop across all elements in list.
vector uPrime(const point &xp, const vector &n) const
Return the fluctuating velocity contribution at local point xp.
const dimensionedScalar e
Elementary charge.
dimensionedScalar cos(const dimensionedScalar &ds)
static const Identity< scalar > I
constexpr scalar twoPi(2 *M_PI)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
regionProperties rp(runTime)
constexpr scalar pi(M_PI)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static int debug
Flag to activate debug statements.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
vector epsilon(Random &rndGen) const
Return random vector of -1 and 1's.
OBJstream os(runTime.globalPath()/outputName)
dimensioned< Type > T() const
Return transpose.
vector point
Point is a vector.
#define R(A, B, C, D, E, F, K, M)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Tensor of scalars, i.e. Tensor<scalar>.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
static constexpr const zero Zero
Global zero (0)