fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / thoboisSliding / moveTopOfTheValvesThoboisSliding.H
blob05f400ccd0cc0ebfa72cf7e17b140990ce912b0d
1     {
2         forAll(valves(), valveI)
3         {
4             scalar valveDeltaZ = valves_[valveI].curVelocity()*engTime().deltaT().value() ;
5             bool isMoving(false);
6         
7             if(mag(valves_[valveI].curVelocity()) > 0)
8             {
9                 Info << "Valve n. " << valveI << " is moving" << endl;
10                 isMoving = true;
11             }
12             
13             if(valves_[valveI].poppetPatchID().active() && valves_[valveI].isOpen())
14             {
15                 
16 //                if(valves_[valveI].curLift() > valves_[valveI].deformationLift())
17 //                {
18                     const scalarField& movingPointsTop = movingPointsMaskTop(valveI);
19                         
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                         }
32         
33                 Info << " valve Delta Z = " << valveDeltaZ << endl;
34                         forAll(valveTopPoints, i)
35                         {
36                             
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                     }
44             
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     }