62 const vector dSurf = direction_ - gHat*(gHat & direction_);
63 const scalar magDSurf =
mag(dSurf);
64 const vector dSurfHat = direction_/magDSurf;
66 axes =
tensor(dSurfHat, - gHat ^ dSurfHat, - gHat);
68 xyz = axes & (p - origin_ - UMean_->integrate(0, t));
82 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
83 result += waveModels_[wavei].elevation(t, d & xy);
86 return scale(xy)*result;
100 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
111 waveModels_[wavei].velocity(t, xz)
115 d.
x()*uw.component(0),
116 d.
y()*uw.component(0),
135 forAll(waveModels_, wavei)
137 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
148 waveModels_[wavei].velocity(t, xz)
150 result += waveModels_[wavei].pressure(t, xz);
172 result[i] *= scale_->value(
x[i]);
176 if (crossScale_.valid())
181 result[i] *= crossScale_->value(
y[i]);
198 db.time().constant(),
204 origin_(
lookup(
"origin")),
205 direction_(
lookup(
"direction")),
221 heightAboveWave_(lookupOrDefault<
Switch>(
"heightAboveWave", false))
228 forAll(waveEntries, wavei)
230 const dictionary waveDict = waveEntries[wavei].dict();
294 axes =
tensor(- axes.
x(), - axes.
y(), axes.
z());
336 axes =
tensor(- axes.
x(), - axes.
y(), axes.
z());
tmp< vector2DField > zip(const tmp< scalarField > &x, const tmp< scalarField > &y)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
#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.
virtual tmp< scalarField > pLiquid(const scalar t, const vectorField &p) const
Get the liquid pressure at a given time and global positions.
tmp< scalarField > pressure(const scalar t, const vectorField &xyz) const
Get the wave pressure at a given time and local coordinates. Local.
A list of keyword definitions, which are a keyword followed by any number of values (e...
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.
~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.
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 Switch heightAboveWave_
Calculate wave properties using the height above the wave (true) or.
Macros for easy insertion into run-time selection tables.
tmp< scalarField > elevation(const scalar t, const vector2DField &xy) const
Get the wave elevation relative to the mean at a given time and.
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))
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)
virtual tmp< scalarField > pGas(const scalar t, const vectorField &p) const
Get the gas pressure at a given time and global positions.
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 Type & value() const
Return const reference to value.
const word dictName("particleTrackDict")
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
PtrList< waveModel > waveModels_
Wave models to superimpose.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
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)
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
static autoPtr< waveModel > New(const objectRegistry &db, const dictionary &dict)
Select.
tmp< vectorField > velocity(const scalar t, const vectorField &xyz) const
Get the wave velocity at a given time and local coordinates. Local.
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 > &)
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.
void transformation(const scalar t, const vectorField &p, tensor &axes, vectorField &xyz) const
Get the transformation to actual coordinates.
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...
Tensor< scalar > tensor
Tensor of scalars.
static const Vector< scalar > zero
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.