displacementLaplacianFvMotionSolver.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) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::displacementLaplacianFvMotionSolver
28 
29 Group
30  grpMeshMotionSolvers
31 
32 Description
33  Mesh motion solver for an fvMesh. Based on solving the cell-centre
34  Laplacian for the motion displacement.
35 
36 SourceFiles
37  displacementLaplacianFvMotionSolver.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef displacementLaplacianFvMotionSolver_H
42 #define displacementLaplacianFvMotionSolver_H
43 
45 #include "fvMotionSolver.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward class declarations
53 class motionInterpolation;
54 class motionDiffusivity;
55 
56 /*---------------------------------------------------------------------------*\
57  Class displacementLaplacianFvMotionSolver Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
63  public fvMotionSolver
64 {
65  // Private data
66 
67  //- Cell-centre motion field
68  mutable volVectorField cellDisplacement_;
69 
70  //- Optionally read point-position field. Used only for position
71  // boundary conditions.
72  mutable autoPtr<pointVectorField> pointLocation_;
73 
74  //- Interpolation used to transfer cell displacement to the points
75  autoPtr<motionInterpolation> interpolationPtr_;
76 
77  //- Diffusivity used to control the motion
78  autoPtr<motionDiffusivity> diffusivityPtr_;
79 
80  //- Frozen points (that are not on patches). -1 or points that are
81  // fixed to be at points0_ location
82  label frozenPointsZone_;
83 
84 
85  // Private Member Functions
86 
87  //- No copy construct
89  (
91  ) = delete;
92 
93  //- No copy assignment
94  void operator=(const displacementLaplacianFvMotionSolver&) = delete;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("displacementLaplacian");
101 
102 
103  // Constructors
104 
105  //- Construct from polyMesh and IOdictionary
107  (
108  const polyMesh&,
109  const IOdictionary&
110  );
111 
112  //- Construct from components
114  (
115  const polyMesh& mesh,
116  const IOdictionary& dict,
118  const pointIOField& points0
119  );
120 
121 
122  //- Destructor
124 
125 
126  // Member Functions
127 
128  //- Return reference to the cell motion displacement field
130  {
131  return cellDisplacement_;
132  }
133 
134  //- Return const reference to the cell motion displacement field
135  const volVectorField& cellDisplacement() const
136  {
137  return cellDisplacement_;
138  }
139 
140  //- Return reference to the diffusivity field
142 
143  //- Return point location obtained from the current motion field
144  virtual tmp<pointField> curPoints() const;
145 
146  //- Solve for motion
147  virtual void solve();
148 
149  //- Update topology
150  virtual void updateMesh(const mapPolyMesh&);
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
Foam::displacementLaplacianFvMotionSolver::~displacementLaplacianFvMotionSolver
~displacementLaplacianFvMotionSolver()
Destructor.
Definition: displacementLaplacianFvMotionSolver.C:239
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::IOField
A primitive field of type <T> with automated input and output.
Definition: foamVtkLagrangianWriter.H:61
Foam::displacementLaplacianFvMotionSolver::solve
virtual void solve()
Solve for motion.
Definition: displacementLaplacianFvMotionSolver.C:327
Foam::displacementMotionSolver::pointDisplacement
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
Definition: displacementMotionSolver.H:141
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::motionDiffusivity
Abstract base class for cell-centre mesh motion diffusivity.
Definition: motionDiffusivity.H:51
Foam::displacementLaplacianFvMotionSolver::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update topology.
Definition: displacementLaplacianFvMotionSolver.C:360
Foam::displacementLaplacianFvMotionSolver::diffusivity
motionDiffusivity & diffusivity()
Return reference to the diffusivity field.
Definition: displacementLaplacianFvMotionSolver.C:246
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::displacementLaplacianFvMotionSolver::TypeName
TypeName("displacementLaplacian")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::displacementMotionSolver
Virtual base class for displacement motion solver.
Definition: displacementMotionSolver.H:53
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
displacementMotionSolver.H
Foam::displacementLaplacianFvMotionSolver::curPoints
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Definition: displacementLaplacianFvMotionSolver.C:262
Foam::points0MotionSolver::points0
pointField & points0()
Return reference to the reference field.
Definition: points0MotionSolver.H:117
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
fvMotionSolver.H
Foam::displacementLaplacianFvMotionSolver::cellDisplacement
volVectorField & cellDisplacement()
Return reference to the cell motion displacement field.
Definition: displacementLaplacianFvMotionSolver.H:128
Foam::displacementLaplacianFvMotionSolver
Mesh motion solver for an fvMesh. Based on solving the cell-centre Laplacian for the motion displacem...
Definition: displacementLaplacianFvMotionSolver.H:59
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::fvMotionSolver::mesh
const fvMesh & mesh() const
Return reference to the fvMesh to be moved.
Definition: fvMotionSolver.H:86
Foam::displacementLaplacianFvMotionSolver::cellDisplacement
const volVectorField & cellDisplacement() const
Return const reference to the cell motion displacement field.
Definition: displacementLaplacianFvMotionSolver.H:134