FreeFOAM The Cross-Platform CFD Toolkit
displacementComponentLaplacianFvMotionSolver.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::displacementComponentLaplacianFvMotionSolver
26 
27 Description
28  Mesh motion solver for an fvMesh. Based on solving the cell-centre
29  Laplacian for the given component of the motion displacement.
30 
31 SourceFiles
32  displacementComponentLaplacianFvMotionSolver.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef displacementComponentLaplacianFvMotionSolver_H
37 #define displacementComponentLaplacianFvMotionSolver_H
38 
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward class declarations
47 class motionDiffusivity;
48 
49 /*---------------------------------------------------------------------------*\
50  Class displacementComponentLaplacianFvMotionSolver Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public fvMotionSolver
56 {
57  // Private data
58 
59  //- The component name to solve for
60  word cmptName_;
61 
62  //- The component to solve for
63  direction cmpt_;
64 
65  //- Reference point field for this component
66  scalarField points0_;
67 
68  //- Point motion field
69  mutable pointScalarField pointDisplacement_;
70 
71  //- Cell-centre motion field
72  mutable volScalarField cellDisplacement_;
73 
74  //- Optionally read point-position field. Used only for position
75  // boundary conditions.
76  mutable autoPtr<pointVectorField> pointLocation_;
77 
78  //- Diffusivity used to control the motion
79  autoPtr<motionDiffusivity> diffusivityPtr_;
80 
81  //- Frozen points (that are not on patches). -1 or points that are
82  // fixed to be at points0_ location
83  label frozenPointsZone_;
84 
85 
86  // Private Member Functions
87 
88  //- Disallow default bitwise copy construct
90  (
92  );
93 
94  //- Disallow default bitwise assignment
95  void operator=(const displacementComponentLaplacianFvMotionSolver&);
96 
97  //- Return the component corresponding to the given component name
98  direction cmpt(const word& cmptName) const;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("displacementComponentLaplacian");
105 
106 
107  // Constructors
108 
109  //- Construct from polyMesh and data stream
111  (
112  const polyMesh&,
113  Istream& msData
114  );
115 
116 
117  // Destructor
118 
120 
121 
122  // Member Functions
123 
124  //- Return reference to the reference field
125  const scalarField& points0() const
126  {
127  return points0_;
128  }
129 
130  //- Non-const access to the cellDisplacement in order to allow
131  // changes to the boundary motion
133  {
134  return cellDisplacement_;
135  }
136 
137  //- Return point location obtained from the current motion field
138  virtual tmp<pointField> curPoints() const;
139 
140  //- Solve for motion
141  virtual void solve();
142 
143  //- Update topology
144  virtual void updateMesh(const mapPolyMesh&);
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************ vim: set sw=4 sts=4 et: ************************ //