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/>.
27 \*---------------------------------------------------------------------------*/
29 #include "engineValveSliding.H"
30 #include "slidingInterface.H"
31 #include "layerAdditionRemoval.H"
32 #include "surfaceFields.H"
33 #include "regionSplit.H"
34 #include "attachDetach.H"
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
38 void Foam::engineValveSliding::addZonesAndModifiers()
40 // Add the zones and mesh modifiers to operate piston motion
44 pointZones().size() > 0
45 || faceZones().size() > 0
46 || cellZones().size() > 0
47 || topoChanger_.size() > 0
50 Info<< "Time = " << engTime().theta() << endl;
51 Info<< "void Foam::verticalValvesGambit::addZonesAndModifiers() : "
52 << "Zones and modifiers already present. Skipping."
55 setVirtualPositions();
56 // checkAndCalculate();
58 Info << "Point zones found = " << pointZones().size() << endl;
59 Info << "Face zones found = " << faceZones().size() << endl;
60 Info << "Cell zones found = " << cellZones().size() << endl;
66 Info << "checkAndCalculate()" << endl;
68 Info<< "Time = " << engTime().theta() << endl
69 << "Adding zones to the engine mesh" << endl;
74 1) Cut point zone for liner in head
82 DynamicList<pointZone*> pz;
90 2) valveBottomLayerFaces
95 DynamicList<faceZone*> fz;
99 1) moving cells inside piston
102 1) moving cells in the top of the valve
103 2) moving cells in the bottom of the valve
106 DynamicList<cellZone*> cz;
108 label nPointZones = 0;
109 label nFaceZones = 0;
110 label nCellZones = 0;
113 Adding the following faces zones:
115 nV: pistonLayerFacesV
117 Adding the following cell zones:
119 nV: movingCellsPistonV
121 Adding the following point zones:
123 nV: valvePistonPointsV
127 # include "addPistonFacesPointZonesEngineValveSliding.H"
130 Adding the following face zones:
138 Adding the following point zones:
144 # include "addValvesFacesPointZonesEngineValveSliding.H"
148 Adding the following point zones:
151 nV: valveBottomPointsV
153 Adding the following cell zones:
160 # include "addOutputCellsEngineValveSliding.H"
162 Info<< "Adding " << nPointZones << " point, "
163 << nFaceZones << " face zones and "
164 << nCellZones << " cell zones" << endl;
166 pz.setSize(nPointZones);
167 Info << "setSize pz" << endl;
168 fz.setSize(nFaceZones);
169 Info << "setSize fz" << endl;
170 cz.setSize(nCellZones);
171 Info << "setSize cz" << endl;
173 addZones(pz, fz, cz);
175 # include "addMeshModifiersEngineValveSliding.H"
177 // Calculating the virtual positions of piston and valves
179 setVirtualPositions();
181 Info << " Write mesh " << endl;
182 // Write mesh and modifiers
183 topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
186 Info << " Mesh written " << endl;
188 // Info << "virtualPistonPosition = " << virtualPistonPosition() << endl;
189 // Info << "piston position = " << pistonPosition() << endl;
194 // ************************************************************************* //