20 const word outputName,
21 const word outputType,
27 UPtrList<DAFunction>& daFunctionList)
46 const pointMesh& pMesh = pointMesh::New(
mesh_);
47 const pointBoundaryMesh& boundaryMesh = pMesh.boundary();
52 label patchIPoints = boundaryMesh.findPatchID(patchName);
53 size_ += boundaryMesh[patchIPoints].size();
66 scalarList fX(
size_ / 3);
67 scalarList fY(
size_ / 3);
68 scalarList fZ(
size_ / 3);
71 volVectorField volumeForceField(
74 mesh_.time().timeName(),
79 dimensionedVector(
"surfaceForce", dimensionSet(1, 1, -2, 0, 0, 0, 0), vector::zero),
85 vector force(vector::zero);
87 const objectRegistry& db =
mesh_.thisDb();
88 const volScalarField&
p = db.lookupObject<volScalarField>(
"p");
90 const surfaceVectorField::Boundary& Sfb =
mesh_.Sf().boundaryField();
93 tmp<volSymmTensorField> tdevRhoReff = daTurb.
devRhoReff();
94 const volSymmTensorField::Boundary& devRhoReffb = tdevRhoReff().boundaryField();
96 const pointMesh& pMesh = pointMesh::New(
mesh_);
97 const pointBoundaryMesh& boundaryMesh = pMesh.boundary();
103 label patchI =
mesh_.boundaryMesh().findPatchID(
patches_[cI]);
105 const fvPatch& patch =
mesh_.boundary()[patchI];
107 vectorField fN(Sfb[patchI] * (
p.boundaryField()[patchI] -
pRef_));
109 vectorField fT(Sfb[patchI] & devRhoReffb[patchI]);
113 force.x() = fN[faceI].x() + fT[faceI].x();
114 force.y() = fN[faceI].y() + fT[faceI].y();
115 force.z() = fN[faceI].z() + fT[faceI].z();
116 volumeForceField.boundaryFieldRef()[patchI][faceI] = force;
119 volumeForceField.write();
122 pointField meshPoints =
mesh_.points();
124 vector nodeForce(vector::zero);
126 label patchStart = 0;
130 label patchI =
mesh_.boundaryMesh().findPatchID(
patches_[cI]);
131 label patchIPoints = boundaryMesh.findPatchID(
patches_[cI]);
133 label nPointsPatch = boundaryMesh[patchIPoints].size();
134 List<scalar> fXTemp(nPointsPatch);
135 List<scalar> fYTemp(nPointsPatch);
136 List<scalar> fZTemp(nPointsPatch);
137 List<label> pointListTemp(nPointsPatch);
140 label pointCounter = 0;
145 const label nPoints =
mesh_.boundaryMesh()[patchI][faceI].size();
148 nodeForce = volumeForceField.boundaryFieldRef()[patchI][faceI] / nPoints;
150 forAll(
mesh_.boundaryMesh()[patchI][faceI], pointI)
154 label faceIPointIndexI =
mesh_.boundaryMesh()[patchI][faceI][pointI];
159 for (label i = 0; i < pointCounter; i++)
161 if (faceIPointIndexI == pointListTemp[i])
173 fXTemp[iPoint] += nodeForce[0];
174 fYTemp[iPoint] += nodeForce[1];
175 fZTemp[iPoint] += nodeForce[2];
181 fXTemp[pointCounter] = nodeForce[0];
182 fYTemp[pointCounter] = nodeForce[1];
183 fZTemp[pointCounter] = nodeForce[2];
186 pointListTemp[pointCounter] = faceIPointIndexI;
195 SortableList<label> pointListSort(pointListTemp);
196 forAll(pointListSort.indices(), indexI)
198 fX[patchStart + indexI] = fXTemp[pointListSort.indices()[indexI]];
199 fY[patchStart + indexI] = fYTemp[pointListSort.indices()[indexI]];
200 fZ[patchStart + indexI] = fZTemp[pointListSort.indices()[indexI]];
204 patchStart += nPointsPatch;
210 output[counterI] = fX[idxI];
211 output[counterI + 1] = fY[idxI];
212 output[counterI + 2] = fZ[idxI];