Formatting
[foam-extend-3.2.git] / src / engine / engineTopoChangerMesh / thoboisMesh / setValveMotionBoundaryConditionThobois.H
blob1e59147379d64c6124590a068ddc37473a6d0900
1 // use tetrahedral decomposition of the engine mesh
5     Info << "setting valve motion b.c." << endl;
7     tetPointVectorField& motionU = mSolver.motionU();
9     // Set valve velocity
10     forAll (valves_, valveI)
11     {
13         Info << "Valve n. " << valveI + 1 << " velocity = " <<  valves_[valveI].curVelocity() << endl;
15         vector valveVel =
16             valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
18         // If valve is present in geometry, set the motion
19         if (valves_[valveI].bottomPatchID().active())
20         {
21             // Bottom of the valve moves with given velocity
22             motionU.boundaryField()[valves_[valveI].bottomPatchID().index()] ==
23                 valveVel;
25 //            if (debug)
26             {
27                 Info<< "Valve " << valveI << " lift: "
28                     << valves_[valveI].curLift()
29                     << " velocity: " << valves_[valveI].curVelocity()
30                     << endl;
31             }
32         }
34         if (valves_[valveI].poppetPatchID().active())
35         {
37             // Top of the valve does not move
38             motionU.boundaryField()[valves_[valveI].poppetPatchID().index()] ==
39                 valveVel;
40         }
42         if (valves_[valveI].sidePatchID().active())
43         {
44             // Top of the valve does not move
45             motionU.boundaryField()[valves_[valveI].sidePatchID().index()] ==
46                 valveVel;
47         }
49         if (valves_[valveI].detachInPortPatchID().active())
50         {
51             motionU.boundaryField()[valves_[valveI].detachInPortPatchID().index()] == vector::zero;
52         }
54         if (valves_[valveI].detachInCylinderPatchID().active())
55         {
56             motionU.boundaryField()[valves_[valveI].detachInCylinderPatchID().index()] == vector::zero;
57         }
60     }
62 //  Setting the boundary position
64     {
65         label cylinderHeadIndex = boundaryMesh().findPatchID(cylinderHeadName_);
67         // Top of the valve does not move
68         motionU.boundaryField()[cylinderHeadIndex] ==
69             vector::zero;
70     }
72     Info << "valve motion boundary conditions set" << endl;