43 bool interpolationCellPointFace<Type>::findTet
48 label tetLabelCandidate[],
49 label tetPointLabels[],
51 scalar phiCandidate[],
56 bool foundTet =
false;
58 const labelList& thisFacePoints = this->pMeshFaces_[nFace];
59 tetPoints[2] = this->pMeshFaceCentres_[nFace];
63 while (pointi < thisFacePoints.size() && !foundTet)
65 label nextPointLabel = (pointi + 1) % thisFacePoints.
size();
67 tetPointLabels[0] = thisFacePoints[pointi];
68 tetPointLabels[1] = thisFacePoints[nextPointLabel];
70 tetPoints[0] = this->pMeshPoints_[tetPointLabels[0]];
71 tetPoints[1] = this->pMeshPoints_[tetPointLabels[1]];
76 for (label
n=0;
n<4;
n++)
78 label p1 = (
n + 1) % 4;
79 label p2 = (
n + 2) % 4;
80 label p3 = (
n + 3) % 4;
82 vector referencePoint, faceNormal;
83 referencePoint = tetPoints[p1];
88 (tetPoints[p3] - tetPoints[p1])
89 ^ (tetPoints[p2] - tetPoints[p1])
93 vector v0 = tetPoints[
n] - referencePoint;
94 scalar
correct = v0 & faceNormal;
97 faceNormal = -faceNormal;
100 vector v1 = position - referencePoint + SMALL*faceNormal;
101 scalar rightSide = v1 & faceNormal;
105 inside = inside && (rightSide >= 0);
107 scalar phiLength = (position - referencePoint) & faceNormal;
110 max(VSMALL, (tetPoints[
n] - referencePoint) & faceNormal);
112 phi[
n] = phiLength/maxLength;
119 if (
mag(dist - 1.0) < minDistance)
121 minDistance =
mag(dist - 1.0);
124 for (label i=0; i<4; i++)
126 phiCandidate[i] =
phi[i];
129 tetLabelCandidate[0] = tetPointLabels[0];
130 tetLabelCandidate[1] = tetPointLabels[1];
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2312/OpenFOAM-v2312/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
List< label > labelList
A List of labels.