Virtual Testbed
Ship dynamics simulator for extreme conditions
Public Member Functions | List of all members
vtb::core::Linear_velocity_potential_solver< T, P > Class Template Reference

Uses formulae from linear wavy theory. More...

#include <velocity_potential.hh>

Inheritance diagram for vtb::core::Linear_velocity_potential_solver< T, P >:
[legend]
Collaboration diagram for vtb::core::Linear_velocity_potential_solver< T, P >:
[legend]

Public Member Functions

void solve (const Grid< T, 4 > &grid_tzxy, const Array< T, 3 > &wavy_surface, Array< T, 4 > &velocity_potential) override
 Computes velocity potential \(\phi\). More...
 
void window_function (const Grid< T, 2 > &wngrid, const T z, Array2< T > &result)
 Computes window (first) function \(\mathcal{W}\). More...
 
template<>
void window_function (const Grid< T, 2 > &wngrid, const T z, Array2< T > &result)
 
template<>
void solve (const Grid< T, 4 > &grid_tzxy, const Array< T, 3 > &zeta, Array< T, 4 > &phi)
 
- Public Member Functions inherited from vtb::core::Linear_velocity_potential_solver_base< T >
void second_function (const Grid< T, 4 > &grid_tzxy, const Array3< T > &wavy_surface, Array3< C > &result)
 Computes second function. More...
 
- Public Member Functions inherited from vtb::core::Velocity_potential_solver< T, 3 >
depth () const noexcept
 Get water depth.
 
void depth (T rhs)
 Set water depth.
 
void wave_number_grid (const Grid< T, 2 > &rhs)
 
const Grid< T, 2 > & wave_number_grid () const
 
void assumptions (Assumptions rhs)
 
const Assumptionsassumptions () const
 
virtual void solve (const Grid< T, N+1 > &grid_tzxy, const Array< T, N > &wavy_surface, Array< T, N+1 > &velocity_potential)=0
 Calculate velocity potential for each grid point. More...
 
void operator() (const Grid< T, 4 > &grid_tzxy, const Array< T, 3 > &wavy_surface, Array< T, 4 > &velocity_potential)
 

Detailed Description

template<class T, Policy P>
class vtb::core::Linear_velocity_potential_solver< T, P >

Uses formulae from linear wavy theory.

Date
2018-08-14
Author
Ivan Gankevich

Definition at line 151 of file velocity_potential.hh.

Member Function Documentation

◆ solve()

template<class T , Policy P>
void vtb::core::Linear_velocity_potential_solver< T, P >::solve ( const Grid< T, 4 > &  grid_tzxy,
const Array< T, 3 > &  wavy_surface,
Array< T, 4 > &  velocity_potential 
)
override

Computes velocity potential \(\phi\).

Date
2018-08-14
Author
Ivan Gankevich
See also
window_function
second_function

The integration is implemented using FFT and is done over wave number range which is computed directly from the wavy surface.The main formula for velocity potential is

\[ \phi(x,y,z;t) = \mathcal{F}^{-1}_{x,y}\left\{ \mathcal{W}(u,v;z) \cdot \mathcal{F}_{u,v}\left\{\mathcal{S}(x,y;t)\right\} \right\}, \]

where \(\mathcal{W}\) is window function and \(\mathcal{S}\) is second function. For details see documentation of the corresponding methods.

◆ window_function()

template<class T , Policy P>
void vtb::core::Linear_velocity_potential_solver< T, P >::window_function ( const Grid< T, 2 > &  wngrid,
const T  z,
Array2< T > &  result 
)

Computes window (first) function \(\mathcal{W}\).

Date
2018-08-14
Author
Ivan Gankevich
  • For infinite depth the formula is

    \[ \mathcal{W}(\vec{k}) = \frac{\exp\left(|\vec{k}|\right)}{|\vec{k}|}. \]

  • For finite depth the formula is

    \[ \mathcal{W}(\vec{k}) = \frac {\cosh\left(|\vec{k}|(z+h)\right)} {|\vec{k}|\cosh\left(|\vec{k}|h\right)}. \]