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 -------------------------------------------------------------------------------
12 License
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 
29 Class
30  Foam::laplacianMotionSolver
31 
32 Description
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 
39 SourceFiles
40  laplacianMotionSolver.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef laplacianMotionSolver_H
45 #define laplacianMotionSolver_H
46 
47 #include "velocityMotionSolver.H"
48 #include "fvMotionSolver.H"
49 #include "volPointInterpolation.H"
50 #include "polyMesh.H"
51 #include "pointMesh.H"
52 #include "pointPatchField.H"
53 #include "pointPatchFieldsFwd.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 // Forward class declarations
61 class motionInterpolation;
62 class mapPolyMesh;
63 
64 /*---------------------------------------------------------------------------*\
65  Class laplacianMotionSolver Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
70  public motionSolver,
71  public fvMotionSolver
72 {
73 protected:
74 
75  // Protected data
76 
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
97  void setBoundaryConditions();
98 
99 
100 private:
101 
102 
103  // Private Member Functions
104 
105  //- No copy construct
107 
108  //- No copy assignment
109  void operator=(const laplacianMotionSolver&) = delete;
110 
111 public:
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
134  inline pointVectorField& 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 
161 #include "laplacianMotionSolverI.H"
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::laplacianMotionSolver::curPoints
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Definition: laplacianMotionSolver.C:124
Foam::laplacianMotionSolver
Similar to velocityLaplacian but iteratively solves the mesh displacement PDEs to account for non-ort...
Definition: laplacianMotionSolver.H:67
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
pointPatchField.H
Foam::laplacianMotionSolver::cellMotionU
volVectorField & cellMotionU()
Get const and non-const references to cellMotionU.
Definition: laplacianMotionSolverI.H:45
Foam::laplacianMotionSolver::cellMotionU_
volVectorField cellMotionU_
Definition: laplacianMotionSolver.H:77
Foam::laplacianMotionSolver::nIters_
label nIters_
Number of laplacian iterations per solution step.
Definition: laplacianMotionSolver.H:83
Foam::laplacianMotionSolver::TypeName
TypeName("laplacianMotionSolver")
Runtime type information.
Foam::laplacianMotionSolver::interpolationPtr_
autoPtr< motionInterpolation > interpolationPtr_
Interpolation used to transfer cell displacement to the points.
Definition: laplacianMotionSolver.H:80
polyMesh.H
pointPatchFieldsFwd.H
velocityMotionSolver.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::fvMotionSolver
Base class for fvMesh based motionSolvers.
Definition: fvMotionSolver.H:50
Foam::laplacianMotionSolver::solve
virtual void solve()
Solve for motion.
Definition: laplacianMotionSolver.C:143
Foam::laplacianMotionSolver::pointMotionU
pointVectorField & pointMotionU()
Get const and non-const references to pointMotionU.
Definition: laplacianMotionSolverI.H:32
Foam::Field< vector >
Foam::laplacianMotionSolver::~laplacianMotionSolver
virtual ~laplacianMotionSolver()=default
Destructor.
Foam::laplacianMotionSolver::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update the mesh corresponding to given map.
Definition: laplacianMotionSolver.C:178
dict
dictionary dict
Definition: searchingEngine.H:14
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laplacianMotionSolver::pointMotionU_
pointVectorField pointMotionU_
Definition: laplacianMotionSolver.H:76
volPointInterpolation.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::laplacianMotionSolver::setBoundaryConditions
void setBoundaryConditions()
Set boundary conditions of cellMotionU based on pointMotionU.
Definition: laplacianMotionSolver.C:52
Foam::motionSolver
Virtual base class for mesh motion solver.
Definition: motionSolver.H:58
fvMotionSolver.H
laplacianMotionSolverI.H
Foam::motionSolver::mesh
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:144
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::laplacianMotionSolver::tolerance_
scalar tolerance_
Residual threshold.
Definition: laplacianMotionSolver.H:86
Foam::GeometricField< vector, pointPatchField, pointMesh >
Foam::laplacianMotionSolver::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: laplacianMotionSolver.C:172
pointMesh.H