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) 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::RBD::rigidBodySolvers::CrankNicolson
28 
29 Description
30  Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
31 
32  The off-centering coefficients for acceleration (velocity integration) and
33  velocity (position/orientation integration) may be specified but default
34  values of 0.5 for each are used if they are not specified. With the default
35  off-centering this scheme is equivalent to the Newmark scheme with default
36  coefficients.
37 
38  Example specification in dynamicMeshDict:
39  \verbatim
40  solver
41  {
42  type CrankNicolson;
43  aoc 0.5; // Acceleration off-centering coefficient
44  voc 0.5; // Velocity off-centering coefficient
45  }
46  \endverbatim
47 
48 See also
49  Foam::RBD::rigidBodySolvers::Newmark
50 
51 SourceFiles
52  CrankNicolson.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef CrankNicolson_H
57 #define CrankNicolson_H
58 
59 #include "rigidBodySolver.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace RBD
66 {
67 namespace rigidBodySolvers
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class CrankNicolson Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class CrankNicolson
75 :
76  public rigidBodySolver
77 {
78  // Private data
79 
80  //- Acceleration off-centering coefficient (default: 0.5)
81  const scalar aoc_;
82 
83  //- Velocity off-centering coefficient (default: 0.5)
84  const scalar voc_;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("CrankNicolson");
91 
92 
93  // Constructors
94 
95  //- Construct for the given body from dictionary
97  (
98  rigidBodyMotion& body,
99  const dictionary& dict
100  );
101 
102 
103  //- Destructor
104  virtual ~CrankNicolson();
105 
106 
107  // Member Functions
108 
109  //- Integrate the rigid-body motion for one time-step
110  virtual void solve
111  (
112  const scalarField& tau,
113  const Field<spatialVector>& fx
114  );
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace rigidBodySolvers
121 } // End namespace RBD
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
rigidBodySolver.H
Foam::RBD::rigidBodySolvers::CrankNicolson
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
Definition: CrankNicolson.H:73
Foam::RBD::rigidBodyMotion
Six degree of freedom motion for a rigid body.
Definition: rigidBodyMotion.H:75
Foam::RBD::rigidBodySolvers::CrankNicolson::TypeName
TypeName("CrankNicolson")
Runtime type information.
Foam::RBD::rigidBodySolvers::CrankNicolson::CrankNicolson
CrankNicolson(rigidBodyMotion &body, const dictionary &dict)
Construct for the given body from dictionary.
Definition: CrankNicolson.C:50
Foam::Field< scalar >
Foam::RBD::rigidBodySolvers::CrankNicolson::solve
virtual void solve(const scalarField &tau, const Field< spatialVector > &fx)
Integrate the rigid-body motion for one time-step.
Definition: CrankNicolson.C:70
Foam::RBD::rigidBodySolvers::CrankNicolson::~CrankNicolson
virtual ~CrankNicolson()
Destructor.
Definition: CrankNicolson.C:63
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::RBD::rigidBodySolver
Definition: rigidBodySolver.H:53