componentVelocityMotionSolver.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) 2012-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
29 #include "mapPolyMesh.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(componentVelocityMotionSolver, 0);
36 }
37 
38 
39 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
40 
41 Foam::direction Foam::componentVelocityMotionSolver::cmpt
42 (
43  const word& cmptName
44 ) const
45 {
46  if (cmptName == "x")
47  {
48  return vector::X;
49  }
50  else if (cmptName == "y")
51  {
52  return vector::Y;
53  }
54  else if (cmptName == "z")
55  {
56  return vector::Z;
57  }
58  else
59  {
61  << "Given component name " << cmptName << " should be x, y or z"
62  << exit(FatalError);
63 
64  return 0;
65  }
66 }
67 
68 
69 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
70 
71 Foam::componentVelocityMotionSolver::componentVelocityMotionSolver
72 (
73  const polyMesh& mesh,
74  const IOdictionary& dict,
75  const word& type
76 )
77 :
78  motionSolver(mesh, dict, type),
79  cmptName_(coeffDict().lookup("component")),
80  cmpt_(cmpt(cmptName_)),
81  pointMotionU_
82  (
83  IOobject
84  (
85  "pointMotionU" + cmptName_,
86  mesh.time().timeName(),
87  mesh,
88  IOobject::MUST_READ,
89  IOobject::AUTO_WRITE
90  ),
92  )
93 {}
94 
95 
96 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 {
106  // No local data to adapt
107 }
108 
109 
111 {
112  // pointMesh already updates pointFields.
113 
115 }
116 
117 
118 // ************************************************************************* //
dictionary dict
uint8_t direction
Definition: direction.H:46
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:45
word timeName
Definition: getTimeIndex.H:3
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
virtual void updateMesh(const mapPolyMesh &)=0
Update local data for topology changes.
Definition: motionSolver.C:206
dynamicFvMesh & mesh
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
defineTypeNameAndDebug(combustionModel, 0)
PtrList< volScalarField > & Y
volScalarField & p
Namespace for OpenFOAM.