45 irregularMultiDirectional,
54 Foam::scalar Foam::waveModels::irregularMultiDirectional::eta
66 scalar phaseTot = Kx*
x + Ky*
y - omega*t + phase;
67 return H*0.5*
cos(phaseTot);
82 for (label i=1; i<=100; ++i)
104 forAll(irregWaveHeights_, ii)
106 forAll(irregWaveHeights_[ii], jj)
112 waveKs*
x*
cos(irregWaveDirs_[ii][jj])
113 + waveKs*
y*
sin(irregWaveDirs_[ii][jj])
115 + irregWavePhases_[ii][jj];
119 irregWaveHeights_[ii][jj],
125 irregWaveDirs_[ii][jj]
149 forAll(irregWaveHeights_, ii)
151 forAll(irregWaveHeights_[ii], jj)
160 irregWaveHeights_[ii][jj],
161 waveKs*
cos(irregWaveDirs_[ii][jj]),
163 waveKs*
sin(irregWaveDirs_[ii][jj]),
167 irregWavePhases_[ii][jj]
172 level[paddlei] = waterDepthRef_ + tCoeff*eta;
180 const scalar irregWaveOmega,
182 const scalar irregWaveKs,
185 const scalar irregDir
188 const scalar ksh = irregWaveKs*hh;
189 const scalar ksz = irregWaveKs*zz;
192 irregH*0.5*irregWaveOmega*
cos(pha)*(
cosh(ksz)/
sinh(ksh))*
cos(irregDir);
195 irregH*0.5*irregWaveOmega*
cos(pha)*(
cosh(ksz)/
sinh(ksh))*
sin(irregDir);
219 setPaddlePropeties(level, facei, fraction, z);
223 const label paddlei = faceToPaddle_[facei];
234 U_[facei] = fraction*
Uf*tCoeff;
268 readEntry(
"wavePeriods", irregWavePeriods_);
269 readEntry(
"waveHeights", irregWaveHeights_);
270 readEntry(
"wavePhases", irregWavePhases_);
271 readEntry(
"waveDirs", irregWaveDirs_);
273 irregWaveLengths_ = irregWaveHeights_;
275 forAll(irregWaveHeights_, ii)
277 forAll(irregWaveHeights_[ii], jj)
279 irregWaveLengths_[ii][jj] =
280 waveLength(waterDepthRef_, irregWavePeriods_[ii][jj]);
281 irregWaveDirs_[ii][jj] =
297 os <<
" Wave periods : " << irregWavePeriods_.size() <<
nl 298 <<
" Wave heights : " << irregWaveHeights_.size() <<
nl 299 <<
" Wave phases : " << irregWavePhases_.size() <<
nl 300 <<
" Wave lengths : " << irregWaveLengths_.size() <<
nl 301 <<
" Wave directions : " << irregWaveDirs_.size() <<
nl;
Different types of constants.
dimensionedScalar tanh(const dimensionedScalar &ds)
virtual scalar waveLength(const scalar h, const scalar T) const
Return the wavelength.
virtual void setLevel(const scalar t, const scalar tCoeff, scalarField &level) const
Set the water level.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const vector L(dict.get< vector >("L"))
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar cos(const dimensionedScalar &ds)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
constexpr scalar twoPi(2 *M_PI)
constexpr scalar pi(M_PI)
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
virtual vector uMultiDirec(const scalar irregH, const scalar irregWaveOmega, const scalar phaseTot, const scalar irregWaveKs, const scalar z, const scalar h, const scalar irregDir) const
autoPtr< surfaceVectorField > Uf
virtual void setVelocity(const scalar t, const scalar tCoeff, const scalarField &level)
Calculate the wave model velocity.
InfoProxy< IOobject > info() const noexcept
Return info proxy, for printing information to a stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionedScalar h
Planck constant.
virtual vector Uf(const scalar d, const scalar x, const scalar y, const scalar t, const scalar z) const
Wave velocity.
dimensionedScalar sinh(const dimensionedScalar &ds)
Mesh data needed to do the Finite Volume discretisation.
const std::string patch
OpenFOAM patch number as a std::string.
irregularMultiDirectional(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
dimensionedScalar cosh(const dimensionedScalar &ds)
A patch is a list of labels that address the faces in the global face list.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
volScalarField H(IOobject("H", runTime.timeName(), mesh.thisDb(), IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)