Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / engineTopoChangerMesh / twoStrokeEngine / addPistonLayerHrv.H
blob7b85191418bf828e7c1e73dc9ca3b3abc34f14a0
1 if (piston().patchID().active())
3     // add faces for piston layering
5     faceSet pistonFaceSet(*this, piston().pistonFaceSetName());
7     boolList flipPistonFaces(pistonFaceSet.toc().size(), false);
8     label nSet = pistonFaceSet.toc().size();
9     label nFlip = 0;
11     forAll (flipPistonFaces, facei)
12     {
13         scalar scalProd =
14             (faceAreas()[pistonFaceSet.toc()[facei]] & vector(0, 0, 1));
16         if (scalProd < 0)
17         {
18             flipPistonFaces[facei] = true;
19             nFlip++;
20         }
21     }
23     Info << "nSet = " << nSet << endl;
24     Info << "nFlip = " << nFlip << endl;
26     fz.append
27     (
28         new faceZone
29         (
30             "pistonLayerFaces",
31             pistonFaceSet.toc(),
32             flipPistonFaces,
33             nFaceZones,
34             faceZones()
35         )
36     );
38     nFaceZones++;
40 //     {
41 //         pointSet movingPistonPoints(*this, piston().pistonPointSetName());
43 //         pz.append
44 //         (
45 //             new pointZone
46 //             (
47 //                 "pistonPoints",
48 //                 movingPistonPoints.toc(),
49 //                 nPointZones,
50 //                 pointZones()
51 //             )
52 //         );
54 //         nPointZones++;
55 //     }
57     cellSet movingPistonCells(*this, piston().pistonCellSetName());
59     Info<< "Adding piston cell set" << endl;
60     cz.append
61     (
62         new cellZone
63         (
64             "pistonCells",
65             movingPistonCells.toc(),
66             nCellZones,
67             cellZones()
68         )
69     );
71     nCellZones++;