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-------------------------------------------------------------------------------
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
26Class
27 Foam::sixDoFSolvers::CrankNicolson
28
29Group
30 grpSixDoFRigidBodySolvers
31
32Description
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
51See also
52 Foam::sixDoFSolvers::Newmark
53
54SourceFiles
55 CrankNicolson.C
56
57\*---------------------------------------------------------------------------*/
58
59#ifndef CrankNicolson_H
60#define CrankNicolson_H
61
62#include "sixDoFSolver.H"
63
64// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65
66namespace Foam
67{
68namespace sixDoFSolvers
69{
70
71/*---------------------------------------------------------------------------*\
72 Class CrankNicolson Declaration
73\*---------------------------------------------------------------------------*/
75class 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
88public:
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// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Six degree of freedom motion for a rigid body.
dictionary dict_
Model dictionary.
Definition: sixDoFSolver.H:64
sixDoFRigidBodyMotion & body_
The rigid body.
Definition: sixDoFSolver.H:61
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
Definition: CrankNicolson.H:77
virtual ~CrankNicolson()
Destructor.
Definition: CrankNicolson.C:60
virtual autoPtr< sixDoFSolver > clone() const
Construct and return a clone.
TypeName("CrankNicolson")
Runtime type information.
Namespace for OpenFOAM.
dictionary dict
CEqn solve()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73