CrankNicolson.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) 2015-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 Class
27  Foam::sixDoFSolvers::CrankNicolson
28 
29 Group
30  grpSixDoFRigidBodySolvers
31 
32 Description
33  Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
34 
35  The off-centering coefficients for acceleration (velocity integration) and
36  velocity (position/orientation integration) may be specified but default
37  values of 0.5 for each are used if they are not specified. With the default
38  off-centering this scheme is equivalent to the Newmark scheme with default
39  coefficients.
40 
41  Example specification in dynamicMeshDict:
42  \verbatim
43  solver
44  {
45  type CrankNicolson;
46  aoc 0.5; // Acceleration off-centering coefficient
47  voc 0.5; // Velocity off-centering coefficient
48  }
49  \endverbatim
50 
51 See also
52  Foam::sixDoFSolvers::Newmark
53 
54 SourceFiles
55  CrankNicolson.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef CrankNicolson_H
60 #define CrankNicolson_H
61 
62 #include "sixDoFSolver.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace sixDoFSolvers
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class CrankNicolson Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class CrankNicolson
76 :
77  public sixDoFSolver
78 {
79  // Private data
80 
81  //- Acceleration off-centering coefficient (default: 0.5)
82  const scalar aoc_;
83 
84  //- Velocity off-centering coefficient (default: 0.5)
85  const scalar voc_;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("CrankNicolson");
92 
93 
94  // Constructors
95 
96  //- Construct from a dictionary and the body
98  (
99  const dictionary& dict,
101  );
102 
103  //- Construct and return a clone
104  virtual autoPtr<sixDoFSolver> clone() const
105  {
107  }
108 
109 
110  //- Destructor
111  virtual ~CrankNicolson();
112 
113 
114  // Member Functions
115 
116  //- Drag coefficient
117  virtual void solve
118  (
119  bool firstIter,
120  const vector& fGlobal,
121  const vector& tauGlobal,
122  scalar deltaT,
123  scalar deltaT0
124  );
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace sixDoFSolvers
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::sixDoFSolvers::CrankNicolson::solve
virtual void solve(bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0)
Drag coefficient.
Definition: CrankNicolson.C:67
Foam::sixDoFSolver
Definition: sixDoFSolver.H:54
Foam::sixDoFSolvers::CrankNicolson::clone
virtual autoPtr< sixDoFSolver > clone() const
Construct and return a clone.
Definition: CrankNicolson.H:103
Foam::sixDoFSolvers::CrankNicolson::TypeName
TypeName("CrankNicolson")
Runtime type information.
Foam::sixDoFSolvers::CrankNicolson
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
Definition: CrankNicolson.H:74
Foam::sixDoFSolvers::CrankNicolson::CrankNicolson
CrankNicolson(const dictionary &dict, sixDoFRigidBodyMotion &body)
Construct from a dictionary and the body.
Definition: CrankNicolson.C:47
Foam::sixDoFSolver::dict_
dictionary dict_
Model dictionary.
Definition: sixDoFSolver.H:64
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::sixDoFRigidBodyMotion
Six degree of freedom motion for a rigid body.
Definition: sixDoFRigidBodyMotion.H:69
Foam::Vector< scalar >
sixDoFSolver.H
Foam::sixDoFSolver::body_
sixDoFRigidBodyMotion & body_
The rigid body.
Definition: sixDoFSolver.H:61
Foam::sixDoFSolvers::CrankNicolson::~CrankNicolson
virtual ~CrankNicolson()
Destructor.
Definition: CrankNicolson.C:60