WaveBEM: Unsteady Nonlinear Potential Flow Solver for Ship-Wave Interaction.
boat_model.h
Go to the documentation of this file.
1 
2 #ifndef boat_model_h
3 #define boat_model_h
4 
5 #include <fstream>
6 #include <iostream>
7 #include <cmath>
8 #include <limits>
9 #include <vector>
10 
11 #include <deal.II/base/logstream.h>
12 
13 #include "occ_utilities.h"
14 #include "occ_normal_projection.h"
16 #include "occ_axis_projection.h"
17 #include "occ_line_smoothing.h"
18 
19 
20 class BoatModel
21 {
22 public:
23 
24  BoatModel();
25 
26  ~BoatModel();
27 
28  void start_iges_model(std::string igesFileName,
29  double scale,
30  double displacement,
31  double assigned_sink,
32  double assigned_trim,
33  double back_keel_length=0.1,
34  double front_keel_length=0.05,
35  double middle_keel_length=.47,
36  unsigned int number_of_transom_edges=1);
37 
38  TopoDS_Shape ReverseFaceOrientation(const TopoDS_Shape &shape,
39  const TopoDS_Face &face);
40 
41  void compute_hydrostatic_sink(double &sink, const double &weight);
42 
43  Point<3> compute_hydrostatic_force(const double &sink);
44 
45  Point<3> compute_hydrostatic_moment(const double &sink, const Point<3> moment_center);
46 
47  gp_Trsf set_current_position(const Point<3> &translation_vect,
48  const double &quaternion_scalar,
49  const Point<3> &quaternion_vect);
50 
51 //private:
52  // keel intersection with undisturbed free surface at bow
54  // this point will be "cornerpoint" of boat mesh at bow
56  // point on the undisturbed free surface and on boat surface
57  // located roughly midway from bow to stern
59  // point on the boat keel located roughly midway from bow to stern
61  // keel intersection with undisturbed free surface at stern
63  // this point will be "cornerpoint" of boat mesh at stern
65  // this point is intersection of left transom edge with undisturbed free surface
67  // this point is intersection of right transom edge with undisturbed free surface
69  // this point is the base point of the transom edge (intersection with symmetry plane)
71  // this point is intersection of left transom edge with undisturbed free surface
72  // in current hull configuration
74  // this point is intersection of right transom edge with undisturbed free surface
75  // in current hull configuration
77  // this point is the base point of the transom edge (intersection with symmetry plane)
78  // in current hull configuration
80  // this is the wet length of the boat
81  double boatWetLength;
82  // this is the wet surface of the boat
84  // this is the whole geometric model of the boat (right side)
85  TopoDS_Shape sh;
86  // this is the whole geometric model of the boat (left side)
87  TopoDS_Shape refl_sh;
88  // this is the keel of the boat
89  TopoDS_Shape keel_edge;
90  // this is the right transom edge of the boat
91  TopoDS_Shape right_transom_edge;
92  // this is the left transom edge of the boat
93  TopoDS_Shape left_transom_edge;
94  // this is the undisturbed right water line
96  // this is the undisturbed left water line
97  TopoDS_Shape left_undist_water_line;
98  // this is the undisturbed left water surface
100  // location of the translated shapes (for hull roto-translated
101  // in HYDROSTATIC position)
102  TopLoc_Location reference_loc;
103  // location of the translated curves (for hull roto-translated
104  //in CURRENT position)
105  TopLoc_Location current_loc;
106  // surface normal projector on boat surface right side
108  // surface normal projector on boat surface left side
110  // y-axis direction projector on boat surface right side
112  // y-axis direction projector on boat surface left side
114  // z-axis direction projector on undisturbed free surface
116  // arclength projection on keel
118  // normal projection on keel
120  // arclength projection on transom left edge
122  // arclength projection on transom right edge
124  // arclength projection on left wake line
126  // arclength projection on right wake line
128  // arclength projection on boat surface right side
130  // arclength projectionon boat surface left side
132  // keel curve
133  Handle(Geom_Curve) equiv_keel_bspline;
134  // undisturbed right water line curve
135  Handle(Geom_Curve) right_undisturbed_waterline_curve;
136  // undisturbed left water line curve
137  Handle(Geom_Curve) left_undisturbed_waterline_curve;
138  // left transom edge bspline
139  Handle(Geom_Curve) left_transom_bspline;
140  // right transom edge bspline
141  Handle(Geom_Curve) right_transom_bspline;
142  // right left bspline
143  Handle(Geom_Curve) left_wake_bspline;
144  // right wake bspline
145  Handle(Geom_Curve) right_wake_bspline;
146  // flag to determine if we have a transom stern or not
148 
149  double boat_mass;
150 
152 
154  // the position of the hull baricenter
155  // in hydrostatic configuration
157  // the position of the hull baricenter
158  // in reference configuration
160  // the position of the hull baricenter
161  // in current configuration
163  // initial (assigned) sink
164  double initial_sink;
165  // initial (assigned) trim angle
166  double initial_trim;
167  // Euler angles (only for output purposes)
168  double yaw_angle;
169  double pitch_angle;
170  double roll_angle;
171 
172 };
173 
174 #endif
Point< 3 > hydrostatic_hull_baricenter
Definition: boat_model.h:156
Point< 3 > current_hull_baricenter
Definition: boat_model.h:162
double boat_mass
Definition: boat_model.h:149
TopLoc_Location reference_loc
Definition: boat_model.h:102
double roll_angle
Definition: boat_model.h:170
Point< 3 > PointFrontBot
Definition: boat_model.h:55
Handle(Geom_Curve) equiv_keel_bspline
OpenCascade::ArclengthProjection * water_line_right
Definition: boat_model.h:129
Point< 3 > CurrentPointCenterTransom
Definition: boat_model.h:70
OpenCascade::NormalProjection< 2 > * boat_surface_left
Definition: boat_model.h:109
bool is_transom
Definition: boat_model.h:147
void scale(const double scaling_factor, Triangulation< dim, spacedim > &triangulation)
Point< 3 > PointBackBot
Definition: boat_model.h:64
OpenCascade::NormalProjection< 1 > * boat_keel_norm
Definition: boat_model.h:119
double boatWetSurface
Definition: boat_model.h:83
OpenCascade::NormalProjection< 2 > * boat_surface_right
Definition: boat_model.h:107
OpenCascade::ArclengthProjection * wake_line_right
Definition: boat_model.h:127
Point< 3 > PointBackTop
Definition: boat_model.h:62
Point< 3 > reference_hull_baricenter
Definition: boat_model.h:159
double initial_trim
Definition: boat_model.h:166
Point< 3 > CurrentPointLeftTransom
Definition: boat_model.h:73
Point< 3 > PointLeftTransom
Definition: boat_model.h:66
Point< 3 > compute_hydrostatic_moment(const double &sink, const Point< 3 > moment_center)
Definition: boat_model.cc:958
TopoDS_Shape right_undist_water_line
Definition: boat_model.h:95
OpenCascade::ArclengthProjection * boat_keel
Definition: boat_model.h:117
OpenCascade::ArclengthProjection * boat_transom_right
Definition: boat_model.h:123
Point< 3 > CurrentPointRightTransom
Definition: boat_model.h:76
TopoDS_Shape undisturbed_water_surface_face
Definition: boat_model.h:99
void start_iges_model(std::string igesFileName, double scale, double displacement, double assigned_sink, double assigned_trim, double back_keel_length=0.1, double front_keel_length=0.05, double middle_keel_length=.47, unsigned int number_of_transom_edges=1)
Definition: boat_model.cc:166
TopoDS_Shape left_transom_edge
Definition: boat_model.h:93
double pitch_angle
Definition: boat_model.h:169
OpenCascade::AxisProjection * boat_water_line_right
Definition: boat_model.h:111
gp_Trsf set_current_position(const Point< 3 > &translation_vect, const double &quaternion_scalar, const Point< 3 > &quaternion_vect)
Definition: boat_model.cc:836
OpenCascade::ArclengthProjection * boat_transom_left
Definition: boat_model.h:121
OpenCascade::ArclengthProjection * water_line_left
Definition: boat_model.h:131
TopoDS_Shape right_transom_edge
Definition: boat_model.h:91
Point< 3 > current_right_transom_tangent
Definition: boat_model.h:153
double initial_sink
Definition: boat_model.h:164
TopoDS_Shape refl_sh
Definition: boat_model.h:87
double yaw_angle
Definition: boat_model.h:168
void compute_hydrostatic_sink(double &sink, const double &weight)
Definition: boat_model.cc:1154
TopoDS_Shape left_undist_water_line
Definition: boat_model.h:97
OpenCascade::AxisProjection * boat_water_line_left
Definition: boat_model.h:113
Point< 3 > compute_hydrostatic_force(const double &sink)
Definition: boat_model.cc:594
TopoDS_Shape ReverseFaceOrientation(const TopoDS_Shape &shape, const TopoDS_Face &face)
Definition: boat_model.cc:154
double boatWetLength
Definition: boat_model.h:81
Point< 3 > PointMidTop
Definition: boat_model.h:58
TopLoc_Location current_loc
Definition: boat_model.h:105
Point< 3 > PointMidBot
Definition: boat_model.h:60
Point< 3 > PointRightTransom
Definition: boat_model.h:68
TopoDS_Shape sh
Definition: boat_model.h:85
Point< 3 > PointCenterTransom
Definition: boat_model.h:79
OpenCascade::AxisProjection * undist_water_surf
Definition: boat_model.h:115
Point< 3 > current_left_transom_tangent
Definition: boat_model.h:151
TopoDS_Shape keel_edge
Definition: boat_model.h:89
Point< 3 > PointFrontTop
Definition: boat_model.h:53
OpenCascade::ArclengthProjection * wake_line_left
Definition: boat_model.h:125