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())
19 if(mag(valves_[valveI].curVelocity()) > 0)
21 Info<< "Valve n. " << valveI << " is moving with velocity = "
22 << valves_[valveI].curVelocity() << endl;
26 Info<< "Valve displacement for valve " << valveI << " = "
27 << valveDeltaZ << endl;
31 valves_[valveI].poppetPatchID().active()
32 && valves_[valveI].isOpen()
35 List<bool> valveTopPoint(newPoints.size(), false);
38 label layeringVPtsIndex =
39 pointZones().findZoneID
41 "movingPointsTopZoneV" + Foam::name(valveI+1)
44 const labelList& layeringVPoints =
45 pointZones()[layeringVPtsIndex];
47 forAll(layeringVPoints, i)
49 point& p = newPoints[layeringVPoints[i]];
51 p += valveVel * engTime().deltaT().value();
53 valveTopPoint[layeringVPoints[i]] = true;
57 label layeringVCellsIndex =
58 cellZones().findZoneID
60 "movingCellsTopZoneV" + Foam::name(valveI+1)
63 const labelList& layeringVCells =
64 cellZones()[layeringVCellsIndex];
66 labelList layeringVPoints;
68 boolList count(newPoints.size(), false);
70 forAll(layeringVCells, cellI)
72 const labelList& curCellPoints = cp[layeringVCells[cellI]];
74 forAll (curCellPoints, i)
76 count[curCellPoints[i]] = true;
82 forAll (count, pointI)
84 if (count[pointI] == true)
90 layeringVPoints.setSize(nCounted);
94 forAll (count, pointI)
96 if (count[pointI] == true)
98 layeringVPoints[nCounted] = pointI;
104 forAll(layeringVPoints, i)
106 point& p = newPoints[layeringVPoints[i]];
108 p += valveVel * engTime().deltaT().value();
110 valveTopPoint[layeringVPoints[i]] = true;
114 label movingTopPtsVIndex =
115 pointZones().findZoneID
117 "movingPointsV" + Foam::name(valveI+1)
120 const labelList& movingTopPointsV =
121 pointZones()[movingTopPtsVIndex];
123 forAll(movingTopPointsV, i)
125 if(!valveTopPoint[movingTopPointsV[i]])
128 point& p = newPoints[movingTopPointsV[i]];
129 p += valveVel * engTime().deltaT().value();
135 label movingTopCellsVIndex =
136 cellZones().findZoneID
138 "movingCellsZoneV" + Foam::name(valveI+1)
141 const labelList& movingTopCellsV =
142 cellZones()[movingTopCellsVIndex];
144 labelList movingTopPointsV;
146 boolList count2(newPoints.size(), false);
148 forAll(movingTopCellsV, cellI)
150 const labelList& curCellPoints = cp[movingTopCellsV[cellI]];
152 forAll (curCellPoints, i)
154 count2[curCellPoints[i]] = true;
160 forAll (count2, pointI)
162 if (count2[pointI] == true)
168 movingTopPointsV.setSize(nCounted);
170 // Collect the points
172 forAll (count2, pointI)
174 if (count2[pointI] == true)
176 movingTopPointsV[nCounted] = pointI;
181 forAll(movingTopPointsV, i)
183 if(!valveTopPoint[movingTopPointsV[i]])
186 point& p = newPoints[movingTopPointsV[i]];
187 p += valveVel * engTime().deltaT().value();
196 Info << "Valve " << valveI << " is CLOSED!!!" << endl;