1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "accordionEngineMesh.H"
28 #include "slidingInterface.H"
29 #include "layerAdditionRemoval.H"
30 #include "surfaceFields.H"
31 #include "regionSplit.H"
32 #include "attachDetach.H"
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
35 void Foam::accordionEngineMesh::addZonesAndModifiers()
37 // Add the zones and mesh modifiers to operate piston motion
41 pointZones().size() > 0
43 && faceZones().size() > 0
44 && cellZones().size() > 0
45 && topoChanger_.size() > 0
49 Info<< "Time = " << engTime().theta() << endl;
50 Info<< "void Foam::accordionEngineMesh::addZonesAndModifiers() : "
51 << "Zones and modifiers already present. Skipping."
54 // setVirtualPositions();
57 Info << "Point zones found = " << pointZones().size() << endl;
58 Info << "Face zones found = " << faceZones().size() << endl;
59 Info << "Cell zones found = " << cellZones().size() << endl;
66 pointZones().setSize(0);
67 faceZones().setSize(0);
68 cellZones().setSize(0);
69 topoChanger_.setSize(0);
72 Info << "checkAndCalculate()" << endl;
75 Info<< "Time = " << engTime().theta() << endl
76 << "Adding zones to the engine mesh" << endl;
83 DynamicList<pointZone*> pz;
90 DynamicList<faceZone*> fz;
95 DynamicList<cellZone*> cz;
97 label nPointZones = 0;
103 Adding the following faces zones:
109 Adding the following point zones:
111 nv: movingValvePoints
112 nv: staticValvePoints
116 # include "addPistonFacesPointZonesAccordionEngineMesh.H"
118 # include "addAttachDetachFacesAccordionEngineMesh.H"
119 # include "addValveFaceZonesAccordionEngineMesh.H"
121 # include "addOutputCellsAccordionEngineMesh.H"
122 Info<< "Adding " << nPointZones << " point, "
123 << nFaceZones << " face zones and "
124 << nCellZones << " cell zones" << endl;
127 pz.setSize(nPointZones);
128 Info << "setSize pz" << endl;
129 fz.setSize(nFaceZones);
130 Info << "setSize fz" << endl;
131 cz.setSize(nCellZones);
132 Info << "setSize cz" << endl;
134 addZones(pz, fz, cz);
136 # include "addMeshModifiersAccordionEngineMesh.H"
138 // Calculating the virtual positions of piston and valves
140 // setVirtualPositions();
142 // Write mesh and modifiers
143 topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
146 Info << "virtualPistonPosition = " << virtualPistonPosition() << endl;
147 Info << "piston position = " << pistonPosition() << endl;
151 // ************************************************************************* //