1 Info << "virtualPistonPosition = " << virtualPistonPosition()
2 << ", deckHeight = " << deckHeight() << endl;
4 // Mesh in three parts:
5 // - pistonPoints - move with deltaZ
6 // - headPoints - do not move
8 const pointZoneMesh& pZones = pointZones();
9 label headPtsIndex = pZones.findZoneID("headPoints");
10 label pistonPtsIndex = pZones.findZoneID("pistonPoints");
11 const labelList& pistonPoints = pZones[pistonPtsIndex];
12 const labelList& headPoints = pZones[headPtsIndex];
15 // Whether point displacement is by scaling
16 boolList scaleDisp(nPoints(), true);
17 label nScaled = nPoints();
18 List<bool> pistonPoint(newPoints.size(), false);
19 List<bool> headPoint(newPoints.size(), false);
21 forAll(pistonPoints, i)
23 label pointI = pistonPoints[i];
24 pistonPoint[pointI] = true;
25 point& p = newPoints[pointI];
27 if (p.z() < pistonPosition() - 1.0e-6)
29 scaleDisp[pointI] = false;
37 headPoint[headPoints[i]] = true;
38 scaleDisp[headPoints[i]] = false;
43 Info<< "Mesh nPoints:" << nPoints()
44 << " inside:" << nScaled
45 << " piston:" << pistonPoints.size()
46 << " head:" << headPoints.size()
53 forAll(scaleDisp, pointI)
55 point& p = newPoints[pointI];
57 if (scaleDisp[pointI])
61 * (deckHeight() - p.z())/(deckHeight() - pistonPosition());
65 if (!headPoint[pointI])
76 scalar pistonTopZ = -GREAT;
77 forAll(pistonPoints, i)
79 point& p = newPoints[pistonPoints[i]];
81 pistonTopZ = max(pistonTopZ, p.z());
85 // NN! fix. only needed for compression
88 // check if piston-points have moved beyond the layer above
93 if (virtualPistonPosition() > newPoints[i].z())
95 newPoints[i].z() = pistonTopZ + 0.9*minLayerThickness;
102 movePoints(newPoints);
104 pistonPosition() += deltaZ;
105 scalar pistonSpeed = deltaZ/engTime().deltaT().value();
107 Info<< "clearance: " << deckHeight() - pistonPosition() << nl
108 << "Piston speed = " << pistonSpeed << " m/s" << endl;