Virtual Testbed
Ship dynamics simulator for extreme conditions
Public Types | Public Member Functions | Protected Attributes | List of all members
vtb::core::Gerstner_solver< T, N > Class Template Referenceabstract

Trochoidal irrotational waves solves named after Gerstner. More...

#include <gerstner.hh>

Collaboration diagram for vtb::core::Gerstner_solver< T, N >:
[legend]

Public Types

using scalar_type = T
 
using vertex_type = blitz::TinyVector< T, N >
 
using vertex_field_3d = Array< vertex_type, 3 >
 
using scalar_field_3d = Array< T, 3 >
 
using grid3 = Grid< T, N >
 
using grid4 = Grid< T, N+1 >
 
using panel_type = Ship_hull_panel< T, N >
 
using panel_array = std::vector< panel_type >
 
using wave_type = Linear_wave< T, N >
 
using wave_array = std::vector< wave_type >
 
using ship_type = Ship< T >
 
using C = std::complex< T >
 

Public Member Functions

depth () const
 Water depth.
 
void depth (T rhs)
 
const wave_arraywaves () const
 
void waves (wave_array &&rhs)
 
void waves (const wave_array &rhs)
 
bool diffraction () const
 Calculate diffraction forces? More...
 
void diffraction (bool rhs)
 
bool radiation () const
 Calculate radiation forces? More...
 
void radiation (bool rhs)
 
bool waterline_only () const
 Calculate radiation/diffraction using waterline only? More...
 
void waterline_only (bool rhs)
 
bool clip () const
 Clamp grid to panels?
 
void clip (bool rhs)
 
virtual void compute_positions (const ship_type &ship, const panel_array &panels, const grid3 &grid_txy, vertex_field_3d &surface)=0
 Fluid motion without diffraction/radiation. More...
 
virtual void compute_forces (const ship_type &ship, const grid4 &grid_tzxy, panel_array &wetted_panels)=0
 Compute Froude—Krylov force acting on each panel. More...
 
const vertex_field_3d & velocity () const
 
const scalar_field_3d & potential () const
 
const grid3velocity_grid () const
 
 Gerstner_solver (const Gerstner_solver &)=default
 
Gerstner_solveroperator= (const Gerstner_solver &)=default
 
 Gerstner_solver (Gerstner_solver &&)=default
 
Gerstner_solveroperator= (Gerstner_solver &&)=default
 

Protected Attributes

_depth = std::numeric_limits<T>::infinity()
 
wave_array _waves {{Amplitude<T>(1),Length<T>(40),Direction<T>(0)}}
 
vertex_field_3d _velocity
 
scalar_field_3d _potential
 
grid3 _velocity_grid_zxy
 
panel_array _old_panels
 
_old_t {}
 
bool _diffraction = false
 
bool _radiation = false
 
bool _waterline_only = true
 
bool _clip = true
 

Detailed Description

template<class T, int N>
class vtb::core::Gerstner_solver< T, N >

Trochoidal irrotational waves solves named after Gerstner.

Date
2019-04-29
Author
Ivan Gankevich
Ivan Petriakov

Definition at line 31 of file gerstner.hh.

Member Function Documentation

◆ compute_forces()

template<class T, int N>
virtual void vtb::core::Gerstner_solver< T, N >::compute_forces ( const ship_type ship,
const grid4 grid_tzxy,
panel_array wetted_panels 
)
pure virtual

Compute Froude—Krylov force acting on each panel.

Parameters
[in,out]wetted_panelsunderwater panels

As a side effect, computes velocity potential and velocity fields on and under the wave surface.

◆ compute_positions()

template<class T, int N>
virtual void vtb::core::Gerstner_solver< T, N >::compute_positions ( const ship_type ship,
const panel_array panels,
const grid3 grid_txy,
vertex_field_3d &  surface 
)
pure virtual

Fluid motion without diffraction/radiation.

Parameters
[in]panelsship hull faces
[in,out]surfacefluid particle position field \((t,x,y)\).

Calculates positions of fluid particles on the wave surface surface.

◆ diffraction()

template<class T, int N>
bool vtb::core::Gerstner_solver< T, N >::diffraction ( ) const
inline

Calculate diffraction forces?

The effect of the fluid particles hitting the rigid body.

Definition at line 72 of file gerstner.hh.

◆ radiation()

template<class T, int N>
bool vtb::core::Gerstner_solver< T, N >::radiation ( ) const
inline

Calculate radiation forces?

The effect of an oscillating rigid body on the still fluid.

Definition at line 77 of file gerstner.hh.

◆ waterline_only()

template<class T, int N>
bool vtb::core::Gerstner_solver< T, N >::waterline_only ( ) const
inline

Calculate radiation/diffraction using waterline only?

Using waterline only is much faster than using all underwater panels.

Definition at line 82 of file gerstner.hh.