36Foam::label Foam::eddy::Gamma2Values[] = {1, 2, 3, 4, 5, 6, 7, 8};
43bool 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;
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;
#define R(A, B, C, D, E, F, K, M)
A 1D vector of objects of type <T> with a fixed length <N>.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static constexpr direction nComponents
Number of components in this vector space.
dimensioned< Type > T() const
Return transpose.
Class to describe eddies for the turbulentDFSEMInletFvPatchVectorField boundary condition.
const point & position0() const noexcept
Return the reference position.
void writeCentreOBJ(const vector &n, Ostream &os) const
Write the eddy centre in OBJ format.
const vector & alpha() const noexcept
Return the time-averaged intensity.
vector uPrime(const point &xp, const vector &n) const
Return the fluctuating velocity contribution at local point xp.
point position(const vector &n) const
Return the eddy position.
label writeSurfaceOBJ(const label pointOffset, const vector &n, Ostream &os) const
Write the eddy surface in OBJ format.
static int debug
Flag to activate debug statements.
label patchFaceI() const noexcept
Return the patch face index that spawned the eddy.
scalar x() const noexcept
Return the distance from the reference position.
const vector & sigma() const noexcept
Return the length scales in 3-D space.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
regionProperties rp(runTime)
Foam::UList< Foam::label > Foam::eddy::Gamma2 &[0] Gamma2Values
OBJstream os(runTime.globalPath()/outputName)
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))
#define WarningInFunction
Report a warning using Foam::Warning.
constexpr scalar pi(M_PI)
constexpr scalar twoPi(2 *M_PI)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Different types of constants.
Namespace for handling debugging switches.
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
dimensionedScalar sin(const dimensionedScalar &ds)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
static const Identity< scalar > I
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Return the sum of components of a SphericalTensor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensionedScalar cos(const dimensionedScalar &ds)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
constexpr char nl
The newline '\n' character (0x0a).
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.