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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013-2015 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
31#include "localPointRegion.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
38
40 (
44 );
45}
46
47
48// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49
51(
52 const polyMesh& mesh,
53 const IOdictionary& dict
54)
55:
56 displacementMotionSolver(mesh, dict, typeName) // read pointDisplacement
57{}
58
59
60// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61
64{}
65
66
67// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
68
69
72{
73 if (!meshMoverPtr_)
74 {
75 const word moverType(coeffDict().get<word>("meshMover"));
76
78 (
79 moverType,
80 coeffDict().optionalSubDict(moverType + "Coeffs"),
82 pointDisplacement_
83 );
84 }
85 return *meshMoverPtr_;
86}
87
88
91{
92 // Return actual points. Cannot do a reference since complains about
93 // assignment to self in polyMesh::movePoints
95}
96
97
99{
100 // The points have moved so before calculation update
101 // the mesh and motionSolver accordingly
102 movePoints(mesh().points());
103
104 // Update any point motion bcs (e.g. timevarying)
105 pointDisplacement().boundaryFieldRef().updateCoeffs();
106
107 label nAllowableErrors = 0;
108 labelList checkFaces(identity(mesh().nFaces()));
109 meshMover().move
110 (
111 coeffDict().optionalSubDict(meshMover().type() + "Coeffs"),
112 nAllowableErrors,
113 checkFaces
114 );
115
116 // This will have updated the mesh and implicitly the pointDisplacement
117 pointDisplacement().correctBoundaryConditions();
118}
119
120
122{
124
125 // Update meshMover for new geometry
126 if (meshMoverPtr_)
127 {
128 meshMover().movePoints(p);
129 }
130}
131
132
134(
135 const mapPolyMesh& map
136)
137{
139
140 // Update meshMover for new topology
141 meshMoverPtr_.clear();
142}
143
144
145// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh motion solver for an fvMesh. Uses externalDisplacementMeshMover to do the mesh motion.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
externalDisplacementMeshMover & meshMover() const
Virtual base class for displacement motion solver.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
void movePoints()
Update for new mesh geometry.
void updateMesh()
Update for new mesh topology.
Virtual base class for mesh motion solver.
Definition: motionSolver.H:61
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
volScalarField & p
dynamicFvMesh & mesh
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const pointField & points
Namespace for OpenFOAM.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
Definition: labelList.C:38
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
dictionary dict