displacementLinearMotionMotionSolver.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
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::displacementLinearMotionMotionSolver
26 
27 Description
28  Mesh motion solver simple linear expansion and contraction of a mesh
29  region defined by a motion axis and the extents of the motion.
30 
31  Example:
32  \verbatim
33  mover motionSolver;
34 
35  libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
36 
37  motionSolver displacementLinearMotion;
38 
39  axis (0 1 0);
40  xFixed 0.8;
41  xMoving 0;
42  displacement table
43  (
44  (0 0)
45  (4 0.7)
46  );
47  \endverbatim
48 
49  This mesh is compressed between \c xFixed and \c xMoving in the direction
50  \c axis between time 0 and 4 with a maximum displacement of 0.7.
51  The mesh beyond \c xFixed is fixed and beyond \c xMoving moves with maximum
52  displacement.
53 
54 SourceFiles
55  displacementLinearMotionMotionSolver.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef displacementLinearMotionMotionSolver_H
60 #define displacementLinearMotionMotionSolver_H
61 
62 #include "points0MotionSolver.H"
63 #include "Function1.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class displacementLinearMotionMotionSolver Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public points0MotionSolver
77 {
78  // Private Data
79 
80  //- Axis of the linear motion
81  vector axis_;
82 
83  //- The location of the end of motion
84  scalar xFixed_;
85 
86  //- The location moving with the specified displacement
87  scalar xMoving_;
88 
89  //- The displacement as a function of time
90  autoPtr<Function1<scalar>> displacement_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("displacementLinearMotion");
97 
98 
99  // Constructors
100 
101  //- Construct from polyMesh and dictionary
103  (
104  const word& name,
105  const polyMesh&,
106  const dictionary&
107  );
108 
109  //- Disallow default bitwise copy construction
111  (
113  ) = delete;
114 
115 
116  //- Destructor
118 
119 
120  // Member Functions
121 
122  //- Return point location obtained from the current motion field
123  virtual tmp<pointField> curPoints() const;
124 
125  //- Solve for motion
126  virtual void solve()
127  {}
128 
129 
130  // Member Operators
131 
132  //- Disallow default bitwise assignment
133  void operator=(const displacementLinearMotionMotionSolver&) = delete;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh motion solver simple linear expansion and contraction of a mesh region defined by a motion axis ...
TypeName("displacementLinearMotion")
Runtime type information.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
displacementLinearMotionMotionSolver(const word &name, const polyMesh &, const dictionary &)
Construct from polyMesh and dictionary.
void operator=(const displacementLinearMotionMotionSolver &)=delete
Disallow default bitwise assignment.
const word & name() const
Return name.
Definition: motionSolver.H:125
Virtual base class for displacement motion solvers.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.