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 46 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 Airy, solitary, Stokes2, and Stokes5.

◆ New() [1/2]

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

Select.

Definition at line 31 of file waveModelNew.C.

References dict, g, dictionary::lookup(), and Foam::compressible::New().

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 41 of file waveModelNew.C.

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

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.

References waveModel::elevation(), waveModel::velocity(), waveModel::write(), and x.

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

Here is the call graph for this function:
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 Airy, solitary, Stokes2, and Stokes5.

Referenced by waveModel::g().

Here is the caller graph for this function:

◆ 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 Airy, solitary, Stokes2, and Stokes5.

Referenced by waveModel::g().

Here is the caller graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented in Airy, and solitary.

Definition at line 63 of file waveModel.C.

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

Here is the caller graph for this function:

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