CrankNicolson.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::sixDoFSolvers::CrankNicolson
26 
27 Description
28  Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
29 
30  The off-centering coefficients for acceleration (velocity integration) and
31  velocity (position/orientation integration) may be specified but default
32  values of 0.5 for each are used if they are not specified. With the default
33  off-centering this scheme is equivalent to the Newmark scheme with default
34  coefficients.
35 
36  Example specification in dynamicMeshDict:
37  \verbatim
38  solver
39  {
40  type CrankNicolson;
41  aoc 0.5; // Acceleration off-centering coefficient
42  voc 0.5; // Velocity off-centering coefficient
43  }
44  \endverbatim
45 
46 See also
47  Foam::sixDoFSolvers::Newmark
48 
49 SourceFiles
50  CrankNicolson.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef CrankNicolson_H
55 #define CrankNicolson_H
56 
57 #include "sixDoFSolver.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace sixDoFSolvers
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class CrankNicolson Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class CrankNicolson
71 :
72  public sixDoFSolver
73 {
74  // Private Data
75 
76  //- Acceleration off-centering coefficient (default: 0.5)
77  const scalar aoc_;
78 
79  //- Velocity off-centering coefficient (default: 0.5)
80  const scalar voc_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("CrankNicolson");
87 
88 
89  // Constructors
90 
91  //- Construct from a dictionary and the body
93  (
94  const dictionary& dict,
96  );
97 
98 
99  //- Destructor
100  virtual ~CrankNicolson();
101 
102 
103  // Member Functions
104 
105  //- Drag coefficient
106  virtual void solve
107  (
108  bool firstIter,
109  const vector& fGlobal,
110  const vector& tauGlobal,
111  scalar deltaT,
112  scalar deltaT0
113  );
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace sixDoFSolvers
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Six degree of freedom motion for a rigid body.
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
Definition: CrankNicolson.H:72
virtual ~CrankNicolson()
Destructor.
Definition: CrankNicolson.C:57
CrankNicolson(const dictionary &dict, sixDoFRigidBodyMotion &body)
Construct from a dictionary and the body.
Definition: CrankNicolson.C:44
virtual void solve(bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0)
Drag coefficient.
Definition: CrankNicolson.C:64
TypeName("CrankNicolson")
Runtime type information.
Namespace for OpenFOAM.
dictionary dict