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) 2016-2018 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::RBD::rigidBodySolvers::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::RBD::rigidBodySolvers::Newmark
48 
49 SourceFiles
50  CrankNicolson.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef CrankNicolson_H
55 #define CrankNicolson_H
56 
57 #include "rigidBodySolver.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace RBD
64 {
65 namespace rigidBodySolvers
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class CrankNicolson Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class CrankNicolson
73 :
74  public rigidBodySolver
75 {
76  // Private data
77 
78  //- Acceleration off-centering coefficient (default: 0.5)
79  const scalar aoc_;
80 
81  //- Velocity off-centering coefficient (default: 0.5)
82  const scalar voc_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("CrankNicolson");
89 
90 
91  // Constructors
92 
93  //- Construct for the given body from dictionary
95  (
96  rigidBodyMotion& body,
97  const dictionary& dict
98  );
99 
100 
101  //- Destructor
102  virtual ~CrankNicolson();
103 
104 
105  // Member Functions
106 
107  //- Integrate the rigid-body motion for one time-step
108  virtual void solve
109  (
110  const scalarField& tau,
111  const Field<spatialVector>& fx
112  );
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace rigidBodySolvers
119 } // End namespace RBD
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
Definition: CrankNicolson.H:71
CrankNicolson(rigidBodyMotion &body, const dictionary &dict)
Construct for the given body from dictionary.
Definition: CrankNicolson.C:47
Six degree of freedom motion for a rigid body.
TypeName("CrankNicolson")
Runtime type information.
virtual void solve(const scalarField &tau, const Field< spatialVector > &fx)
Integrate the rigid-body motion for one time-step.
Definition: CrankNicolson.C:67
Namespace for OpenFOAM.