MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / move

Function move

src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C:59–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
58
59void Foam::layeredEngineMesh::move()
60{
61 scalar deltaZ = engineDB_.pistonDisplacement().value();
62 Info<< "deltaZ = " << deltaZ << endl;
63
64 // Position of the top of the static mesh layers above the piston
65 scalar pistonPlusLayers = pistonPosition_.value() + pistonLayers_.value();
66
67 pointField newPoints(points());
68
69 forAll(newPoints, pointi)
70 {
71 point& p = newPoints[pointi];
72
73 if (p.z() < pistonPlusLayers) // In piston bowl
74 {
75 p.z() += deltaZ;
76 }
77 else if (p.z() < deckHeight_.value()) // In liner region
78 {
79 p.z() +=
80 deltaZ
81 *(deckHeight_.value() - p.z())
82 /(deckHeight_.value() - pistonPlusLayers);
83 }
84 }
85
86 if (engineDB_.foundObject<surfaceScalarField>("phi"))
87 {
88 surfaceScalarField& phi =
89 engineDB_.lookupObjectRef<surfaceScalarField>("phi");
90
91 const volScalarField& rho =
92 engineDB_.lookupObject<volScalarField>("rho");
93
94 const volVectorField& U =
95 engineDB_.lookupObject<volVectorField>("U");
96
97 bool absolutePhi = false;
98 if (moving())
99 {
100 phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U);
101 absolutePhi = true;
102 }
103
104 movePoints(newPoints);
105
106 if (absolutePhi)
107 {
108 phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U);
109 }
110 }
111 else
112 {
113 movePoints(newPoints);
114 }
115
116 pistonPosition_.value() += deltaZ;

Callers

nothing calls this directly

Calls 6

deltaTValueMethod · 0.80
forAllFunction · 0.50
interpolateFunction · 0.50
movePointsFunction · 0.50
valueMethod · 0.45
zMethod · 0.45

Tested by

no test coverage detected