DAMotionTranslationCoupled.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Child class for coupled translation motion (FSI)
8  with the Mass-spring-damper model
9 
10  M * a + C * V + K * y = F
11 
12  where M is the mass, a is the acceleration, V is the velocity,
13  C is the damping coefficient, K is the spring constant, y is
14  the displacement, and F is the external force
15 
16  To solve this equation, we can break it into two ODEs
17 
18  y1 = y; y2 = dy/dt
19 
20  dy1/dt = V = y2
21  dy2/dt = a = (F - C * y2 - K * y1) / M
22 
23  We can then use the RK2 method to solve the above two ODEs
24 
25 \*---------------------------------------------------------------------------*/
26 
27 #ifndef DAMotionTranslationCoupled_H
28 #define DAMotionTranslationCoupled_H
29 
30 #include "DAMotion.H"
31 #include "addToRunTimeSelectionTable.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 /*---------------------------------------------------------------------------*\
39  Class DAMotionTranslationCoupled Declaration
40 \*---------------------------------------------------------------------------*/
41 
43  : public DAMotion
44 {
45 
46 protected:
48  scalar M_;
49 
51  scalar C_;
52 
54  scalar K_;
55 
57  scalar forceScale_;
58 
60  vector direction_ = vector::zero;
61 
63  scalar y_;
64 
66  scalar V_;
67 
69  scalar y0_;
70 
72  scalar V0_;
73 
75  scalar t_;
76 
77 public:
78  TypeName("translationCoupled");
79  // Constructors
80 
81  //- Construct from components
83  const dynamicFvMesh& mesh,
84  const DAOption& daOption);
85 
86  //- Destructor
88  {
89  }
90 
92  virtual void correct();
93 };
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #endif
102 
103 // ************************************************************************* //
Foam::DAMotionTranslationCoupled::V_
scalar V_
velocity for the current step
Definition: DAMotionTranslationCoupled.H:66
Foam::DAMotionTranslationCoupled::y_
scalar y_
location for the current step
Definition: DAMotionTranslationCoupled.H:63
Foam::DAMotionTranslationCoupled::t_
scalar t_
the simulation time based on dT and it should be same as the runtime
Definition: DAMotionTranslationCoupled.H:75
Foam::DAOption
Definition: DAOption.H:29
Foam::DAMotionTranslationCoupled::y0_
scalar y0_
location from the previous step
Definition: DAMotionTranslationCoupled.H:69
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAMotionTranslationCoupled::forceScale_
scalar forceScale_
scaling factor for force
Definition: DAMotionTranslationCoupled.H:57
Foam::DAMotionTranslationCoupled::correct
virtual void correct()
update the cell displacement
Definition: DAMotionTranslationCoupled.C:41
Foam::DAMotionTranslationCoupled::DAMotionTranslationCoupled
DAMotionTranslationCoupled(const dynamicFvMesh &mesh, const DAOption &daOption)
Definition: DAMotionTranslationCoupled.C:19
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAMotionTranslationCoupled::C_
scalar C_
spring damping coefficient
Definition: DAMotionTranslationCoupled.H:51
DAMotion.H
Foam::DAMotion
Definition: DAMotion.H:29
Foam::DAMotionTranslationCoupled::M_
scalar M_
mass of the object
Definition: DAMotionTranslationCoupled.H:48
Foam::DAMotionTranslationCoupled
Definition: DAMotionTranslationCoupled.H:42
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAMotionTranslationCoupled::K_
scalar K_
spring stiffness constant
Definition: DAMotionTranslationCoupled.H:54
Foam::DAMotionTranslationCoupled::~DAMotionTranslationCoupled
virtual ~DAMotionTranslationCoupled()
Definition: DAMotionTranslationCoupled.H:87
Foam::DAMotionTranslationCoupled::V0_
scalar V0_
velocity from the previous step
Definition: DAMotionTranslationCoupled.H:72
Foam::DAMotionTranslationCoupled::TypeName
TypeName("translationCoupled")
Foam::DAMotionTranslationCoupled::direction_
vector direction_
spring oscillation direction
Definition: DAMotionTranslationCoupled.H:60