immersedBoundarySolidBodyMotionFvMesh.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 held by original author
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 the
13  Free Software Foundation; either version 2 of the License, or (at your
14  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, write to the Free Software Foundation,
23  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 \*---------------------------------------------------------------------------*/
26 
29 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(immersedBoundarySolidBodyMotionFvMesh, 0);
37  (
38  dynamicFvMesh,
39  immersedBoundarySolidBodyMotionFvMesh,
40  IOobject
41  );
42 }
43 
44 
45 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
52 (
53  const IOobject& io
54 )
55 :
56  dynamicFvMesh(io),
57  dynamicMeshCoeffs_
58  (
60  (
61  IOobject
62  (
63  "dynamicMeshDict",
64  time().constant(),
65  *this,
66  IOobject::MUST_READ,
67  IOobject::NO_WRITE
68  )
69  ).subDict(typeName + "Coeffs")
70  ),
71  ibMotions_()
72 {
73  // Read motion function for all regions
74  PtrList<entry> motionDicts(dynamicMeshCoeffs_.lookup("motionFunctions"));
75 
76  ibMotions_.setSize(motionDicts.size());
77 
78  forAll (motionDicts, mI)
79  {
80  ibMotions_.set
81  (
82  mI,
84  (
85  motionDicts[mI].keyword(),
86  *this,
87  motionDicts[mI].dict()
88  )
89  );
90  }
91 }
92 
93 
94 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
95 
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 
104 {
105  forAll (ibMotions_, ibI)
106  {
107  ibMotions_[ibI].movePoints();
108  }
109 
110  // Force flux and addressing recalculation as in topo change
111  pointField newAllPoints = allPoints();
112 
113  movePoints(newAllPoints);
114 
115  return true;
116 }
117 
118 
119 // ************************************************************************* //
volFields.H
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::immersedBoundarySolidBodyMotionFvMesh::update
virtual bool update()
Update the mesh for both mesh motion and topology change.
Definition: immersedBoundarySolidBodyMotionFvMesh.C:102
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Foam::dictionary::lookup
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:449
Foam::dynamicFvMesh
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:51
immersedBoundarySolidBodyMotionFvMesh.H
Foam::immersedBoundarySolidBodyMotionFvMesh::ibMotions_
PtrList< movingImmersedBoundary > ibMotions_
Immersed boundary motion control function.
Definition: immersedBoundarySolidBodyMotionFvMesh.H:59
constant
Constant dispersed-phase particle diameter model.
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::PtrList< entry >
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::immersedBoundarySolidBodyMotionFvMesh::~immersedBoundarySolidBodyMotionFvMesh
virtual ~immersedBoundarySolidBodyMotionFvMesh()
Definition: immersedBoundarySolidBodyMotionFvMesh.C:96
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::immersedBoundarySolidBodyMotionFvMesh::immersedBoundarySolidBodyMotionFvMesh
immersedBoundarySolidBodyMotionFvMesh(const immersedBoundarySolidBodyMotionFvMesh &)
Disallow default bitwise copy construct.
Foam::movingImmersedBoundary
Moving immesed boundary. Motion is prescribed using a solid body motion function.
Definition: movingImmersedBoundary.H:53
Foam::PtrList::size
label size() const
Return the number of elements in the PtrList.
Definition: PtrListI.H:32
Foam::DelaunayMeshTools::allPoints
tmp< pointField > allPoints(const Triangulation &t)
Extract all points in vertex-index order.
Foam::immersedBoundarySolidBodyMotionFvMesh::dynamicMeshCoeffs_
dictionary dynamicMeshCoeffs_
Dictionary of motion control parameters.
Definition: immersedBoundarySolidBodyMotionFvMesh.H:56
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)