dynamicMotionSolverFvMesh.C
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-2012 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
27\*---------------------------------------------------------------------------*/
28
31#include "motionSolver.H"
32#include "volFields.H"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
40 (
44 );
46 (
49 doInit
50 );
51}
52
53
54// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55
57(
58 const IOobject& io,
59 const bool doInit
60)
61:
62 dynamicFvMesh(io, doInit),
63 motionPtr_(nullptr)
64{
65 if (doInit)
66 {
67 init(false); // do not initialise lower levels
68 }
69}
70
71
73{
74 if (doInit)
75 {
76 dynamicFvMesh::init(doInit);
77 }
78
79 motionPtr_ = motionSolver::New(*this);
80 return true;
81}
82
83
85(
86 const IOobject& io,
88 faceList&& faces,
89 labelList&& allOwner,
90 labelList&& allNeighbour,
91 const bool syncPar
92)
93:
95 (
96 io,
97 std::move(points),
98 std::move(faces),
99 std::move(allOwner),
100 std::move(allNeighbour),
101 syncPar
102 ),
103 motionPtr_(motionSolver::New(*this))
104{}
105
106
107// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108
110{
111 return *motionPtr_;
112}
113
114
116{
117 fvMesh::movePoints(motionPtr_->newPoints());
118
119 volVectorField* Uptr = getObjectPtr<volVectorField>("U");
120
121 if (Uptr)
122 {
124 }
125
126 return true;
127}
128
129
130// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void correctBoundaryConditions()
Correct boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:81
The dynamicMotionSolverFvMesh.
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.
const motionSolver & motion() const
Return the motionSolver.
virtual bool movePoints()
Avoid masking surfaceInterpolation method.
Virtual base class for mesh motion solver.
Definition: motionSolver.H:61
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
const pointField & points
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.