68 scalar Xa = -
C*t + ts -
X0 +
x*
cos(theta) +
y*
sin(theta);
84 scalar m = newtonRapsonF1(xin,
H,
h);
87 scalar c1 =
sin(m + (1.0 + (2.0*
H/(3.0*
h))));
88 scalar
n = (2.0/3.0)*
sqr(c1);
103 scalar maxval = 10000.0;
111 scalar a =
x + 1.0 + 2.0*
H/(3.0*
h);
112 scalar
b = 0.5*
x*(1.0 +
H/
h);
113 scalar c = 0.5*
x*(1.0 +
h/
H);
115 scalar fx = (2.0/3.0)*
sqr(c1) -
x*
H/(
h*
tan(
b));
123 else if ((iter > 1) && (residual > maxval))
126 <<
"Newton-Raphson iterations diverging: "
127 <<
"iterations = " << iter
128 <<
", residual = " << residual
133 scalar c2 = 1.0/
tan(c);
134 scalar c3 = 1.0/
sin(
b);
136 scalar fprime = (4.0/3.0)*c1*
cos(a) - c2*
h/
H -
b*
sqr(c3);
143 <<
"Failed to converge in " << iter <<
" iterations. Residual = "
144 << residual <<
nl <<
endl;
162 scalar maxval = 10000;
170 scalar a = m*(1.0 +
x/
h);
174 scalar fx =
x - (
h*
n/m*(c2/(c1 +
cosh(m*xa/
h))));
182 else if ((iter > 1) && (residual > maxval))
185 <<
"Newton-Raphson iterations diverging: "
186 <<
"iterations = " << iter
187 <<
", residual = " << residual
192 scalar c3 =
cosh(xa*m/
h) + c1;
193 scalar fprime = 1 -
n/c3*(c1 -
sqr(c2)/c3);
200 <<
"Failed to converge in " << iter <<
" iterations. Residual = "
201 << residual <<
nl <<
endl;
220 const scalar mm = vec[0];
221 const scalar nn = vec[1];
224 const scalar ts = 3.5*
h/
sqrt(
H/
h);
225 const scalar Xa = -
C*t + ts -
X0 +
x*
cos(theta) +
y*
sin(theta);
227 scalar outa =
C*nn*(1.0 +
cos(mm*z/
h)*
cosh(mm*Xa/
h));
230 scalar u = outa/outb;
234 const scalar w = outa/outb;
236 const scalar v = u*
sin(waveAngle_);
237 u *=
cos(waveAngle_);
264 level[paddlei] = waterDepthRef_ + tCoeff*eta;
292 if (solitaryWaveModel::readDict(overrideDict))
316 setPaddlePropeties(level, facei, fraction, z);
320 const label paddlei = faceToPaddle_[facei];
334 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.
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,...
InfoProxy< ensightCells > info() const
Return info proxy.
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.
virtual scalar newtonRapsonF2(const scalar x0, const scalar H, const scalar h, const scalar xa, const scalar m, const scalar n) const
virtual scalar newtonRapsonF1(const scalar x0, const scalar H, const scalar h) const
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 vector mn(const scalar H, const scalar h) const
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, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
autoPtr< surfaceVectorField > Uf
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar cosh(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
scalarList X0(nSpecie, Zero)
#define forAll(list, i)
Loop across all elements in list.
const Vector< label > N(dict.get< Vector< label > >("N"))