dynamicMotionSolverListFvMesh.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 #include "motionSolver.H"
29 #include "pointMesh.H"
30 #include "volFields.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(dynamicMotionSolverListFvMesh, 0);
38  (
39  dynamicFvMesh,
40  dynamicMotionSolverListFvMesh,
41  IOobject
42  );
43 }
44 
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
48 Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
49 (
50  const IOobject& io
51 )
52 :
53  dynamicFvMesh(io),
54  motionSolvers_
55  (
57  (
58  IOobject
59  (
60  "dynamicMeshDict",
61  time().constant(),
62  *this,
65  )
66  ).lookup("solvers"),
67  motionSolver::iNew(*this)
68  )
69 {}
70 
71 
72 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
73 
75 {}
76 
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
81 {
82  if (motionSolvers_.size())
83  {
84  // Accumulated displacement
85  pointField disp(motionSolvers_[0].newPoints() - fvMesh::points());
86 
87  for (label i = 1; i < motionSolvers_.size(); i++)
88  {
89  disp += motionSolvers_[i].newPoints() - fvMesh::points();
90  }
91 
92  fvMesh::movePoints(points() + disp);
93 
94  if (foundObject<volVectorField>("U"))
95  {
96  lookupObjectRef<volVectorField>("U").correctBoundaryConditions();
97  }
98  }
99 
100  return true;
101 }
102 
103 
104 // ************************************************************************* //
Class used for the construction of PtrLists of motionSolvers.
Definition: motionSolver.H:104
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual bool update()
Dummy update function which does not change the mesh.
bool movePoints()
Do what is neccessary if the mesh has moved.
Macros for easy insertion into run-time selection tables.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1011
stressControl lookup("compactNormalStress") >> compactNormalStress
const pointField & points
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Constant dispersed-phase particle diameter model.
U correctBoundaryConditions()
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:51
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.