elasticityMotionSolver.H
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) 2007-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28Class
29 Foam::elasticityMotionSolver
30
31Description
32 Mesh deformation based on the linear elasticity equations.
33 The boundary displacement is set as a boundary condition
34 on the pointMotionU field.
35
36 Reference:
37 \verbatim
38 Dwight, R. P., (2009).
39 Robust Mesh Deformation using the Linear Elasticity Equations.
40 Computational Fluid Dynamics 2006, 401-406.
41 Springer Berlin Heidelberg.
42 \endverbatim
43
44SourceFiles
45 elasticityMotionSolver.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef elasticityMotionSolver_H
50#define elasticityMotionSolver_H
51
52#include "motionSolver.H"
53#include "volFields.H"
54#include "pointFields.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
60
61// Forward class declarations
62class motionInterpolation;
63class mapPolyMesh;
64
65/*---------------------------------------------------------------------------*\
66 Class elasticityMotionSolver Declaration
67\*---------------------------------------------------------------------------*/
70:
71 public motionSolver
72{
73protected:
74
75 // Protected data
76
77 //- Since the mesh deformation is broken down to multiple steps,
78 //- mesh points need to be moved here.
79 //- Hence, the non-const mesh reference
83
84 //- Interpolation used to transfer cell displacement to the points
86
87 //- Inverse cell volume diffusivity
89
90 //- Exponent to stiffen highly morphed cells
91 scalar exponent_;
92
93 //- Intermediate steps to solve the PDEs
94 label nSteps_;
95
96 //- Number of laplacian iterations per solution step
97 label nIters_;
98
99 //- Residual threshold
100 scalar tolerance_;
101
102
103 // Protected Member Functions
104
105 //- Set boundary conditions of cellMotionU based on pointMotionU.
106 // Avoiding the use of the cellMotionFvPatchField bc
107 // due to the use of the registry in order to grab pointMotionU, which
108 // may give problems if multiple objects of this class are constructed
109 // at the same time
111
112
113private:
114
115 // Private Member Functions
116
117 //- No copy construct
119
120 //- No copy assignment
121 void operator=(const elasticityMotionSolver&) = delete;
122
123
124public:
125
126 //- Runtime type information
127 TypeName("elasticityMotionSolver");
128
129
130 // Constructors
131
132 //- Construct from mesh and dictionary
134 (
135 const polyMesh& mesh,
136 const IOdictionary& dict
137 );
138
139
140 //- Destructor
141 virtual ~elasticityMotionSolver() = default;
142
143
144 // Member Functions
145
146 //- Get const and non-const references to pointMotionU
148 inline const pointVectorField& pointMotionU() const;
149
150 //- Get const and non-const references to cellMotionU
151 inline volVectorField& cellMotionU();
152 inline const volVectorField& cellMotionU() const;
153
154 //- Return point location. Mesh is actually moved in solve()
155 virtual tmp<pointField> curPoints() const;
156
157 //- Solve for motion.
158 // Does the actual mesh displacement here, since it is broken down
159 // into multiple steps
160 virtual void solve();
161
162 //- Update local data for geometry changes
163 virtual void movePoints(const pointField&);
164
165 //- Update the mesh corresponding to given map
166 virtual void updateMesh(const mapPolyMesh&);
167};
168
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172} // End namespace Foam
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#endif
181
182// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Mesh deformation based on the linear elasticity equations. The boundary displacement is set as a boun...
scalar exponent_
Exponent to stiffen highly morphed cells.
virtual tmp< pointField > curPoints() const
Return point location. Mesh is actually moved in solve()
label nSteps_
Intermediate steps to solve the PDEs.
scalar tolerance_
Residual threshold.
volScalarField E_
Inverse cell volume diffusivity.
TypeName("elasticityMotionSolver")
Runtime type information.
label nIters_
Number of laplacian iterations per solution step.
void setBoundaryConditions()
Set boundary conditions of cellMotionU based on pointMotionU.
volVectorField & cellMotionU()
Get const and non-const references to cellMotionU.
autoPtr< motionInterpolation > interpolationPtr_
Interpolation used to transfer cell displacement to the points.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual ~elasticityMotionSolver()=default
Destructor.
virtual void updateMesh(const mapPolyMesh &)
Update the mesh corresponding to given map.
virtual void solve()
Solve for motion.
pointVectorField & pointMotionU()
Get const and non-const references to pointMotionU.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Virtual base class for mesh motion solver.
Definition: motionSolver.H:61
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:144
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73