59 return sqrt(0.75*eps)*(1.0 - 0.625*eps + (71.0/128.0)*eps*eps);
74 const scalar eps =
H/
h;
75 const scalar eps2 = eps*eps;
76 const scalar eps3 = eps*eps2;
79 sqrt(
mag(g_)*
h)*
sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
81 const scalar ts = 3.5*
h/
sqrt(
H/
h);
82 const scalar xa = -
C*t + ts -
X0 +
x*
cos(theta) +
y*
sin(theta);
83 const scalar alfa = this->alfa(
H,
h);
85 const scalar
s = (1.0)/(
cosh(alfa*(xa/
h)));
86 const scalar s2 =
s*
s;
87 const scalar q =
tanh(alfa*(xa/
h));
88 const scalar q2 = q*q;
95 + eps3*(0.625*s2*q2 - 1.2625*s2*s2*q2)
112 const scalar eps =
H/
h;
113 const scalar eps2 = eps*eps;
114 const scalar eps3 = eps*eps2;
117 sqrt(
mag(g_)*
h)*
sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
119 const scalar ts = 3.5*
h/
sqrt(eps);
120 const scalar xa = -
C*t + ts -
X0 +
x*
cos(theta) +
y*
sin(theta);
121 const scalar alfa = this->alfa(
H,
h);
123 const scalar
s = (1.0)/(
cosh(alfa*(xa/
h)));
124 const scalar s2 =
s*
s;
125 const scalar s4 = s2*s2;
126 const scalar s6 = s2*s4;
128 const scalar zbyh = z/
h;
129 const scalar zbyh2 = zbyh*zbyh;
130 const scalar zbyh4 = zbyh2*zbyh2;
132 scalar outa = eps*s2 - eps2*(-0.25*s2 + s4 + zbyh2*(1.5*s2 - 2.25*s4));
133 scalar outb = 0.475*s2 + 0.2*s4 - 1.2*s6;
134 scalar outc = zbyh2*(-1.5*s2 - 3.75*s4 + 7.5*s6);
135 scalar outd = zbyh4*(-0.375*s2 + (45.0/16.0)*s4 - (45.0/16.0)*s6);
137 scalar u =
sqrt(
mag(g_)*
h)*(outa - eps3*(outb + outc + outd));
139 outa = eps*s2 - eps2*(0.375*s2 + 2*s4 + zbyh2*(0.5*s2 - 1.5*s4));
140 outb = (49.0/640.0)*s2 - 0.85*s4 - 3.6*s6;
141 outc = zbyh2*((-13.0/16.0)*s2 -(25.0/16.0)*s4 + 7.5*s6);
142 outd = zbyh4*(-0.075*s2 -1.125*s4 - (27.0/16.0)*s6);
144 const scalar w =
sqrt(
mag(g_)*
h)*(outa - eps3*(outb + outc + outd));
189 solitaryWaveModel(
dict,
mesh, patch, false)
226 setPaddlePropeties(level, facei, fraction, z);
230 const label paddlei = faceToPaddle_[facei];
244 U_[facei] = fraction*
Uf*tCoeff;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Graphite solid properties.
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,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
A patch is a list of labels that address the faces in the global face list.
Base class for waveModels.
const vector & g_
Gravity.
vectorField U_
Velocity field.
scalar waterDepthRef_
Reference water depth / [m].
virtual void setPaddlePropeties(const scalarField &level, const label facei, scalar &fraction, scalar &z) const
Set the paddle coverage fraction and reference height.
scalarField yPaddle_
Paddle y coordinates / [m].
scalarField xPaddle_
Paddle x coordinates / [m].
labelList faceToPaddle_
Addressing from patch face index to paddle index.
Grimshaw(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
virtual void setVelocity(const scalar t, const scalar tCoeff, const scalarField &level)
Calculate the wave model velocity.
virtual void setLevel(const scalar t, const scalar tCoeff, scalarField &level) const
Set the water level.
virtual scalar alfa(const scalar H, const scalar h) const
virtual scalar eta(const scalar H, const scalar h, const scalar x, const scalar y, const scalar theta, const scalar t, const scalar X0) const
Wave height.
virtual vector Uf(const scalar H, const scalar h, const scalar x, const scalar y, const scalar theta, const scalar t, const scalar X0, const scalar z) const
Wave velocity.
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
solitaryWaveModel(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
scalar waveHeight_
Wave height / [m].
scalar waveAngle_
Wave angle / [rad] (read in degrees).
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
volScalarField H(IOobject("H", runTime.timeName(), mesh.thisDb(), IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
autoPtr< surfaceVectorField > Uf
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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 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.
dimensionedScalar cosh(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
scalarList X0(nSpecie, Zero)
#define forAll(list, i)
Loop across all elements in list.