8 if(mag(valves_[valveI].curVelocity()) > 0)
10 Info << "Valve n. " << valveI << " is moving" << endl;
14 scalar valveDeltaZ = valves_[valveI].curVelocity()*engTime().deltaT().value() ;
16 Info << "Valve displacement for valve " << valveI << " = " << valveDeltaZ << endl;
18 if(valves_[valveI].poppetPatchID().active() && valves_[valveI].isOpen())
20 if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
22 const scalarField& movingPointsTop = movingPointsMaskTop(valveI+1);
24 List<bool> valveTopPoint(newPoints.size(), false);
26 labelList valveTopPoints;
29 label valveTopCellsIndex = cellZones().findZoneID("movingCellsTopV"+ Foam::name(valveI));
31 if (valveTopCellsIndex < 0)
33 FatalErrorIn("bool verticalValves::update()")
34 << "movingCellsTopV"+ Foam::name(valveI)
38 const labelList& movingCellsTopV = cellZones()[valveTopCellsIndex];
40 const labelListList& cp = cellPoints();
42 boolList count(newPoints.size(), false);
44 forAll (movingCellsTopV, cellI)
46 const labelList& curCellPoints = cp[movingCellsTopV[cellI]];
48 forAll (curCellPoints, i)
50 count[curCellPoints[i]] = true;
56 forAll (count, pointI)
58 if (count[pointI] == true)
64 valveTopPoints.setSize(nCounted);
68 forAll (count, pointI)
70 if (count[pointI] == true)
72 valveTopPoints[nCounted] = pointI;
79 // label valveTopPtsIndex = pointZones().findZoneID("valveTopPointsV"+ Foam::name(valveI+1));
80 // const labelList& valveTopPoints = pointZones()[valveTopPtsIndex];
82 forAll(valveTopPoints, i)
84 label pointI = valveTopPoints[i];
85 valveTopPoint[pointI] = true;
88 forAll(valveTopPoints, i)
90 point& p = newPoints[valveTopPoints[i]];
92 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()))*
93 movingPointsTop[valveTopPoints[i]];
96 deleteDemandDrivenData(movingPointsMaskTopPtr_);
100 poppetDeformation = true;
106 Info << "Valve " << valveI << " is CLOSED!!!" << endl;
109 if(valves_[valveI].bottomPatchID().active() && valves_[valveI].isOpen())
111 const scalarField& movingPointsBottom = movingPointsMaskBottom(valveI);
114 List<bool> valveBottomPoint(newPoints.size(), false);
116 labelList valveBottomPoints;
119 label valveBotCellsIndex = cellZones().findZoneID("movingCellsBotV"+ Foam::name(valveI+1));
121 if (valveBotCellsIndex < 0)
123 FatalErrorIn("bool verticalValves::update()")
124 << "movingCellsBotV"+ Foam::name(valveI)
125 << abort(FatalError);
128 const labelList& movingCellsBotV = cellZones()[valveBotCellsIndex];
130 const labelListList& cp = cellPoints();
132 boolList count(newPoints.size(), false);
134 forAll (movingCellsBotV, cellI)
136 const labelList& curCellPoints = cp[movingCellsBotV[cellI]];
138 forAll (curCellPoints, i)
140 count[curCellPoints[i]] = true;
146 forAll (count, pointI)
148 if (count[pointI] == true)
154 valveBottomPoints.setSize(nCounted);
156 // Collect the points
158 forAll (count, pointI)
160 if (count[pointI] == true)
162 valveBottomPoints[nCounted] = pointI;
170 // label valveBottomPtsIndex = pointZones().findZoneID("valveBottomPointsV"+ Foam::name(valveI+1));
171 // const labelList& valveBottomPoints = pointZones()[valveBottomPtsIndex];
173 forAll(valveBottomPoints, i)
175 label pointI = valveBottomPoints[i];
176 valveBottomPoint[pointI] = true;
179 forAll(valveBottomPoints, i)
181 point& p = newPoints[valveBottomPoints[i]];
182 p.z() += valveDeltaZ*
183 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()))*
184 movingPointsBottom[valveBottomPoints[i]];
189 deleteDemandDrivenData(movingPointsMaskBottomPtr_);
194 Info << "Valve " << valveI << " is CLOSED!!!" << endl;