Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
33namespace Foam
34{
36}
37
38
39// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
40
41Foam::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
71Foam::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 ),
93{}
94
95
96// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
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// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ MUST_READ
Reading required.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Definition IOobject.C:456
Virtual base class for velocity motion solver.
word cmptName_
The component name to solve for.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
direction cmpt_
The component to solve for.
pointScalarField pointMotionU_
Point motion field.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void updateMesh(const mapPolyMesh &)=0
Update local data for topology changes.
const polyMesh & mesh() const
Return reference to mesh.
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
motionSolver(const polyMesh &mesh)
Construct from polyMesh.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Mesh representing a set of points created from polyMesh.
Definition pointMesh.H:49
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Lookup type of boundary radiation properties.
Definition lookup.H:60
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
volScalarField & p
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
word timeName
Definition getTimeIndex.H:3
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
uint8_t direction
Definition direction.H:49
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
dictionary dict