scalar cnoidalFirst::ddxPd ( const point & x, const scalar & time, const vector & unitVector ) const { scalar Z(returnZ(x)); scalar arg(argument(x,time)); scalar snn(0.0), cnn(0.0), dnn(0.0); gsl_sf_elljac_e( arg, m_, &snn, &cnn, &dnn); scalar ddxPd(0); ddxPd = rhoWater_ * Foam::mag(g_) * ( eta_x(snn, cnn, dnn) + 1.0 / 2.0 * Foam::pow(h_, 2.0) * (1 - Foam::pow((Z + h_) / h_, 2.0)) * eta_xxx(snn, cnn, dnn) ); ddxPd *= factor(time); // Info << "ddxPd still isn't implemented. Need to think about the gradient on arbitrary directed mesh with arbitrary wave number vector! and arbitrary g-direction!!!" << endl; return ddxPd; }
vector stokesFirstStanding::U ( const point& x, const scalar& time ) const { scalar Z(returnZ(x)); scalar Uhorz = PI_*H_/period_ * Foam::cosh(K_*(Z + h_))/Foam::sinh(K_*h_) * Foam::cos(omega_*time - (k_ & x) + phi_) - PI_*H_/period_ * Foam::cosh(K_*(Z + h_))/Foam::sinh(K_*h_) * Foam::cos(omega_*time + (k_ & x) + phi_); Uhorz *= factor(time); scalar Uvert = - PI_*H_/period_ * Foam::sinh(K_*(Z + h_))/Foam::sinh(K_*h_) * Foam::sin(omega_*time - (k_ & x) + phi_) - PI_*H_/period_ * Foam::sinh(K_*(Z + h_))/Foam::sinh(K_*h_) * Foam::sin(omega_*time + (k_ & x) + phi_); Uvert *= factor(time); // Note "-" because of "g" working in the opposite direction return Uhorz*k_/K_ - Uvert*direction_; }
vector cnoidalFirst::U ( const point & x, const scalar & time ) const { scalar Z(returnZ(x)); scalar arg(argument(x, time)); scalar snn(0.0), cnn(0.0), dnn(0.0); gsl_sf_elljac_e( arg, m_, &snn, &cnn, &dnn); scalar etaVal = eta(x,time); scalar Uhorz = celerity_ * ( etaVal / h_ - Foam::pow(etaVal / h_, 2.0) + 1.0 / 2.0 * ( 1.0 / 3.0 - Foam::pow((Z + h_) / h_, 2.0) ) * h_ * eta_xx(snn, cnn, dnn) ); Uhorz *= factor(time); scalar Uvert = - celerity_ * (Z + h_) * ( eta_x(snn, cnn, dnn) / h_ * (1 - 2.0 * etaVal / h_) + 1.0 / 6.0 * h_ * eta_xxx(snn, cnn, dnn) * (1 - Foam::pow((Z + h_) / h_, 2.0)) ); Uvert *= factor(time); return Uhorz * propagationDirection_ - Uvert * direction_; // Note "-" because of "g" working in the opposite direction }
scalar stokesFirstStanding::ddxPd ( const point& x, const scalar& time, const vector& unitVector ) const { scalar Z(returnZ(x)); scalar arg1(omega_*time - (k_ & x) + phi_); scalar arg2(omega_*time + (k_ & x) + phi_); scalar ddxPd(0); ddxPd = ( rhoWater_*mag(g_)*K_*H_/2.0*Foam::cosh(K_*(Z + h_)) /Foam::cosh(K_*h_)*Foam::sin(arg1) - rhoWater_*mag(g_)*K_*H_/2.0*Foam::cosh(K_*(Z + h_)) /Foam::cosh(K_*h_)*Foam::sin(arg2) )*factor(time); return ddxPd; }