43 Foam::scalar Foam::waveModels::Airy::readLength
45 const dictionary&
dict,
47 const scalar amplitude,
49 scalar (*celerityPtr)(
const AiryCoeffs&)
52 const bool haveLength =
dict.found(
"length");
53 const bool havePeriod =
dict.found(
"period");
55 if (haveLength == havePeriod)
58 <<
"Exactly one of either length or period must be specified"
64 return dict.lookup<scalar>(
"length");
73 dict.lookup<scalar>(
"period"),
95 amplitude_(
wave.amplitude_, false),
96 length_(
wave.length_),
105 const word& modelName,
110 depth_(
dict.lookupOrDefault<scalar>(
"depth", great)),
112 length_(readLength(
dict, depth_, amplitude(), g, celerityPtr)),
113 phase_(
dict.lookup<scalar>(
"phase"))
115 const scalar
c = celerityPtr(
coeffs());
117 Info<< waveModel::typeName <<
": " << modelName
118 <<
": period = " << length_/
c
119 <<
", length = " << length_ <<
endl;;
133 return celerity(coeffs());
143 return amplitude(t)*
cos(coeffs().angle(phase_, t,
x));
153 const scalar ka = coeffs().k()*amplitude(t);
163 if (!coeffs().deep())
Macros for easy insertion into run-time selection tables.
Run-time selectable general function of one variable.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for managing temporary objects.
Generic base class for waves. Derived classes must implement field functions which return the elevati...
scalar g() const
Get the value of gravity.
virtual void write(Ostream &os) const
Write.
Calculation engine for the Airy wave model and other models that are a correction on top of the Airy ...
static scalar celerity(const AiryCoeffs &coeffs)
The wave celerity [m/s].
scalar amplitude() const
Get the amplitude at steady state.
virtual scalar celerity() const
The wave celerity [m/s].
virtual ~Airy()
Destructor.
AiryCoeffs coeffs() const
Return the wave coefficients at steady state.
virtual tmp< scalarField > elevation(const scalar t, const scalarField &x) const
Get the wave elevation at a given time and local coordinates. Local.
virtual void write(Ostream &os) const
Write.
virtual tmp< vector2DField > velocity(const scalar t, const vector2DField &xz) const
Get the wave velocity at a given time and local coordinates. Local.
scalar depth() const
Get the depth.
Airy(const Airy &wave)
Construct a copy.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const dimensionedScalar c
Speed of light in a vacuum.
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.
defineTypeNameAndDebug(Airy, 0)
addToRunTimeSelectionTable(waveModel, Airy, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimLength
const dimensionSet dimTime
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
dimensionedScalar cos(const dimensionedScalar &ds)