Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

 TypeName ("waveModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, waveModel, objectRegistry,(const objectRegistry &db, const dictionary &dict),(db, dict))
 
 waveModel (const waveModel &wave)
 Construct a copy. More...
 
 waveModel (const objectRegistry &db, const dictionary &dict)
 Construct from a database and a dictionary. More...
 
virtual autoPtr< waveModelclone () const =0
 Construct a clone. More...
 
virtual ~waveModel ()
 Destructor. More...
 
scalar length () const
 Get the length. More...
 
scalar amplitude (const scalar t) const
 Get the amplitude. More...
 
scalar phase () const
 Get the phase. More...
 
scalar depth () const
 Get the depth. More...
 
virtual tmp< scalarFieldelevation (const scalar t, const scalar u, const scalarField &x) const =0
 Get the wave elevation at a given time, mean velocity and local. More...
 
virtual tmp< vector2DFieldvelocity (const scalar t, const scalar u, const vector2DField &xz) const =0
 Get the wave velocity at a given time, mean velocity and local. More...
 
virtual void write (Ostream &os) const
 Write. More...
 

Static Public Member Functions

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

Protected Member Functions

scalar k () const
 The angular wavenumber [rad/m]. More...
 
scalar sigma () const
 The intrinsic angular frequency [rad/s]. More...
 
scalar omega (const scalar u) const
 The observed angular frequency [rad/s]. More...
 
tmp< scalarFieldangle (const scalar t, const scalar u, const scalarField &x) const
 Angle of the oscillation [rad]. More...
 
bool shallow () const
 Return whether shallow effects are to be included. 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 82 of file waveModel.C.

◆ waveModel() [2/2]

waveModel ( const objectRegistry db,
const dictionary dict 
)

Construct from a database and a dictionary.

Definition at line 92 of file waveModel.C.

◆ ~waveModel()

~waveModel ( )
virtual

Destructor.

Definition at line 104 of file waveModel.C.

Member Function Documentation

◆ k()

Foam::scalar k ( ) const
protected

The angular wavenumber [rad/m].

Definition at line 42 of file waveModel.C.

References Foam::constant::mathematical::pi().

Here is the call graph for this function:

◆ sigma()

Foam::scalar sigma ( ) const
protected

The intrinsic angular frequency [rad/s].

Definition at line 48 of file waveModel.C.

References g, k, Foam::mag(), Foam::sqrt(), Foam::tanh(), and dimensioned< Type >::value().

Here is the call graph for this function:

◆ omega()

Foam::scalar omega ( const scalar  u) const
protected

The observed angular frequency [rad/s].

Definition at line 57 of file waveModel.C.

References waveModel::angle(), k, and Foam::constant::physicoChemical::sigma.

Here is the call graph for this function:

◆ angle()

Foam::tmp< Foam::scalarField > angle ( const scalar  t,
const scalar  u,
const scalarField x 
) const
protected

Angle of the oscillation [rad].

Definition at line 64 of file waveModel.C.

References k.

Referenced by waveModel::omega().

Here is the caller graph for this function:

◆ shallow()

bool shallow ( ) const
protected

Return whether shallow effects are to be included.

Definition at line 74 of file waveModel.C.

References k, and Foam::log().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "waveModel"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
waveModel  ,
objectRegistry  ,
(const objectRegistry &db, const dictionary &dict ,
(db, dict  
)

◆ clone()

virtual autoPtr<waveModel> clone ( ) const
pure virtual

Construct a clone.

Implemented in Airy, and Stokes2.

◆ New() [1/2]

Foam::autoPtr< Foam::waveModel > New ( const objectRegistry db,
const dictionary dict 
)
static

Select.

Definition at line 31 of file newWaveModel.C.

References dict, dictionary::lookup(), and Foam::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 objectRegistry db,
const dictionary dict 
)
static

Select.

Definition at line 41 of file newWaveModel.C.

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

Here is the call graph for this function:

◆ length()

scalar length ( ) const
inline

Get the length.

Definition at line 156 of file waveModel.H.

◆ amplitude()

scalar amplitude ( const scalar  t) const
inline

Get the amplitude.

Definition at line 162 of file waveModel.H.

◆ phase()

scalar phase ( ) const
inline

Get the phase.

Definition at line 168 of file waveModel.H.

◆ depth()

scalar depth ( ) const
inline

Get the depth.

Definition at line 174 of file waveModel.H.

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

Here is the call graph for this function:

◆ elevation()

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

Get the wave elevation at a given time, mean velocity and local.

coordinates. Local x is aligned with the mean velocity.

Implemented in Airy, and Stokes2.

Referenced by waveModel::depth().

Here is the caller graph for this function:

◆ velocity()

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

Get the wave velocity at a given time, mean velocity and local.

coordinates. Local x is aligned with the mean velocity, and z with negative gravity.

Implemented in Airy, and Stokes2.

Referenced by waveModel::depth().

Here is the caller graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 110 of file waveModel.C.

References token::END_STATEMENT, Foam::nl, and Ostream::writeKeyword().

Referenced by waveModel::depth().

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

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