OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

displacementComponentLaplacianFvMotionSolver.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::displacementComponentLaplacianFvMotionSolver
00027 
00028 Description
00029     Mesh motion solver for an fvMesh.  Based on solving the cell-centre
00030     Laplacian for the given component of the motion displacement.
00031 
00032 SourceFiles
00033     displacementComponentLaplacianFvMotionSolver.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef displacementComponentLaplacianFvMotionSolver_H
00038 #define displacementComponentLaplacianFvMotionSolver_H
00039 
00040 #include "fvMotionSolver.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // Forward class declarations
00048 class motionDiffusivity;
00049 
00050 /*---------------------------------------------------------------------------*\
00051         Class displacementComponentLaplacianFvMotionSolver Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class displacementComponentLaplacianFvMotionSolver
00055 :
00056     public fvMotionSolver
00057 {
00058     // Private data
00059 
00060         //- The component name to solve for
00061         word cmptName_;
00062 
00063         //- The component to solve for
00064         direction cmpt_;
00065 
00066         //- Reference point field for this component
00067         scalarField points0_;
00068 
00069         //- Point motion field
00070         mutable pointScalarField pointDisplacement_;
00071 
00072         //- Cell-centre motion field
00073         mutable volScalarField cellDisplacement_;
00074 
00075         //- Optionally read point-position field. Used only for position
00076         //  boundary conditions.
00077         mutable autoPtr<pointVectorField> pointLocation_;
00078 
00079         //- Diffusivity used to control the motion
00080         autoPtr<motionDiffusivity> diffusivityPtr_;
00081 
00082         //- Frozen points (that are not on patches). -1 or points that are
00083         //  fixed to be at points0_ location
00084         label frozenPointsZone_;
00085 
00086 
00087     // Private Member Functions
00088 
00089         //- Disallow default bitwise copy construct
00090         displacementComponentLaplacianFvMotionSolver
00091         (
00092             const displacementComponentLaplacianFvMotionSolver&
00093         );
00094 
00095         //- Disallow default bitwise assignment
00096         void operator=(const displacementComponentLaplacianFvMotionSolver&);
00097 
00098         //- Return the component corresponding to the given component name
00099         direction cmpt(const word& cmptName) const;
00100 
00101 
00102 public:
00103 
00104     //- Runtime type information
00105     TypeName("displacementComponentLaplacian");
00106 
00107 
00108     // Constructors
00109 
00110         //- Construct from polyMesh and data stream
00111         displacementComponentLaplacianFvMotionSolver
00112         (
00113             const polyMesh&,
00114             Istream& msData
00115         );
00116 
00117 
00118     // Destructor
00119 
00120         ~displacementComponentLaplacianFvMotionSolver();
00121 
00122 
00123     // Member Functions
00124 
00125         //- Return reference to the reference field
00126         const scalarField& points0() const
00127         {
00128             return points0_;
00129         }
00130 
00131         //- Non-const access to the cellDisplacement in order to allow
00132         //  changes to the boundary motion
00133         volScalarField& cellDisplacement()
00134         {
00135             return cellDisplacement_;
00136         }
00137 
00138         //- Return point location obtained from the current motion field
00139         virtual tmp<pointField> curPoints() const;
00140 
00141         //- Solve for motion
00142         virtual void solve();
00143 
00144         //- Update topology
00145         virtual void updateMesh(const mapPolyMesh&);
00146 };
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 #endif
00156 
00157 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd