movingConeTopoFvMesh.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::movingConeTopoFvMesh
29
30Description
31 Sample topoChangerFvMesh that moves an object in x direction
32 and introduces/removes layers.
33
34SourceFiles
35 movingConeTopoFvMesh.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef movingConeTopoFvMesh_H
40#define movingConeTopoFvMesh_H
41
42#include "topoChangerFvMesh.H"
43#include "motionSolver.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declaration of classes
51
52/*---------------------------------------------------------------------------*\
53 Class movingConeTopoFvMesh Declaration
54\*---------------------------------------------------------------------------*/
57:
59{
60 // Private data
61
62 //- Motion dictionary
63 dictionary motionDict_;
64
65 //- Motion velocity amplitude
66 vector motionVelAmplitude_;
67
68 //- Motion velocity period
69 scalar motionVelPeriod_;
70
71 //- Motion velocity period
72 vector curMotionVel_;
73
74 //- Left edge
75 scalar leftEdge_;
76
77 //- Current left obstacle position
78 scalar curLeft_;
79
80 //- Current right obstacle position
81 scalar curRight_;
82
83 //- Vertex motion mask
84 scalarField motionMask_;
85
86
87 // Private Member Functions
88
89 //- No copy construct
91
92 //- No copy assignment
93 void operator=(const movingConeTopoFvMesh&) = delete;
94
95
96 //- Add mixer zones and modifiers
97 void addZonesAndModifiers();
98
99 //- Markup motion vertices
100 tmp<scalarField> vertexMarkup
101 (
102 const pointField& p,
103 const scalar curLeft,
104 const scalar curRight
105 ) const;
106
107
108public:
109
110 //- Runtime type information
111 TypeName("movingConeTopoFvMesh");
112
113
114 // Constructors
115
116 //- Construct from database
117 explicit movingConeTopoFvMesh
118 (
119 const IOobject& io,
120 const bool doInit = true
121 );
122
123
124 //- Destructor
125 virtual ~movingConeTopoFvMesh();
126
127
128 // Member Functions
129
130 //- Initialise all non-demand-driven data
131 virtual bool init(const bool doInit);
132
133 //- Update the mesh for both mesh motion and topology change
134 virtual bool update();
135};
136
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140} // End namespace Foam
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144#endif
145
146// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Sample topoChangerFvMesh that moves an object in x direction and introduces/removes layers.
TypeName("movingConeTopoFvMesh")
Runtime type information.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
virtual bool update()
Update the mesh for both mesh motion and topology change.
virtual ~movingConeTopoFvMesh()
Destructor.
A class for managing temporary objects.
Definition: tmp.H:65
Abstract base class for a topology changing fvMesh.
volScalarField & p
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73