Forward compatibility: flex
[foam-extend-3.2.git] / src / engine / engineTopoChangerMesh / thoboisSliding / moveTopOfTheValvesThoboisSliding.H
blobcf5cc8db5611049d24268ff3da65e348ddb11bff
1     {
2         forAll(valves(), valveI)
3         {
4             scalar valveDeltaZ = valves_[valveI].curVelocity()*engTime().deltaT().value() ;
5             bool isMoving(false);
7             if(mag(valves_[valveI].curVelocity()) > 0)
8             {
9                 Info << "Valve n. " << valveI << " is moving" << endl;
10                 isMoving = true;
11             }
13             if(valves_[valveI].poppetPatchID().active() && valves_[valveI].isOpen())
14             {
16 //                if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
17 //                {
18                     const scalarField& movingPointsTop = movingPointsMaskTop(valveI);
20                     {
22                         List<bool> valveTopPoint(newPoints.size(), false);
24                         label valveTopPtsIndex = pointZones().findZoneID("movingPointsTopZoneV"+ Foam::name(valveI+1));
25                         const labelList& valveTopPoints = pointZones()[valveTopPtsIndex];
27                         forAll(valveTopPoints, i)
28                         {
29                             label pointI = valveTopPoints[i];
30                             valveTopPoint[pointI] = true;
31                         }
33                         Info << " valve Delta Z = " << valveDeltaZ << endl;
34                         forAll(valveTopPoints, i)
35                         {
37                             point& p = newPoints[valveTopPoints[i]];
38                             p.z() +=    valveDeltaZ*
39                                 (valves_[valveI].cs().axis().z()/mag(valves_[valveI].cs().axis()))*
40                                 movingPointsTop[valveTopPoints[i]];
41                         }
43                     }
45                     deleteDemandDrivenData(movingPointsMaskTopPtr_);
47                 }
48                 else
49                 {
50                     poppetDeformation = true;
51                 }
53             }
54             else
55             {
56                 Info << "Valve " << valveI << " is CLOSED!!!" << endl;
57             }
58         }
59     }