displacementMeshMoverMotionSolver.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) 2013-2015 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 "localPointRegion.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(displacementMeshMoverMotionSolver, 0);
35 
37  (
38  motionSolver,
39  displacementMeshMoverMotionSolver,
40  dictionary
41  );
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 (
49  const polyMesh& mesh,
50  const IOdictionary& dict
51 )
52 :
53  displacementMotionSolver(mesh, dict, typeName) // read pointDisplacement
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58 
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
65 
66 
69 {
70  if (!meshMoverPtr_.valid())
71  {
72  const word moverType(coeffDict().lookup("meshMover"));
73 
75  (
76  moverType,
77  coeffDict().subDict(moverType + "Coeffs"),
79  pointDisplacement_
80  );
81  }
82  return meshMoverPtr_();
83 }
84 
85 
88 {
89  // Return actual points. Cannot do a reference since complains about
90  // assignment to self in polyMesh::movePoints
91  return tmp<pointField>(new pointField(mesh().points()));
92 }
93 
94 
96 {
97  // The points have moved so before calculation update
98  // the mesh and motionSolver accordingly
99  movePoints(mesh().points());
100 
101  // Update any point motion bcs (e.g. timevarying)
102  pointDisplacement().boundaryField().updateCoeffs();
103 
104  label nAllowableErrors = 0;
105  labelList checkFaces(identity(mesh().nFaces()));
106  meshMover().move
107  (
108  coeffDict().subDict(meshMover().type() + "Coeffs"),
109  nAllowableErrors,
110  checkFaces
111  );
112 
113  // This will have updated the mesh and implicitly the pointDisplacement
114  pointDisplacement().correctBoundaryConditions();
115 }
116 
117 
119 {
121 
122  // Update meshMover for new geometry
123  if (meshMoverPtr_.valid())
124  {
125  meshMover().movePoints(p);
126  }
127 }
128 
129 
131 (
132  const mapPolyMesh& map
133 )
134 {
136 
137  // Update meshMover for new topology
138  meshMoverPtr_.clear();
139 }
140 
141 
142 // ************************************************************************* //
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
displacementMeshMoverMotionSolver.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
localPointRegion.H
Foam::displacementMotionSolver::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Definition: displacementMotionSolver.C:248
Foam::displacementMeshMoverMotionSolver::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update topology.
Definition: displacementMeshMoverMotionSolver.C:131
Foam::displacementMeshMoverMotionSolver::solve
virtual void solve()
Solve for motion.
Definition: displacementMeshMoverMotionSolver.C:95
Foam::displacementMeshMoverMotionSolver::~displacementMeshMoverMotionSolver
~displacementMeshMoverMotionSolver()
Destructor.
Definition: displacementMeshMoverMotionSolver.C:60
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::displacementMeshMoverMotionSolver::meshMover
externalDisplacementMeshMover & meshMover() const
Definition: displacementMeshMoverMotionSolver.C:68
Foam::displacementMeshMoverMotionSolver::curPoints
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Definition: displacementMeshMoverMotionSolver.C:87
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::externalDisplacementMeshMover::New
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Return a reference to the selected meshMover model.
Definition: externalDisplacementMeshMover.C:135
Foam::externalDisplacementMeshMover
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
Definition: externalDisplacementMeshMover.H:56
Foam::identity
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::displacementMotionSolver
Virtual base class for displacement motion solver.
Definition: displacementMotionSolver.H:55
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::displacementMeshMoverMotionSolver::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: displacementMeshMoverMotionSolver.C:118
Foam::displacementMotionSolver::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: displacementMotionSolver.C:242
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::displacementMeshMoverMotionSolver::displacementMeshMoverMotionSolver
displacementMeshMoverMotionSolver(const displacementMeshMoverMotionSolver &)
Disallow default bitwise copy construct.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::localPointRegion::findDuplicateFacePairs
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Definition: localPointRegion.C:620
lookup
stressControl lookup("compactNormalStress") >> compactNormalStress