1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "layerSmooth.H"
27 #include "slidingInterface.H"
28 #include "layerAdditionRemoval.H"
29 #include "surfaceFields.H"
30 #include "regionSplit.H"
31 #include "attachDetach.H"
32 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34 void Foam::layerSmooth::addZonesAndModifiers()
36 // Add the zones and mesh modifiers to operate piston motion
41 pointZones().size() > 0
42 || faceZones().size() > 0
43 || cellZones().size() > 0
44 || topoChanger_.size() > 0
46 pointZones().size() > 0
47 && faceZones().size() > 0
48 && topoChanger_.size() > 0
51 Info<< "Time = " << engTime().theta() << endl;
52 Info<< "void Foam::layerSmooth::addZonesAndModifiers() : "
53 << "Zones and modifiers already present. Skipping."
56 setVirtualPositions();
59 Info << "Point zones found = " << pointZones().size() << endl;
60 Info << "Face zones found = " << faceZones().size() << endl;
61 Info << "Cell zones found = " << cellZones().size() << endl;
67 pointZones().setSize(0);
68 faceZones().setSize(0);
69 cellZones().setSize(0);
70 topoChanger_.setSize(0);
75 engTime().engineDict().found("zOffsetGambit")
76 && engTime().engineDict().found("zDisplGambit")
79 Info << "Assembling the cylinder mesh" << endl;
83 readScalar(engTime().engineDict().lookup("zOffsetGambit"))
88 readScalar(engTime().engineDict().lookup("zDisplGambit"))
91 const pointField& ap = allPoints();
93 pointField pDispl = allPoints();
97 const point p = ap[pointI];
101 pDispl[pointI].z() -= zDispl;
110 Info << "Cylinder mesh assembled" << endl;
115 Info << "checkAndCalculate()" << endl;
118 Info<< "Time = " << engTime().theta() << endl
119 << "Adding zones to the engine mesh" << endl;
126 DynamicList<pointZone*> pz;
130 1) Piston layer faces
133 DynamicList<faceZone*> fz;
138 DynamicList<cellZone*> cz;
140 label nPointZones = 0;
141 label nFaceZones = 0;
142 label nCellZones = 0;
146 Adding the following faces zones:
149 Adding the following point zones:
154 # include "addPistonFacesPointZonesLayerSmooth.H"
157 # include "addAttachDetachFacesLayerSmooth.H"
159 Info<< "Adding " << nPointZones << " point zones, "
160 << nFaceZones << " face zones and "
161 << nCellZones << " cell zones" << endl;
163 pz.setSize(nPointZones);
164 Info << "setSize pz" << endl;
165 fz.setSize(nFaceZones);
166 Info << "setSize fz" << endl;
167 cz.setSize(nCellZones);
168 Info << "setSize cz" << endl;
170 addZones(pz, fz, cz);
172 # include "addMeshModifiersLayerSmooth.H"
174 // Calculating the virtual positions of piston and valves
176 setVirtualPositions();
181 Info << "virtualPistonPosition = " << virtualPistonPosition() << endl;
182 Info << "piston position = " << pistonPosition() << endl;
186 // ************************************************************************* //