1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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 "thoboisMesh.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::thoboisMesh::addZonesAndModifiers()
36 // Add the zones and mesh modifiers to operate piston motion
40 pointZones().size() > 0
41 && faceZones().size() > 0
42 && topoChanger_.size() > 0
46 Info<< "Time = " << engTime().theta() << endl;
47 Info<< "void Foam::thoboisMesh::addZonesAndModifiers() : "
48 << "Zones and modifiers already present. Skipping."
51 setVirtualPositions();
54 Info << "Point zones found = " << pointZones().size() << endl;
55 Info << "Face zones found = " << faceZones().size() << endl;
56 Info << "Cell zones found = " << cellZones().size() << endl;
63 pointZones().setSize(0);
64 faceZones().setSize(0);
65 cellZones().setSize(0);
66 topoChanger_.setSize(0);
70 Info << "checkAndCalculate()" << endl;
73 Info<< "Time = " << engTime().theta() << endl
74 << "Adding zones to the engine mesh" << endl;
81 DynamicList<pointZone*> pz;
88 DynamicList<faceZone*> fz;
93 DynamicList<cellZone*> cz;
95 label nPointZones = 0;
101 Adding the following faces zones:
107 Adding the following point zones:
109 nv: movingValvePoints
110 nv: staticValvePoints
114 # include "addPistonFacesPointZonesThoboisMesh.H"
116 //# include "addAttachDetachFacesThoboisMesh.H"
118 Info<< "Adding " << nPointZones << " point, "
119 << nFaceZones << " face zones and "
120 << nCellZones << " cell zones" << endl;
122 # include "addValveFaceZonesThoboisMesh.H"
124 pz.setSize(nPointZones);
125 Info << "setSize pz" << endl;
126 fz.setSize(nFaceZones);
127 Info << "setSize fz" << endl;
128 cz.setSize(nCellZones);
129 Info << "setSize cz" << endl;
131 addZones(pz, fz, cz);
133 # include "addMeshModifiersThoboisMesh.H"
135 // Calculating the virtual positions of piston and valves
137 setVirtualPositions();
139 // Write mesh and modifiers
140 topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
143 Info << "virtualPistonPosition = " << virtualPistonPosition() << endl;
144 Info << "piston position = " << pistonPosition() << endl;
148 // ************************************************************************* //