KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
ship_element.h
Go to the documentation of this file.
1 // Last Modified by: Salva, latorre@cimne.upc.edu
2 
3 #if !defined KRATOS_SHIP_ELEMENT_3D_H_INCLUDED
4 #define KRATOS_SHIP_ELEMENT_3D_H_INCLUDED
5 
6 // System includes
7 #include <string>
8 
9 // Project includes
10 #include "includes/define.h"
11 #include "includes/node.h"
12 #include "includes/element.h"
13 #include "geometries/geometry.h"
14 #include "includes/properties.h"
18 
19 namespace Kratos
20 {
21  class Element;
22  class KRATOS_API(DEM_APPLICATION) ShipElement3D : public RigidBodyElement3D {
23 
24  public:
27 
28  ShipElement3D();
29  ShipElement3D(IndexType NewId, GeometryType::Pointer pGeometry);
30  ShipElement3D(IndexType NewId, NodesArrayType const& ThisNodes);
31  ShipElement3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
32  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
33 
35  virtual ~ShipElement3D();
36 
37  void CustomInitialize(ModelPart& rigid_body_element_sub_model_part) override;
38 
39  void ComputeBuoyancyEffects();
40  void ComputeEngineForce();
41  void ComputeWaterDragForce();
42 
43  void ComputeExternalForces(const array_1d<double,3>& gravity) override;
44 
45  // Engine characteristics
46  double mEnginePower; //60000000; // 60MW for the Arktika-class icebreaker
47  double mMaxEngineForce; //60000000; // with 20MN the ship almost couldn't make it through the ice
48  double mThresholdVelocity; //1.0; // It was set to 3.0 m/s before, which corresponded to a maximum force of 20MN
50 
51  // Water drag. Applied to de center of mass. We are assuming the ship is moving in the X direction (in GiD)
52  // Drag constant values in the 3 axes
53  // drag_X = 500000; // Such that the X maximum velocity is 11 m/s, which corresponds to Arktika-class icebreakers
54  // drag_Y = 240000000; // Such that the Y maximum velocity is 0.5 m/s
55  // drag_Z = 240000000; // Such that the Z maximum velocity is 0.5 m/s
57 
58  virtual std::string Info() const override
59  {
60  std::stringstream buffer;
61  buffer << "Discrete Element #" << Id();
62  return buffer.str();
63  }
64 
66  virtual void PrintInfo(std::ostream& rOStream) const override
67  {
68  rOStream << "Discrete Element #" << Id();
69  }
70 
72  virtual void PrintData(std::ostream& rOStream) const override
73  {
74  //mpGeometry->PrintData(rOStream);
75  }
76 
77  protected:
78 
79 
80  private:
81 
82  friend class Serializer;
83  virtual void save(Serializer& rSerializer) const override{ KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, RigidBodyElement3D); }
84  virtual void load(Serializer& rSerializer) override{ KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, RigidBodyElement3D); }
85 
86  }; // Class ShipElement3D
87 
89  inline std::istream& operator >> (std::istream& rIStream, ShipElement3D& rThis);
90 
92  inline std::ostream& operator << (std::ostream& rOStream, const ShipElement3D& rThis)
93  {
94  rThis.PrintInfo(rOStream);
95  rOStream << std::endl;
96  rThis.PrintData(rOStream);
97  return rOStream;
98  }
99 
100 } // namespace Kratos
101 
102 #endif // KRATOS_SHIP_ELEMENT_3D_H_INCLUDED defined
std::size_t IndexType
Definition: flags.h:74
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
Definition: rigid_body_element.h:31
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: ship_element.h:22
double mThresholdVelocity
Definition: ship_element.h:48
array_1d< double, 3 > mDragConstantVector
Definition: ship_element.h:56
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: ship_element.h:66
double mEnginePower
Definition: ship_element.h:46
double mMaxEngineForce
Definition: ship_element.h:47
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: ship_element.h:72
double mEnginePerformance
Definition: ship_element.h:49
virtual std::string Info() const override
Turn back information as a string.
Definition: ship_element.h:58
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ShipElement3D)
Pointer definition of ShipElement3D.
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307