Loading...
Searching...
No Matches
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-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 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
64class mapPolyMesh;
66/*---------------------------------------------------------------------------*\
67 Class elasticityMotionSolver Declaration
68\*---------------------------------------------------------------------------*/
69
70class elasticityMotionSolver
71:
72 public motionSolver
73{
74protected:
75
76 // Protected data
77
78 //- Since the mesh deformation is broken down to multiple steps,
79 //- mesh points need to be moved here.
80 //- Hence, the non-const mesh reference
84
85 //- Interpolation used to transfer cell displacement to the points
87
88 //- Diffusivity used to control the motion
91 //- Intermediate steps to solve the PDEs
92 label nSteps_;
93
94 //- Number of laplacian iterations per solution step
95 label nIters_;
96
97 //- Residual threshold
98 scalar tolerance_;
99
101 // Protected Member Functions
102
103 //- Set boundary conditions of cellMotionU based on pointMotionU.
104 // Avoiding the use of the cellMotionFvPatchField bc
105 // due to the use of the registry in order to grab pointMotionU, which
106 // may give problems if multiple objects of this class are constructed
107 // at the same time
109
110
111private:
112
113 // Private Member Functions
114
115 //- No copy construct
116 elasticityMotionSolver(const elasticityMotionSolver&) = delete;
117
118 //- No copy assignment
119 void operator=(const elasticityMotionSolver&) = delete;
120
121
122public:
123
124 //- Runtime type information
125 TypeName("elasticityMotionSolver");
126
127
128 // Constructors
129
130 //- Construct from mesh and dictionary
131 elasticityMotionSolver
132 (
133 const polyMesh& mesh,
134 const IOdictionary& dict
135 );
136
137
138 //- Destructor
139 virtual ~elasticityMotionSolver() = default;
140
142 // Member Functions
143
144 //- Get const and non-const references to pointMotionU
146 inline const pointVectorField& pointMotionU() const;
147
148 //- Get const and non-const references to cellMotionU
149 inline volVectorField& cellMotionU();
150 inline const volVectorField& cellMotionU() const;
151
152 //- Return point location. Mesh is actually moved in solve()
153 virtual tmp<pointField> curPoints() const;
154
155 //- Solve for motion.
156 // Does the actual mesh displacement here, since it is broken down
157 // into multiple steps
158 virtual void solve();
160 //- Update local data for geometry changes
161 virtual void movePoints(const pointField&);
162
163 //- Update the mesh corresponding to given map
164 virtual void updateMesh(const mapPolyMesh&);
165};
166
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace Foam
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#endif
179
180// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual tmp< pointField > curPoints() const
Return point location. Mesh is actually moved in solve().
autoPtr< motionDiffusivity > diffusivityPtr_
Diffusivity used to control the motion.
label nSteps_
Intermediate steps to solve the PDEs.
scalar tolerance_
Residual threshold.
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.
fvMesh & fvMesh_
Since the mesh deformation is broken down to multiple steps, mesh points need to be moved here....
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:85
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Abstract base class for cell-centre mesh motion diffusivity.
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
const polyMesh & mesh() const
Return reference to mesh.
motionSolver(const polyMesh &mesh)
Construct from polyMesh.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
vectorField pointField
pointField is a vectorField.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68