Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / thoboisMesh / setValveMotionBoundaryConditionThobois.H
blob03afd8547e87e52ce4ae53e326b2840c69dd511a
1 // use tetrahedral decomposition of the engine mesh
4     
5     Info << "setting valve motion b.c." << endl;
7     tetPointVectorField& motionU = mSolver.motionU();
9     // Set valve velocity
10     forAll (valves_, valveI)
11     {
12         
13         Info << "Valve n. " << valveI + 1 << " velocity = " <<  valves_[valveI].curVelocity() << endl;
15         vector valveVel =
16             valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
17         
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         {
36                             
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         }
48         
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         }
59                 
60         }
62 //  Setting the boundary position
64     {
65         label cylinderHeadIndex = boundaryMesh().findPatchID(cylinderHeadName_);
66         
67         // Top of the valve does not move
68         motionU.boundaryField()[cylinderHeadIndex] ==
69             vector::zero;
70     }
71     
72     Info << "valve motion boundary conditions set" << endl;
73