6 valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
8 scalar valveDeltaZ = valves_[valveI].curVelocity()*valves_[valveI].cs().axis().z()*engTime().deltaT().value() ;
10 if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
16 if(mag(valves_[valveI].curVelocity()) > 0)
18 Info << "Valve n. " << valveI << " is moving with velocity = " << valves_[valveI].curVelocity() << endl;
23 Info << "Valve displacement for valve " << valveI << " = " << valveDeltaZ << endl;
25 if(valves_[valveI].poppetPatchID().active() && valves_[valveI].isOpen())
28 List<bool> valveTopPoint(newPoints.size(), false);
30 // label layeringVPtsIndex = pointZones().findZoneID("movingPointsTopZoneV"+ Foam::name(valveI+1));
31 // const labelList& layeringVPoints = pointZones()[layeringVPtsIndex];
33 labelList layeringVPoints;
36 label valveLayeringCellsIndex = cellZones().findZoneID("movingCellsTopZoneV" + Foam::name(valveI + 1));
38 if (valveLayeringCellsIndex < 0)
40 FatalErrorIn("bool verticalValves::update()")
41 << "movingCellsTopZoneV"+ Foam::name(valveI+1)
45 const labelList& layeringCellsZoneV = cellZones()[valveLayeringCellsIndex];
47 const labelListList& cp = cellPoints();
49 boolList count(newPoints.size(), false);
51 forAll (layeringCellsZoneV, cellI)
53 const labelList& curCellPoints = cp[layeringCellsZoneV[cellI]];
55 forAll (curCellPoints, i)
57 count[curCellPoints[i]] = true;
63 forAll (count, pointI)
65 if (count[pointI] == true)
71 layeringVPoints.setSize(nCounted);
75 forAll (count, pointI)
77 if (count[pointI] == true)
79 layeringVPoints[nCounted] = pointI;
86 forAll(layeringVPoints, i)
88 point& p = newPoints[layeringVPoints[i]];
90 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
91 valveTopPoint[layeringVPoints[i]] = true;
94 label movingTopPtsVIndex = pointZones().findZoneID("movingPointsV"+ Foam::name(valveI+1));
96 const labelList& movingTopPointsV = pointZones()[movingTopPtsVIndex];
98 forAll(movingTopPointsV, i)
100 if(!valveTopPoint[movingTopPointsV[i]])
103 point& p = newPoints[movingTopPointsV[i]];
104 p.z() += valveDeltaZ*
105 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
109 deleteDemandDrivenData(movingPointsMaskTopPtr_);
114 Info << "Valve " << valveI << " is CLOSED!!!" << endl;
121 if(valves_[valveI].bottomPatchID().active() )
126 // label valveBottomPtsIndex = pointZones().findZoneID("movingPointsBottomZoneV"+ Foam::name(valveI+1));
127 // const labelList& valveBottomPoints = pointZones()[valveBottomPtsIndex];
129 labelList valveBottomPoints;
132 label valveBottomCellsIndex = cellZones().findZoneID("movingCellsBottomZoneV" + Foam::name(valveI + 1));
134 if (valveBottomCellsIndex < 0)
136 FatalErrorIn("bool verticalValves::update()")
137 << "movingCellsBottomZoneV"+ Foam::name(valveI+1)
138 << abort(FatalError);
141 const labelList& valveMovingCellsBotZoneV = cellZones()[valveBottomCellsIndex];
143 const labelListList& cp = cellPoints();
145 boolList count(newPoints.size(), false);
147 forAll (valveMovingCellsBotZoneV, cellI)
149 const labelList& curCellPoints = cp[valveMovingCellsBotZoneV[cellI]];
151 forAll (curCellPoints, i)
153 count[curCellPoints[i]] = true;
159 forAll (count, pointI)
161 if (count[pointI] == true)
167 valveBottomPoints.setSize(nCounted);
169 // Collect the points
171 forAll (count, pointI)
173 if (count[pointI] == true)
175 valveBottomPoints[nCounted] = pointI;
183 forAll(valveBottomPoints, i)
185 point& p = newPoints[valveBottomPoints[i]];
186 p.z() += valveDeltaZ*
187 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
192 deleteDemandDrivenData(movingPointsMaskBottomPtr_);