laplacianMotionSolver.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
28
29Class
30 Foam::laplacianMotionSolver
31
32Description
33 Similar to velocityLaplacian but iteratively solves the mesh displacement
34 PDEs to account for non-orthogonality.
35 The boundary displacement is set as a boundary condition
36 on pointMotionU; the latter is generated automatically if not found.
37 Assumes uniform diffusivity
38
39SourceFiles
40 laplacianMotionSolver.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef laplacianMotionSolver_H
45#define laplacianMotionSolver_H
46
48#include "fvMotionSolver.H"
50#include "polyMesh.H"
51#include "pointMesh.H"
52#include "pointPatchField.H"
53#include "pointPatchFieldsFwd.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60// Forward class declarations
61class motionInterpolation;
62class mapPolyMesh;
63
64/*---------------------------------------------------------------------------*\
65 Class laplacianMotionSolver Declaration
66\*---------------------------------------------------------------------------*/
69:
70 public motionSolver,
71 public fvMotionSolver
72{
73protected:
74
75 // Protected data
79
80 //- Interpolation used to transfer cell displacement to the points
82
83 //- Number of laplacian iterations per solution step
84 label nIters_;
85
86 //- Residual threshold
87 scalar tolerance_;
88
89
90 // Protected Member Functions
91
92 //- Set boundary conditions of cellMotionU based on pointMotionU.
93 // Avoiding the use of the cellMotionFvPatchField bc
94 // due to the use of the registry in order to grab pointMotionU, which
95 // may give problems if multiple objects of this class are constructed
96 // at the same time
98
99
100private:
101
102
103 // Private Member Functions
104
105 //- No copy construct
107
108 //- No copy assignment
109 void operator=(const laplacianMotionSolver&) = delete;
110
111public:
112
113 //- Runtime type information
114 TypeName("laplacianMotionSolver");
115
116
117 // Constructors
118
119 //- Construct from mesh and dictionary
121 (
122 const polyMesh& mesh,
123 const IOdictionary& dict
124 );
125
126
127 //- Destructor
128 virtual ~laplacianMotionSolver() = default;
129
130
131 // Member Functions
132
133 //- Get const and non-const references to pointMotionU
135 inline const pointVectorField& pointMotionU() const;
136
137 //- Get const and non-const references to cellMotionU
138 inline volVectorField& cellMotionU();
139 inline const volVectorField& cellMotionU() const;
140
141 //- Return point location obtained from the current motion field
142 virtual tmp<pointField> curPoints() const;
143
144 //- Solve for motion
145 virtual void solve();
146
147 //- Update local data for geometry changes
148 virtual void movePoints(const pointField&);
149
150 //- Update the mesh corresponding to given map
151 virtual void updateMesh(const mapPolyMesh&);
152};
153
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157} // End namespace Foam
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
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
Base class for fvMesh based motionSolvers.
Similar to velocityLaplacian but iteratively solves the mesh displacement PDEs to account for non-ort...
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
scalar tolerance_
Residual threshold.
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 void updateMesh(const mapPolyMesh &)
Update the mesh corresponding to given map.
virtual ~laplacianMotionSolver()=default
Destructor.
TypeName("laplacianMotionSolver")
Runtime type information.
virtual void solve()
Solve for motion.
pointVectorField & pointMotionU()
Get const and non-const references to pointMotionU.
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