5 valves_[valveI].curVelocity()*valves_[valveI].cs().axis().z()*engTime().deltaT().value() ;
7 if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
9 if(mag(valves_[valveI].curVelocity()) > 0)
11 Info << "Valve n. " << valveI << " is moving with velocity = " << valves_[valveI].curVelocity() << endl;
14 Info << "Valve displacement for valve " << valveI << " = " << valveDeltaZ << endl;
16 if(valves_[valveI].poppetPatchID().active() && valves_[valveI].isOpen())
19 List<bool> valveTopPoint(newPoints.size(), false);
21 // label layeringVPtsIndex = pointZones().findZoneID("movingPointsTopZoneV"+ Foam::name(valveI+1));
22 // const labelList& layeringVPoints = pointZones()[layeringVPtsIndex];
24 labelList layeringVPoints;
27 label valveLayeringCellsIndex = cellZones().findZoneID("movingCellsTopZoneV" + Foam::name(valveI + 1));
29 if (valveLayeringCellsIndex < 0)
31 FatalErrorIn("bool verticalValves::update()")
32 << "movingCellsTopZoneV"+ Foam::name(valveI+1)
36 const labelList& layeringCellsZoneV = cellZones()[valveLayeringCellsIndex];
38 const labelListList& cp = cellPoints();
40 boolList count(newPoints.size(), false);
42 forAll (layeringCellsZoneV, cellI)
44 const labelList& curCellPoints = cp[layeringCellsZoneV[cellI]];
46 forAll (curCellPoints, i)
48 count[curCellPoints[i]] = true;
54 forAll (count, pointI)
56 if (count[pointI] == true)
62 layeringVPoints.setSize(nCounted);
66 forAll (count, pointI)
68 if (count[pointI] == true)
70 layeringVPoints[nCounted] = pointI;
77 forAll(layeringVPoints, i)
79 point& p = newPoints[layeringVPoints[i]];
81 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
82 valveTopPoint[layeringVPoints[i]] = true;
85 label movingTopPtsVIndex = pointZones().findZoneID("movingPointsV"+ Foam::name(valveI+1));
87 const labelList& movingTopPointsV = pointZones()[movingTopPtsVIndex];
89 forAll(movingTopPointsV, i)
91 if(!valveTopPoint[movingTopPointsV[i]])
94 point& p = newPoints[movingTopPointsV[i]];
96 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
100 deleteDemandDrivenData(movingPointsMaskTopPtr_);
104 Info << "Valve " << valveI << " is CLOSED!!!" << endl;
108 if(valves_[valveI].bottomPatchID().active() )
112 // label valveBottomPtsIndex = pointZones().findZoneID("movingPointsBottomZoneV"+ Foam::name(valveI+1));
113 // const labelList& valveBottomPoints = pointZones()[valveBottomPtsIndex];
115 labelList valveBottomPoints;
117 label valveBottomCellsIndex = cellZones().findZoneID("movingCellsBottomZoneV" + Foam::name(valveI + 1));
119 if (valveBottomCellsIndex < 0)
121 FatalErrorIn("bool verticalValves::update()")
122 << "movingCellsBottomZoneV"+ Foam::name(valveI+1)
123 << abort(FatalError);
126 const labelList& valveMovingCellsBotZoneV = cellZones()[valveBottomCellsIndex];
128 const labelListList& cp = cellPoints();
130 boolList count(newPoints.size(), false);
132 forAll (valveMovingCellsBotZoneV, cellI)
134 const labelList& curCellPoints = cp[valveMovingCellsBotZoneV[cellI]];
136 forAll (curCellPoints, i)
138 count[curCellPoints[i]] = true;
144 forAll (count, pointI)
146 if (count[pointI] == true)
152 valveBottomPoints.setSize(nCounted);
154 // Collect the points
156 forAll (count, pointI)
158 if (count[pointI] == true)
160 valveBottomPoints[nCounted] = pointI;
167 forAll(valveBottomPoints, i)
169 point& p = newPoints[valveBottomPoints[i]];
170 p.z() += valveDeltaZ*
171 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()));
176 deleteDemandDrivenData(movingPointsMaskBottomPtr_);