FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::displacementComponentLaplacianFvMotionSolver
00026 
00027 Description
00028     Mesh motion solver for an fvMesh.  Based on solving the cell-centre
00029     Laplacian for the given component of the motion displacement.
00030 
00031 SourceFiles
00032     displacementComponentLaplacianFvMotionSolver.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef displacementComponentLaplacianFvMotionSolver_H
00037 #define displacementComponentLaplacianFvMotionSolver_H
00038 
00039 #include <fvMotionSolvers/fvMotionSolver.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward class declarations
00047 class motionDiffusivity;
00048 
00049 /*---------------------------------------------------------------------------*\
00050         Class displacementComponentLaplacianFvMotionSolver Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class displacementComponentLaplacianFvMotionSolver
00054 :
00055     public fvMotionSolver
00056 {
00057     // Private data
00058 
00059         //- The component name to solve for
00060         word cmptName_;
00061 
00062         //- The component to solve for
00063         direction cmpt_;
00064 
00065         //- Reference point field for this component
00066         scalarField points0_;
00067 
00068         //- Point motion field
00069         mutable pointScalarField pointDisplacement_;
00070 
00071         //- Cell-centre motion field
00072         mutable volScalarField cellDisplacement_;
00073 
00074         //- Optionally read point-position field. Used only for position
00075         //  boundary conditions.
00076         mutable autoPtr<pointVectorField> pointLocation_;
00077 
00078         //- Diffusivity used to control the motion
00079         autoPtr<motionDiffusivity> diffusivityPtr_;
00080 
00081         //- Frozen points (that are not on patches). -1 or points that are
00082         //  fixed to be at points0_ location
00083         label frozenPointsZone_;
00084 
00085 
00086     // Private Member Functions
00087 
00088         //- Disallow default bitwise copy construct
00089         displacementComponentLaplacianFvMotionSolver
00090         (
00091             const displacementComponentLaplacianFvMotionSolver&
00092         );
00093 
00094         //- Disallow default bitwise assignment
00095         void operator=(const displacementComponentLaplacianFvMotionSolver&);
00096 
00097         //- Return the component corresponding to the given component name
00098         direction cmpt(const word& cmptName) const;
00099 
00100 
00101 public:
00102 
00103     //- Runtime type information
00104     TypeName("displacementComponentLaplacian");
00105 
00106 
00107     // Constructors
00108 
00109         //- Construct from polyMesh and data stream
00110         displacementComponentLaplacianFvMotionSolver
00111         (
00112             const polyMesh&,
00113             Istream& msData
00114         );
00115 
00116 
00117     // Destructor
00118 
00119         ~displacementComponentLaplacianFvMotionSolver();
00120 
00121 
00122     // Member Functions
00123 
00124         //- Return reference to the reference field
00125         const scalarField& points0() const
00126         {
00127             return points0_;
00128         }
00129 
00130         //- Non-const access to the cellDisplacement in order to allow
00131         //  changes to the boundary motion
00132         volScalarField& cellDisplacement()
00133         {
00134             return cellDisplacement_;
00135         }
00136 
00137         //- Return point location obtained from the current motion field
00138         virtual tmp<pointField> curPoints() const;
00139 
00140         //- Solve for motion
00141         virtual void solve();
00142 
00143         //- Update topology
00144         virtual void updateMesh(const mapPolyMesh&);
00145 };
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 } // End namespace Foam
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 #endif
00155 
00156 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines