2 // adding face zones for the vertical valves
4 for (label valveI = 0; valveI < nValves(); valveI++)
6 // If both sides of the interface exist, add sliding interface
10 valves_[valveI].curtainInCylinderPatchID().active()
11 && valves_[valveI].curtainInPortPatchID().active()
14 Info<< "Adding sliding interface zones for curtain of valve "
15 << valveI + 1 << endl;
21 "cutPointsV" + Foam::name(valveI + 1),
30 const polyPatch& cylCurtain =
32 [valves_[valveI].curtainInCylinderPatchID().index()];
34 labelList cylCurtainLabels(cylCurtain.size(), cylCurtain.start());
36 forAll (cylCurtainLabels, i)
38 cylCurtainLabels[i] += i;
45 "curtainCylZoneV" + Foam::name(valveI + 1),
47 boolList(cylCurtainLabels.size(), false),
55 const polyPatch& portCurtain =
57 [valves_[valveI].curtainInPortPatchID().index()];
59 labelList portCurtainLabels
65 forAll (portCurtainLabels, i)
67 portCurtainLabels[i] += i;
74 "curtainPortZoneV" + Foam::name(valveI + 1),
76 boolList(portCurtainLabels.size(), false),
84 // Add empty zone for cut faces
90 "cutFaceZoneV" + Foam::name(valveI + 1),
103 Info << "No valve curtain for valve " << valveI + 1 << endl;
106 // Make a zone for layer addition at the top of the valve
107 if (valves_[valveI].poppetPatchID().active())
109 Info << "Adding face zone for valve top patch layer addition/removal" << endl;
111 label valvePatchID = valves_[valveI].poppetPatchID().index();
113 const polyPatch& valveTopPatch = boundaryMesh()[valvePatchID];
115 labelList valveTopLayerFaces(0);
116 boolList flipZone1(0);
118 forAll(valveTopPatch.faceCentres(), faceI)
120 scalar xFacePatch = valveTopPatch.faceCentres()[faceI].x();
121 scalar yFacePatch = valveTopPatch.faceCentres()[faceI].y();
122 scalar zFacePatch = valveTopPatch.faceCentres()[faceI].z();
124 forAll(faceCentres(),faceI)
127 vector n = faceAreas()[faceI]/mag(faceAreas()[faceI]);
129 scalar dd = n & vector(0,0,1);
133 scalar xFaceMesh = faceCentres()[faceI].x();
134 scalar yFaceMesh = faceCentres()[faceI].y();
135 scalar zFaceMesh = faceCentres()[faceI].z();
139 mag(xFaceMesh-xFacePatch) < poppetValveTol_ &&
140 mag(yFaceMesh-yFacePatch) < poppetValveTol_ &&
141 mag(zFaceMesh-zFacePatch) < valves_[valveI].topLayerOffset() + poppetValveTol_ &&
142 mag(zFaceMesh-zFacePatch) > valves_[valveI].topLayerOffset() - poppetValveTol_ &&
143 (zFaceMesh-zFacePatch) > SMALL
147 label sizeTop = valveTopLayerFaces.size();
148 valveTopLayerFaces.setSize(sizeTop + 1);
149 valveTopLayerFaces[sizeTop] = faceI;
150 flipZone1.setSize(sizeTop + 1);
151 if ((faceAreas()[faceI] & vector(0,0,1)) < 0)
153 flipZone1[sizeTop] = true;
157 flipZone1[sizeTop] = false;
171 "poppetZoneV" + Foam::name(valveI + 1),
184 Info << "No poppet layer addition zone for valve "
185 << valveI + 1 << endl;
188 // Make a zone for layer addition at the bottom of the valve
189 if (valves_[valveI].bottomPatchID().active())
191 Info << "Adding face zone for valve bottom patch layer addition/removal" << endl;
193 label valvePatchID = valves_[valveI].bottomPatchID().index();
195 const polyPatch& valveBottomPatch = boundaryMesh()[valvePatchID];
197 labelList valveBottomLayerFaces(0);
198 boolList flipZone1(0);
200 forAll(valveBottomPatch.faceCentres(), faceI)
202 scalar xFacePatch = valveBottomPatch.faceCentres()[faceI].x();
203 scalar yFacePatch = valveBottomPatch.faceCentres()[faceI].y();
204 scalar zFacePatch = valveBottomPatch.faceCentres()[faceI].z();
206 forAll(faceCentres(),faceI)
209 vector n = faceAreas()[faceI]/mag(faceAreas()[faceI]);
211 scalar dd = n & vector(0,0,1);
215 scalar xFaceMesh = faceCentres()[faceI].x();
216 scalar yFaceMesh = faceCentres()[faceI].y();
217 scalar zFaceMesh = faceCentres()[faceI].z();
221 mag(xFaceMesh-xFacePatch) < bottomValveTol_ &&
222 mag(yFaceMesh-yFacePatch) < bottomValveTol_ &&
223 mag(zFaceMesh-zFacePatch) < valves_[valveI].bottomLayerOffset() + bottomValveTol_ &&
224 mag(zFaceMesh-zFacePatch) > valves_[valveI].bottomLayerOffset() - bottomValveTol_ &&
225 (zFacePatch-zFaceMesh) > SMALL
229 label sizeTop = valveBottomLayerFaces.size();
230 valveBottomLayerFaces.setSize(sizeTop + 1);
231 valveBottomLayerFaces[sizeTop] = faceI;
232 flipZone1.setSize(sizeTop + 1);
233 if ((faceAreas()[faceI] & vector(0,0,1)) > 0)
235 flipZone1[sizeTop] = true;
239 flipZone1[sizeTop] = false;
249 Info << "valveBottomLayerFaces size = " << valveBottomLayerFaces.size() << endl;
255 "bottomZoneV" + Foam::name(valveI + 1),
256 valveBottomLayerFaces,
268 Info << "No bottom layer addition zone for valve "
269 << valveI + 1 << endl;