fvMeshTopoChangersMovingCone.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) 2011-2022 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::fvMeshTopoChangers::movingCone
26 
27 Description
28  Sample fvMeshTopoChanger that moves an object in x direction and
29  introduces/removes layers.
30 
31 SourceFiles
32  fvMeshTopoChangersMovingCone.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef fvMeshTopoChangersMovingCone_H
37 #define fvMeshTopoChangersMovingCone_H
38 
39 #include "fvMeshTopoChanger.H"
40 #include "polyTopoChanger.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace fvMeshTopoChangers
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class movingCone Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class movingCone
54 :
55  public fvMeshTopoChanger
56 {
57  // Private Data
58 
59  polyTopoChanger topoChanger_;
60 
61  //- Motion dictionary
62  dictionary motionDict_;
63 
64  //- Motion velocity amplitude
65  vector motionVelAmplitude_;
66 
67  //- Motion velocity period
68  scalar motionVelPeriod_;
69 
70  //- Motion velocity period
71  vector curMotionVel_;
72 
73  //- Left edge
74  scalar leftEdge_;
75 
76  //- Current left obstacle position
77  scalar curLeft_;
78 
79  //- Current right obstacle position
80  scalar curRight_;
81 
82  //- Vertex motion mask
83  scalarField motionMask_;
84 
85 
86  // Private Member Functions
87 
88  //- Add mixer zones and modifiers
89  void addZonesAndModifiers();
90 
91  //- Markup motion vertices
92  tmp<scalarField> vertexMarkup
93  (
94  const pointField& p,
95  const scalar curLeft,
96  const scalar curRight
97  ) const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("movingCone");
104 
105 
106  // Constructors
107 
108  //- Construct from fvMesh and dictionary
110 
111  //- Disallow default bitwise copy construction
112  movingCone(const movingCone&) = delete;
113 
114 
115  //- Destructor
116  virtual ~movingCone();
117 
118 
119  // Member Functions
120 
121  //- Update the mesh for both mesh motion and topology change
122  virtual bool update();
123 
124  //- Update corresponding to the given map
125  virtual void topoChange(const polyTopoChangeMap&);
126 
127  //- Update from another mesh using the given map
128  virtual void mapMesh(const polyMeshMap&);
129 
130  //- Update corresponding to the given distribution map
131  virtual void distribute(const polyDistributionMap&);
132 
133 
134  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const movingCone&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace fvMeshTopoChangers
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Abstract base class for fvMesh topology changers.
fvMesh & mesh()
Return the fvMesh.
Sample fvMeshTopoChanger that moves an object in x direction and introduces/removes layers.
TypeName("movingCone")
Runtime type information.
void operator=(const movingCone &)=delete
Disallow default bitwise assignment.
virtual void topoChange(const polyTopoChangeMap &)
Update corresponding to the given map.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
movingCone(fvMesh &mesh, const dictionary &dict)
Construct from fvMesh and dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool update()
Update the mesh for both mesh motion and topology change.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
List of mesh modifiers defining the mesh dynamics.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
dictionary dict
volScalarField & p