-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaneuveringInput.H
83 lines (55 loc) · 1.92 KB
/
maneuveringInput.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*---------------------------------------------------------------------------*\
Class
Foam::maneuveringInput
Description
Part of the movingController which is used to read sailing velocity or
yaw angle of parent level mesh.
\*---------------------------------------------------------------------------*/
#ifndef Foam_maneuveringInput_H
#define Foam_maneuveringInput_H
#include "fvCFD.H"
class maneuveringInput
{
public:
virtual ~maneuveringInput() = default;
maneuveringInput() = delete;
// Initilize from mesh and dictionary
maneuveringInput(const dictionary &dict, const uniformDimensionedVectorField& velocityAndyaw);
//maneuveringInput(const fvMesh &mesh, const Time& runTime);
scalar sailingVelocity() const;
scalar yawAngle() const;
word inputName() const;
virtual scalar input() const = 0;
static std::shared_ptr<maneuveringInput> create(const dictionary &dict, const uniformDimensionedVectorField& velocityAndyaw);
enum inputType
{
sailing,
turning,
zigzag,
coursekeeping
};
static const Enum<inputType> inputTypeNames;
void update();
protected:
// the sailingVelocity of the ship/rigid
scalar sailingVelocity_;
// the yawAngle of the ship/rigid
scalar yawAngle_;
const word inputName_;
const uniformDimensionedVectorField& velocityAndyaw_;
};
class sailingInput : public maneuveringInput
{
public:
sailingInput() = delete;
sailingInput(const dictionary &dict, const uniformDimensionedVectorField& velocityAndyaw);
scalar input() const override;
};
class yawInput : public maneuveringInput
{
public:
yawInput() = delete;
yawInput(const dictionary &dict, const uniformDimensionedVectorField& velocityAndyaw);
scalar input() const override;
};
#endif