Go to the documentation of this file.
44 vector Cpf = fCtrs[faceI] - ownCc;
50 - ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + ROOTVSMALL))*d;
56 scalar fd = 0.2*
mag(d) + ROOTVSMALL;
60 fd =
max(fd,
mag(svHat & (
p[
f[
pi]] - fCtrs[faceI])));
79 vector Cpf = fCtrs[faceI] - ownCc;
89 - ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + ROOTVSMALL))*d;
95 scalar fd = 0.4*
mag(d) + ROOTVSMALL;
99 fd =
max(fd,
mag(svHat & (
p[
f[
pi]] - fCtrs[faceI])));
116 return (d &
s)/(
mag(d)*
mag(
s) + ROOTVSMALL);
138 ortho[faceI] = faceOrthogonality
167 skew[faceI] = faceSkewness
175 cellCtrs[own[faceI]],
184 for (
label faceI =
mesh.nInternalFaces(); faceI <
mesh.nFaces(); faceI++)
186 skew[faceI] = boundaryFaceSkewness
215 ownPyrVol.setSize(
mesh.nFaces());
216 neiPyrVol.setSize(
mesh.nInternalFaces());
227 if (
mesh.isInternalFace(faceI))
263 sumClosed[own[faceI]] += areas[faceI];
264 sumMagClosed[own[faceI]] +=
cmptMag(areas[faceI]);
270 sumClosed[nei[faceI]] -= areas[faceI];
271 sumMagClosed[nei[faceI]] +=
cmptMag(areas[faceI]);
276 for (
direction dir = 0; dir < vector::nComponents; dir++)
286 openness.setSize(
mesh.nCells());
287 aratio.setSize(
mesh.nCells());
291 scalar maxOpenness = 0;
293 for (
direction cmpt=0; cmpt<vector::nComponents; cmpt++)
298 mag(sumClosed[cellI][cmpt])
299 /(sumMagClosed[cellI][cmpt] + ROOTVSMALL)
302 openness[cellI] = maxOpenness;
306 scalar minCmpt = VGREAT;
307 scalar maxCmpt = -VGREAT;
308 for (
direction dir = 0; dir < vector::nComponents; dir++)
312 minCmpt =
min(minCmpt, sumMagClosed[cellI][dir]);
313 maxCmpt =
max(maxCmpt, sumMagClosed[cellI][dir]);
317 scalar aspectRatio = maxCmpt/(minCmpt + ROOTVSMALL);
320 scalar v =
max(ROOTVSMALL, vols[cellI]);
325 1.0/6.0*
cmptSum(sumMagClosed[cellI])/
pow(v, 2.0/3.0)
329 aratio[cellI] = aspectRatio;
345 faceNormals /=
mag(faceNormals) + ROOTVSMALL;
353 const face&
f = fcs[faceI];
357 scalar magEPrev =
mag(ePrev);
358 ePrev /= magEPrev + ROOTVSMALL;
360 scalar maxEdgeSin = 0.0;
365 label fp1 =
f.fcIndex(fp0);
369 scalar magE10 =
mag(e10);
370 e10 /= magE10 + ROOTVSMALL;
372 if (magEPrev > SMALL && magE10 > SMALL)
374 vector edgeNormal = ePrev ^ e10;
375 scalar magEdgeNormal =
mag(edgeNormal);
377 if (magEdgeNormal < maxSin)
384 edgeNormal /= magEdgeNormal;
386 if ((edgeNormal & faceNormals[faceI]) < SMALL)
388 maxEdgeSin =
max(maxEdgeSin, magEdgeNormal);
397 faceAngles[faceI] = maxEdgeSin;
424 const face&
f = fcs[faceI];
426 if (
f.size() > 3 && magAreas[faceI] > ROOTVSMALL)
428 const point& fc = fCtrs[faceI];
437 const point& thisPoint =
p[
f[fp]];
438 const point& nextPoint =
p[
f.nextLabel(fp)];
441 vector n = 0.5*((nextPoint - thisPoint)^(fc - thisPoint));
445 faceFlatness[faceI] = magAreas[faceI]/(sumA + ROOTVSMALL);
449 return tfaceFlatness;
464 for (
direction dir = 0; dir < vector::nComponents; dir++)
483 cellDeterminant = 1.0;
494 label nInternalFaces = 0;
498 if (internalOrCoupledFace[curFaces[i]])
500 avgArea +=
mag(faceAreas[curFaces[i]]);
506 if (nInternalFaces == 0)
508 cellDeterminant[cellI] = 0;
512 avgArea /= nInternalFaces;
518 if (internalOrCoupledFace[curFaces[i]])
520 areaTensor +=
sqr(faceAreas[curFaces[i]]/avgArea);
542 cellDeterminant[cellI] =
mag(
det(areaTensor));
547 return tcellDeterminant;
dimensionedTensor skew(const dimensionedTensor &dt)
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
dimensioned< scalar > mag(const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
volScalarField scalarField(fieldObject, mesh)
const dimensionedScalar c
Speed of light in a vacuum.
A face is a list of labels corresponding to mesh vertices.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Cmpt cmptSum(const VectorSpace< Form, Cmpt, nCmpt > &vs)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
pyramid< point, const point &, const face & > pyramidPointFaceRef
A normal distribution model.
Cell-face mesh analysis engine.