1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::displacementLaplacianFvMotionSolver
28 Mesh motion solver for an fvMesh. Based on solving the cell-centre
29 Laplacian for the motion displacement.
32 displacementLaplacianFvMotionSolver.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef displacementLaplacianFvMotionSolver_H
37 #define displacementLaplacianFvMotionSolver_H
39 #include "displacementFvMotionSolver.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward class declarations
47 class motionDiffusivity;
49 /*---------------------------------------------------------------------------*\
50 Class displacementLaplacianFvMotionSolver Declaration
51 \*---------------------------------------------------------------------------*/
53 class displacementLaplacianFvMotionSolver
55 public displacementFvMotionSolver
59 //- Point motion field
60 mutable pointVectorField pointDisplacement_;
62 //- Cell-centre motion field
63 mutable volVectorField cellDisplacement_;
65 //- Optionally read point-position field. Used only for position
66 // boundary conditions.
67 mutable autoPtr<pointVectorField> pointLocation_;
69 //- Diffusivity used to control the motion
70 autoPtr<motionDiffusivity> diffusivityPtr_;
72 //- Frozen points (that are not on patches). -1 or points that are
73 // fixed to be at points0_ location
74 label frozenPointsZone_;
77 // Private Member Functions
79 //- Disallow default bitwise copy construct
80 displacementLaplacianFvMotionSolver
82 const displacementLaplacianFvMotionSolver&
85 //- Disallow default bitwise assignment
86 void operator=(const displacementLaplacianFvMotionSolver&);
91 //- Runtime type information
92 TypeName("displacementLaplacian");
97 //- Construct from polyMesh and data stream
98 displacementLaplacianFvMotionSolver
101 Istream& msDataUnused
106 ~displacementLaplacianFvMotionSolver();
111 //- Return reference to the point motion displacement field
112 pointVectorField& pointDisplacement()
114 return pointDisplacement_;
117 //- Return const reference to the point motion displacement field
118 const pointVectorField& pointDisplacement() const
120 return pointDisplacement_;
123 //- Return reference to the cell motion displacement field
124 volVectorField& cellDisplacement()
126 return cellDisplacement_;
129 //- Return const reference to the cell motion displacement field
130 const volVectorField& cellDisplacement() const
132 return cellDisplacement_;
135 //- Return const reference to the diffusivity
136 const motionDiffusivity& diffusivity() const
138 return diffusivityPtr_();
141 //- Return reference to the diffusivity
142 motionDiffusivity& diffusivity()
144 return diffusivityPtr_();
147 //- Return point location obtained from the current motion field
148 virtual tmp<pointField> curPoints() const;
151 virtual void solve();
154 virtual void updateMesh(const mapPolyMesh&);
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //