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 scalar pistonTopZ = -GREAT;
54 forAll(pistonPoints, i)
56 point& p = newPoints[pistonPoints[i]];
58 pistonTopZ = max(pistonTopZ, p.z());
62 // NN! fix. only needed for compression
65 // check if piston-points have moved beyond the layer above
70 if (virtualPistonPosition() > newPoints[i].z())
72 newPoints[i].z() = pistonTopZ + 0.9*minLayerThickness;
79 // movePoints(newPoints);
82 pistonPosition() += deltaZ;
83 scalar pistonSpeed = deltaZ/engTime().deltaT().value();
85 Info<< "clearance: " << deckHeight() - pistonPosition() << nl
86 << "Piston speed = " << pistonSpeed << " m/s" << endl;