waveModel Class Referenceabstract

Generic base class for waves. Derived classes must implement field functions which return the elevation above the wave surface and the velocity field, both as a function of position. More...

Inheritance diagram for waveModel:

Public Member Functions

 TypeName ("waveModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, waveModel, dictionary,(const dictionary &dict, const scalar g),(dict, g))
 
 waveModel (const waveModel &wave)
 Construct a copy. More...
 
 waveModel (const dictionary &dict, const scalar g)
 Construct from a dictionary and gravity. More...
 
virtual autoPtr< waveModelclone () const =0
 Construct a clone. More...
 
virtual ~waveModel ()
 Destructor. More...
 
scalar g () const
 Get the value of gravity. More...
 
virtual tmp< scalarFieldelevation (const scalar t, const scalarField &x) const =0
 Get the wave elevation at a given time and local coordinates. Local. More...
 
virtual tmp< vector2DFieldvelocity (const scalar t, const vector2DField &xz) const =0
 Get the wave velocity at a given time and local coordinates. Local. More...
 
virtual void write (Ostream &os) const
 Write. More...
 

Static Public Member Functions

static autoPtr< waveModelNew (const dictionary &dict, const scalar g)
 Select. More...
 
static autoPtr< waveModelNew (const word &type, const dictionary &dict, const scalar g)
 Select. More...
 

Detailed Description

Generic base class for waves. Derived classes must implement field functions which return the elevation above the wave surface and the velocity field, both as a function of position.

Source files

Definition at line 55 of file waveModel.H.

Constructor & Destructor Documentation

◆ waveModel() [1/2]

waveModel ( const waveModel wave)

Construct a copy.

Definition at line 39 of file waveModel.C.

◆ waveModel() [2/2]

waveModel ( const dictionary dict,
const scalar  g 
)

Construct from a dictionary and gravity.

Definition at line 45 of file waveModel.C.

◆ ~waveModel()

~waveModel ( )
virtual

Destructor.

Definition at line 57 of file waveModel.C.

Member Function Documentation

◆ TypeName()

TypeName ( "waveModel"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
waveModel  ,
dictionary  ,
(const dictionary &dict, const scalar g ,
(dict, g  
)

◆ clone()

virtual autoPtr<waveModel> clone ( ) const
pure virtual

Construct a clone.

Implemented in Stokes5, Stokes2, solitary, and Airy.

◆ New() [1/2]

Foam::autoPtr< Foam::waveModel > New ( const dictionary dict,
const scalar  g 
)
static

Select.

Definition at line 30 of file waveModelNew.C.

References dict, and waveModel::g().

Referenced by waveSuperposition::waveSuperposition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::waveModel > New ( const word type,
const dictionary dict,
const scalar  g 
)
static

Select.

Definition at line 40 of file waveModelNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, Foam::nl, and Foam::type().

Here is the call graph for this function:

◆ g()

scalar g ( ) const
inline

Get the value of gravity.

Definition at line 119 of file waveModel.H.

Referenced by Airy::Airy(), Airy::celerity(), Stokes2::celerity(), Stokes5::celerity(), and waveModel::New().

Here is the caller graph for this function:

◆ elevation()

virtual tmp<scalarField> elevation ( const scalar  t,
const scalarField x 
) const
pure virtual

Get the wave elevation at a given time and local coordinates. Local.

x is aligned with the direction of propagation.

Implemented in Stokes5, Stokes2, solitary, and Airy.

◆ velocity()

virtual tmp<vector2DField> velocity ( const scalar  t,
const vector2DField xz 
) const
pure virtual

Get the wave velocity at a given time and local coordinates. Local.

x is aligned with the direction of propagation, and z with negative gravity.

Implemented in Stokes5, Stokes2, solitary, and Airy.

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented in solitary, and Airy.

Definition at line 63 of file waveModel.C.

Referenced by Airy::write(), and solitary::write().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: