initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / fvMotionSolver / fvMotionSolvers / displacement / componentLaplacian / displacementComponentLaplacianFvMotionSolver.H
blobe00cb575c841f89919f302de3e956ed374642d08
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::displacementComponentLaplacianFvMotionSolver
28 Description
29     Mesh motion solver for an fvMesh.  Based on solving the cell-centre
30     Laplacian for the given component of the motion displacement.
32 SourceFiles
33     displacementComponentLaplacianFvMotionSolver.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef displacementComponentLaplacianFvMotionSolver_H
38 #define displacementComponentLaplacianFvMotionSolver_H
40 #include "fvMotionSolver.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 // Forward class declarations
48 class motionDiffusivity;
50 /*---------------------------------------------------------------------------*\
51         Class displacementComponentLaplacianFvMotionSolver Declaration
52 \*---------------------------------------------------------------------------*/
54 class displacementComponentLaplacianFvMotionSolver
56     public fvMotionSolver
58     // Private data
60         //- The component name to solve for
61         word cmptName_;
63         //- The component to solve for
64         direction cmpt_;
66         //- Reference point field for this component
67         scalarField points0_;
69         //- Point motion field
70         mutable pointScalarField pointDisplacement_;
72         //- Cell-centre motion field
73         mutable volScalarField cellDisplacement_;
75         //- Optionally read point-position field. Used only for position
76         //  boundary conditions.
77         mutable autoPtr<pointVectorField> pointLocation_;
79         //- Diffusivity used to control the motion
80         autoPtr<motionDiffusivity> diffusivityPtr_;
82         //- Frozen points (that are not on patches). -1 or points that are
83         //  fixed to be at points0_ location
84         label frozenPointsZone_;
87     // Private Member Functions
89         //- Disallow default bitwise copy construct
90         displacementComponentLaplacianFvMotionSolver
91         (
92             const displacementComponentLaplacianFvMotionSolver&
93         );
95         //- Disallow default bitwise assignment
96         void operator=(const displacementComponentLaplacianFvMotionSolver&);
98         //- Return the component corresponding to the given component name
99         direction cmpt(const word& cmptName) const;
102 public:
104     //- Runtime type information
105     TypeName("displacementComponentLaplacian");
108     // Constructors
110         //- Construct from polyMesh and data stream
111         displacementComponentLaplacianFvMotionSolver
112         (
113             const polyMesh&,
114             Istream& msData
115         );
118     // Destructor
120         ~displacementComponentLaplacianFvMotionSolver();
123     // Member Functions
125         //- Return reference to the reference field
126         const scalarField& points0() const
127         {
128             return points0_;
129         }
131         //- Non-const access to the cellDisplacement in order to allow
132         //  changes to the boundary motion
133         volScalarField& cellDisplacement()
134         {
135             return cellDisplacement_;
136         }
138         //- Return point location obtained from the current motion field
139         virtual tmp<pointField> curPoints() const;
141         //- Solve for motion
142         virtual void solve();
144         //- Update topology
145         virtual void updateMesh(const mapPolyMesh&);
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 #endif
157 // ************************************************************************* //