65 const vector dSurf = direction_ - gHat*(gHat & direction_);
66 const scalar magDSurf =
mag(dSurf);
67 const vector dSurfHat = direction_/magDSurf;
69 axes =
tensor(dSurfHat, - gHat ^ dSurfHat, - gHat);
71 drift = - axes & UMean_->integral(0, t);
73 xyz = axes & (p - origin_);
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)
127 d.
x()*uw.component(0),
128 d.
y()*uw.component(0),
152 result[i] *= scale_->value(
x[i]);
156 if (crossScale_.valid())
161 result[i] *= crossScale_->value(
y[i]);
178 db.time().constant(),
184 origin_(
lookup(
"origin")),
185 direction_(
lookup(
"direction")),
201 heightAboveWave_(lookupOrDefault<
Switch>(
"heightAboveWave", false))
230 forAll(waveEntries, wavei)
232 const dictionary waveDict = waveEntries[wavei].dict();
304 axes =
tensor(- axes.
x(), - axes.
y(), axes.
z());
tmp< vector2DField > zip(const tmp< scalarField > &x, const tmp< scalarField > &y)
Run-time selectable general function of one variable.
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< vectorField > UGas(const scalar t, const vectorField &p) const
Get the gas velocity at a given time and global positions.
Ostream & indent(Ostream &os)
Indent stream.
const vector origin_
The origin of the wave coordinate system.
void write(Ostream &) const
Write.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
UniformDimensionedField< vector > uniformDimensionedVectorField
A list of keyword definitions, which are a keyword followed by any number of values (e...
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.
const vector direction_
The direction of the wave coordinate system.
T & ref() const
Return non-const reference or generate a fatal error.
const autoPtr< Function1< vector > > UMean_
Mean velocity.
void size(const label)
Override size to be inconsistent with allocated storage.
scalarList waveAngles_
The angle relative to the direction at which the waves propagate.
Vector2D< scalar > vector2D
vector2D obtained from generic Vector2D
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
~waveSuperposition()
Destructor.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
bool foundObject(const word &name) const
Is the named Type found?
virtual tmp< vectorField > ULiquid(const scalar t, const vectorField &p) const
Get the liquid velocity at a given time and global positions.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
const Switch heightAboveWave_
Calculate wave properties using the height above the wave (true) or.
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const word dictName() const
Return the local dictionary name (final part of scoped name)
const autoPtr< Function1< scalar > > crossScale_
Scaling perpendicular to the local x-direction.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void transformation(const scalar t, const vectorField &p, tensor &axes, vector &drift, vectorField &xyz) const
Get the transformation to actual coordinates.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual tmp< scalarField > height(const scalar t, const vectorField &p) const
Get the height above the waves at a given time and global positions.
dimensionedScalar cos(const dimensionedScalar &ds)
const dimensionSet dimAcceleration
const autoPtr< Function1< scalar > > scale_
Scaling in the local x-direction.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word & constant() const
Return constant name.
const Type & value() const
Return const reference to value.
PtrList< waveModel > waveModels_
Wave models to superimpose.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
void store()
Transfer ownership of this object to its registry.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void setSize(const label)
Reset size of List.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
dimensioned< scalar > mag(const dimensioned< Type > &)
static autoPtr< waveModel > New(const dictionary &dict, const scalar g)
Select.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
tmp< scalarField > scale(const vector2DField &xy) const
Get the scaling factor, calculated from the optional scaling.
A class for managing temporary objects.
Registry of regIOobjects.
const dimensionedVector & g
const objectRegistry & db() const
Return the local objectRegistry.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.
Tensor< scalar > tensor
Tensor of scalars.
static const Vector< scalar > zero
const word dictName("noiseDict")
waveSuperposition(const objectRegistry &db)
Construct from a database.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.