63 const vector dSurf = direction_ - gHat*(gHat & direction_);
64 const scalar magDSurf =
mag(dSurf);
65 const vector dSurfHat = direction_/magDSurf;
67 axes =
tensor(dSurfHat, - gHat ^ dSurfHat, - gHat);
69 xyz = axes & (p - origin_ - UMean_->integral(0, t));
83 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
84 result += waveModels_[wavei].elevation(t, d & xy);
87 return scale(xy)*result;
101 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
112 waveModels_[wavei].velocity(t, xz)
116 d.
x()*uw.component(0),
117 d.
y()*uw.component(0),
136 forAll(waveModels_, wavei)
138 const vector2D d(
cos(waveAngles_[wavei]),
sin(waveAngles_[wavei]));
149 waveModels_[wavei].velocity(t, xz)
151 result += waveModels_[wavei].pressure(t, xz);
173 result[i] *= scale_->value(
x[i]);
177 if (crossScale_.valid())
182 result[i] *= crossScale_->value(
y[i]);
199 db.time().constant(),
205 origin_(
lookup(
"origin")),
206 direction_(
lookup(
"direction")),
222 heightAboveWave_(lookupOrDefault<
Switch>(
"heightAboveWave", false))
229 forAll(waveEntries, wavei)
231 const dictionary waveDict = waveEntries[wavei].dict();
295 axes =
tensor(- axes.
x(), - axes.
y(), axes.
z());
337 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.
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.
virtual Type value(const scalar x) const =0
Return value as a function of scalar x.
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.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
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.
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
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.