66 const scalar magDSurf =
mag(dSurf);
69 axes =
tensor(dSurfHat, - gHat ^ dSurfHat, - gHat);
71 drift = - axes &
UMean_->integral(0, t);
88 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
89 result += waveModels_[wavei].elevation(t, d & (drift + xy));
92 return scale(xy)*result;
105 forAll(waveModels_, wavei)
107 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
123 waveModels_[wavei].velocity(t, xz)
152 result[i] *= scale_->value(
x[i]);
156 if (crossScale_.valid())
161 result[i] *= crossScale_->value(
y[i]);
178 db.time().constant(),
193 db.time().userUnits(),
204 db.time().userUnits(),
216 db.time().userUnits(),
222 heightAboveWave_(lookupOrDefault<
Switch>(
"heightAboveWave", false))
251 forAll(waveEntries, wavei)
253 const dictionary waveDict = waveEntries[wavei].dict();
274 scalar maxCelerity = 0;
275 forAll(waveModels_, wavei)
277 maxCelerity =
max(waveModels_[wavei].celerity(), maxCelerity);
280 return mag(maxCelerity + (direction_ & UMean_->value(t)));
293 transformation(t,
p, axes, drift, xyz);
315 transformation(t,
p, axes, drift, xyz);
317 if (heightAboveWave_)
322 return UMean_->value(t) + (velocity(t, drift, xyz) & axes);
335 transformation(t,
p, axes, drift, xyz);
337 axes =
tensor(- axes.
x(), - axes.
y(), axes.
z());
339 if (heightAboveWave_)
346 return UMean_->value(t) + (velocity(t, drift, xyz) & axes);
355 forAll(waveModels_, wavei)
359 waveModels_[wavei].
write(os);
369 if (crossScale_.valid())
373 if (heightAboveWave_)
375 writeEntry(os,
"heightAboveWave", heightAboveWave_);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Run-time selectable general function of one variable.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const objectRegistry & db() const
Return the local objectRegistry.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
static const word & constant()
Return constant name.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const word dictName() const
Return the local dictionary name (final part of scoped name)
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Registry of regIOobjects.
const Time & time() const
Return time.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
bool foundObject(const word &name) const
Is the named Type in registry.
void store()
Transfer ownership of this object to its registry.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
static autoPtr< waveModel > New(const dictionary &dict, const scalar g)
Select.
A wrapper around a list of wave models. Superimposes the modelled values of elevation and velocity....
tmp< scalarField > elevation(const scalar t, const vector2D &drift, const vector2DField &xy) const
Get the wave elevation relative to the mean at a given time and.
const autoPtr< Function1< vector > > UMean_
Mean velocity.
const vector origin_
The origin of the wave coordinate system.
virtual tmp< scalarField > height(const scalar t, const vectorField &p) const
Get the height above the waves at a given time and global positions.
virtual tmp< vectorField > ULiquid(const scalar t, const vectorField &p) const
Get the liquid velocity at a given time and global positions.
virtual tmp< vectorField > UGas(const scalar t, const vectorField &p) const
Get the gas velocity at a given time and global positions.
waveSuperposition(const objectRegistry &db)
Construct from a database.
static const word dictName
The name of the dictionary.
tmp< scalarField > scale(const vector2DField &xy) const
Get the scaling factor, calculated from the optional scaling.
void transformation(const scalar t, const vectorField &p, tensor &axes, vector &drift, vectorField &xyz) const
Get the transformation to actual coordinates.
~waveSuperposition()
Destructor.
scalarList waveAngles_
The angle relative to the direction at which the waves propagate.
const vector direction_
The direction of the wave coordinate system.
virtual bool write(const bool write=true) const
Inherit write from regIOobject.
PtrList< waveModel > waveModels_
Wave models to superimpose.
scalar maxWaveSpeed(const scalar t) const
Return the maximum wave speed for the given time t.
tmp< vectorField > velocity(const scalar t, const vector &drift, const vectorField &xyz) const
Get the wave velocity at a given time and local coordinates. Local.
A class for handling words, derived from string.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Vector2D< scalar > vector2D
vector2D obtained from generic Vector2D
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Tensor< scalar > tensor
Tensor of scalars.
const dimensionSet dimless
dimensionedScalar sin(const dimensionedScalar &ds)
const dimensionSet dimLength
const dimensionSet dimAcceleration
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
UniformDimensionedField< vector > uniformDimensionedVectorField
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimVelocity
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
tmp< vector2DField > zip(const tmp< scalarField > &x, const tmp< scalarField > &y)
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar cos(const dimensionedScalar &ds)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.