48 const scalar amplitude,
50 scalar (*modelCelerity)(scalar, scalar, scalar, scalar)
53 const bool haveLength = dict.
found(
"length");
54 const bool havePeriod = dict.
found(
"period");
56 if (haveLength == havePeriod)
59 <<
"Exactly one of either length or period must be specified" 65 return dict.
lookup<scalar>(
"length");
69 const scalar period = dict.
lookup<scalar>(
"period");
77 const scalar length = (length0 + length1)/2;
79 const scalar t = length/modelCelerity(depth, amplitude, length, g);
81 (t < period ? length0 : length1) = length;
84 return (length0 + length1)/2;
99 return depth*
k(length) >
log(great);
106 const scalar amplitude,
111 return sqrt(g/
k(length)*
tanh(
k(length)*depth));
123 return phase_ +
k()*(x - celerity()*t);
139 const scalar kzGreat =
log(i*great);
148 const scalar kd =
k()*depth();
162 amplitude_(wave.amplitude_, false),
163 length_(wave.length_),
172 const word& modelName,
173 scalar (*modelCelerity)(scalar, scalar, scalar, scalar)
180 phase_(dict.
lookup<scalar>(
"phase"))
184 Info<< waveModel::typeName <<
": " << modelName
185 <<
": period = " << length_/c
186 <<
", length = " << length_ <<
endl;;
tmp< vector2DField > zip(const tmp< scalarField > &x, const tmp< scalarField > &y)
Run-time selectable general function of one variable.
dimensionedScalar tanh(const dimensionedScalar &ds)
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Airy(const Airy &wave)
Construct a copy.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
label log2(label i)
Return the log base 2 by successive bit-shifting of the given label.
defineTypeNameAndDebug(Airy, 0)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual tmp< scalarField > elevation(const scalar t, const scalarField &x) const
Get the wave elevation at a given time and local coordinates. Local.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool deep() const
Return whether shallow and intermediate effects are to be omitted.
virtual tmp< vector2DField > velocity(const scalar t, const vector2DField &xz) const
Get the wave velocity at a given time and local coordinates. Local.
label k
Boltzmann constant.
const dimensionedScalar c
Speed of light in a vacuum.
Macros for easy insertion into run-time selection tables.
virtual scalar celerity() const
The wave celerity [m/s].
tmp< scalarField > angle(const scalar t, const scalarField &x) const
Angle of the oscillation [rad].
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
Generic base class for waves. Derived classes must implement field functions which return the elevati...
A class for handling words, derived from string.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
scalar length() const
Get the length.
scalar depth() const
Get the depth.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
waveModel(const waveModel &wave)
Construct a copy.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
scalar amplitude() const
Get the amplitude at steady state.
addToRunTimeSelectionTable(waveModel, Airy, dictionary)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
dimensionedScalar sinh(const dimensionedScalar &ds)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
tmp< vector2DField > vi(const label i, const scalar t, const vector2DField &xz) const
Return the non-dimensionalised i-th harmonic of the velocity.
virtual void write(Ostream &os) const
Write.
dimensionedScalar cosh(const dimensionedScalar &ds)
A class for managing temporary objects.
virtual ~Airy()
Destructor.
label wave(const fvMesh &mesh, const List< labelPair > &changedPatchAndFaces, const label nCorrections, GeometricField< scalar, PatchField, GeoMesh > &distance, TrackingData &td, GeometricField< DataType, PatchField, GeoMesh > &... data)
Wave distance (and maybe additional) data from faces. If nCorrections is.
scalar k() const
The angular wavenumber [rad/m].
virtual void write(Ostream &os) const
Write.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.