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 "thoboisMesh.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::thoboisMesh::addZonesAndModifiers()
37 // Add the zones and mesh modifiers to operate piston motion
41 pointZones().size() > 0
42 && faceZones().size() > 0
43 && topoChanger_.size() > 0
47 Info<< "Time = " << engTime().theta() << endl;
48 Info<< "void Foam::thoboisMesh::addZonesAndModifiers() : "
49 << "Zones and modifiers already present. Skipping."
52 setVirtualPositions();
55 Info << "Point zones found = " << pointZones().size() << endl;
56 Info << "Face zones found = " << faceZones().size() << endl;
57 Info << "Cell zones found = " << cellZones().size() << endl;
64 pointZones().setSize(0);
65 faceZones().setSize(0);
66 cellZones().setSize(0);
67 topoChanger_.setSize(0);
71 Info << "checkAndCalculate()" << endl;
74 Info<< "Time = " << engTime().theta() << endl
75 << "Adding zones to the engine mesh" << endl;
82 DynamicList<pointZone*> pz;
89 DynamicList<faceZone*> fz;
94 DynamicList<cellZone*> cz;
96 label nPointZones = 0;
102 Adding the following faces zones:
108 Adding the following point zones:
110 nv: movingValvePoints
111 nv: staticValvePoints
115 # include "addPistonFacesPointZonesThoboisMesh.H"
117 //# include "addAttachDetachFacesThoboisMesh.H"
119 Info<< "Adding " << nPointZones << " point, "
120 << nFaceZones << " face zones and "
121 << nCellZones << " cell zones" << endl;
123 # include "addValveFaceZonesThoboisMesh.H"
125 pz.setSize(nPointZones);
126 Info << "setSize pz" << endl;
127 fz.setSize(nFaceZones);
128 Info << "setSize fz" << endl;
129 cz.setSize(nCellZones);
130 Info << "setSize cz" << endl;
132 addZones(pz, fz, cz);
134 # include "addMeshModifiersThoboisMesh.H"
136 // Calculating the virtual positions of piston and valves
138 setVirtualPositions();
140 // Write mesh and modifiers
141 topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
144 Info << "virtualPistonPosition = " << virtualPistonPosition() << endl;
145 Info << "piston position = " << pistonPosition() << endl;
149 // ************************************************************************* //