Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / engine / engineTopoChangerMesh / pistonSliding / moveTopOfTheValvesPistonSliding.H
blobf85d3397598f126fd9d6687fd971c67f91537b71
2     forAll(valves(), valveI)
3     {
4         scalar valveDeltaZ =
5             valves_[valveI].curVelocity()*engTime().deltaT().value() ;
7         bool isMoving = false;
9         if(mag(valves_[valveI].curVelocity()) > 0)
10         {
11             Info << "Valve n. " << valveI << " is moving" << endl;
12             isMoving = true;
13         }
15         if
16         (
17             valves_[valveI].poppetPatchID().active()
18          && valves_[valveI].isOpen()
19         )
20         {
21             if (valves_[valveI].curLift() > valves_[valveI].deformationLift())
22             {
23                 const scalarField& movingPointsTop =
24                     movingPointsMaskTop(valveI);
26                 {
27                     List<bool> valveTopPoint(newPoints.size(), false);
29                     label valveTopPtsIndex =
30                         pointZones().findZoneID("movingPointsTopZoneV"
31                       + Foam::name(valveI+1));
33                     const labelList& valveTopPoints =
34                         pointZones()[valveTopPtsIndex];
36                     forAll (valveTopPoints, i)
37                     {
38                         label pointI = valveTopPoints[i];
39                         valveTopPoint[pointI] = true;
40                     }
42                     Info << " valve Delta Z = " << valveDeltaZ << endl;
44                     forAll(valveTopPoints, i)
45                     {
46                         point& p = newPoints[valveTopPoints[i]];
48                         p.z() += valveDeltaZ*
49                             (
50                                 valves_[valveI].cs().axis().z()/
51                                 mag(valves_[valveI].cs().axis())
52                             )*movingPointsTop[valveTopPoints[i]];
53                     }
54                 }
56                 deleteDemandDrivenData(movingPointsMaskTopPtr_);
57             }
58 //             else
59 //             {
60 //                 poppetDeformation = true;
61 //             }
62         }
63         else
64         {
65             Info << "Valve " << valveI << " is CLOSED!!!" << endl;
66         }
67     }