Loading...
Searching...
No Matches
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-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
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
63class mapPolyMesh;
65/*---------------------------------------------------------------------------*\
66 Class laplacianMotionSolver Declaration
67\*---------------------------------------------------------------------------*/
68
69class laplacianMotionSolver
70:
71 public motionSolver,
72 public fvMotionSolver
74protected:
75
76 // Protected data
77
80
81 //- Interpolation used to transfer cell displacement to the points
83
84 //- Diffusivity used to control the motion
86
87 //- Number of laplacian iterations per solution step
88 label nIters_;
90 //- Residual threshold
91 scalar tolerance_;
92
93
94private:
95
96
97 // Private Member Functions
98
99 //- No copy construct
100 laplacianMotionSolver(const laplacianMotionSolver&) = delete;
101
102 //- No copy assignment
103 void operator=(const laplacianMotionSolver&) = delete;
104
105public:
106
107 //- Runtime type information
108 TypeName("laplacianMotionSolver");
109
110
111 // Constructors
112
113 //- Construct from mesh and dictionary
114 laplacianMotionSolver
115 (
116 const polyMesh& mesh,
118 );
119
120
121 //- Destructor
122 virtual ~laplacianMotionSolver() = default;
123
124
125 // Member Functions
126
127 //- Get const and non-const references to pointMotionU
129 inline const pointVectorField& pointMotionU() const;
130
131 //- Get const and non-const references to cellMotionU
132 inline volVectorField& cellMotionU();
133 inline const volVectorField& cellMotionU() const;
134
135 //- Return point location obtained from the current motion field
136 virtual tmp<pointField> curPoints() const;
137
138 //- Solve for motion
139 virtual void solve();
140
141 //- Set boundary conditions of cellMotionU based on pointMotionU.
142 // Avoiding the use of the cellMotionFvPatchField bc
143 // due to the use of the registry in order to grab pointMotionU, which
144 // may give problems if multiple objects of this class are constructed
145 // at the same time
147
148 //- Update local data for geometry changes
149 virtual void movePoints(const pointField&);
150
151 //- Update the mesh corresponding to given map
152 virtual void updateMesh(const mapPolyMesh&);
153};
154
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158} // End namespace Foam
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
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
fvMotionSolver(const polyMesh &)
Construct from polyMesh.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
autoPtr< motionDiffusivity > diffusivityPtr_
Diffusivity used to control the motion.
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.
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