1 const labelListList& cp = cellPoints();
6 valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
8 // scalar valveDeltaX = valves_[valveI].curVelocity()*
9 // valves_[valveI].cs().axis().x()*engTime().deltaT().value() ;
10 // scalar valveDeltaY = valves_[valveI].curVelocity()*
11 // valves_[valveI].cs().axis().y()*engTime().deltaT().value() ;
12 scalar valveDeltaZ = valves_[valveI].curVelocity()*
13 valves_[valveI].cs().axis().z()*engTime().deltaT().value() ;
15 if(valves_[valveI].curLift() >= valves_[valveI].deformationLift())
17 if(mag(valves_[valveI].curVelocity()) > 0)
19 Info<< "Valve n. " << valveI << " is moving with velocity = "
20 << valves_[valveI].curVelocity() << endl;
23 Info<< "Valve displacement for valve " << valveI << " = "
24 << valveDeltaZ << endl;
28 valves_[valveI].poppetPatchID().active()
29 && valves_[valveI].isOpen()
32 List<bool> valveTopPoint(newPoints.size(), false);
35 label layeringVPtsIndex =
36 pointZones().findZoneID
38 "movingPointsTopZoneV" + Foam::name(valveI+1)
41 const labelList& layeringVPoints =
42 pointZones()[layeringVPtsIndex];
44 forAll(layeringVPoints, i)
46 point& p = newPoints[layeringVPoints[i]];
48 p += valveVel * engTime().deltaT().value();
50 valveTopPoint[layeringVPoints[i]] = true;
54 label layeringVCellsIndex =
55 cellZones().findZoneID
57 "movingCellsTopZoneV" + Foam::name(valveI+1)
60 const labelList& layeringVCells =
61 cellZones()[layeringVCellsIndex];
63 labelList layeringVPoints;
65 boolList count(newPoints.size(), false);
67 forAll(layeringVCells, cellI)
69 const labelList& curCellPoints = cp[layeringVCells[cellI]];
71 forAll (curCellPoints, i)
73 count[curCellPoints[i]] = true;
79 forAll (count, pointI)
81 if (count[pointI] == true)
87 layeringVPoints.setSize(nCounted);
91 forAll (count, pointI)
93 if (count[pointI] == true)
95 layeringVPoints[nCounted] = pointI;
101 forAll(layeringVPoints, i)
103 point& p = newPoints[layeringVPoints[i]];
105 p += valveVel * engTime().deltaT().value();
107 valveTopPoint[layeringVPoints[i]] = true;
111 label movingTopPtsVIndex =
112 pointZones().findZoneID
114 "movingPointsV" + Foam::name(valveI+1)
117 const labelList& movingTopPointsV =
118 pointZones()[movingTopPtsVIndex];
120 forAll(movingTopPointsV, i)
122 if(!valveTopPoint[movingTopPointsV[i]])
125 point& p = newPoints[movingTopPointsV[i]];
126 p += valveVel * engTime().deltaT().value();
132 label movingTopCellsVIndex =
133 cellZones().findZoneID
135 "movingCellsZoneV" + Foam::name(valveI+1)
138 const labelList& movingTopCellsV =
139 cellZones()[movingTopCellsVIndex];
141 labelList movingTopPointsV;
143 boolList count2(newPoints.size(), false);
145 forAll(movingTopCellsV, cellI)
147 const labelList& curCellPoints = cp[movingTopCellsV[cellI]];
149 forAll (curCellPoints, i)
151 count2[curCellPoints[i]] = true;
157 forAll (count2, pointI)
159 if (count2[pointI] == true)
165 movingTopPointsV.setSize(nCounted);
167 // Collect the points
169 forAll (count2, pointI)
171 if (count2[pointI] == true)
173 movingTopPointsV[nCounted] = pointI;
178 forAll(movingTopPointsV, i)
180 if(!valveTopPoint[movingTopPointsV[i]])
183 point& p = newPoints[movingTopPointsV[i]];
184 p += valveVel * engTime().deltaT().value();
193 Info << "Valve " << valveI << " is CLOSED!!!" << endl;