65 n_x, n_y, n_z, nu, rho_w, h, tau_x, tau_y, tau_z, n_nodes, &
66 kappa, C, B1, B2, tstep)
67 integer,
intent(in) :: n_nodes, tstep
68 real(kind=
rp),
dimension(n_nodes),
intent(in) :: u, v, w
69 real(kind=
rp),
dimension(n_nodes),
intent(in) :: rho_w
70 real(kind=
rp),
dimension(n_nodes),
intent(in) :: n_x, n_y, n_z, h, nu
71 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: tau_x, tau_y, tau_z
72 real(kind=
rp),
intent(in) :: kappa, c, b1, b2
74 real(kind=
rp) :: ui, vi, wi, magu, utau, normu, guess, rho
85 normu = ui * n_x(i) + vi * n_y(i) + wi * n_z(i)
87 ui = ui - normu * n_x(i)
88 vi = vi - normu * n_y(i)
89 wi = wi - normu * n_z(i)
91 magu = sqrt(ui**2 + vi**2 + wi**2)
102 guess = tau_x(i)**2 + tau_y(i)**2 + tau_z(i)**2
103 if (tstep .eq. 1 .or. guess .le. 0.0_rp)
then
104 guess = sqrt(magu * nu(i) / h(i))
106 guess = sqrt(sqrt(guess) / rho)
109 utau =
solve_cpu(magu, h(i), guess, nu(i), kappa, c, b1, b2)
112 tau_x(i) = -rho*utau**2 * ui / magu
113 tau_y(i) = -rho*utau**2 * vi / magu
114 tau_z(i) = -rho*utau**2 * wi / magu
127 real(kind=
rp),
intent(in) :: yp, kappa, c, b1, b2
130 up = log(1.0_rp + kappa*yp) / kappa + c * &
131 (1.0_rp - exp(-yp/b1) - yp/b1 * exp(-yp/b2))
141 real(kind=
rp),
intent(in) :: yp, kappa, c, b1, b2
144 dup = 1.0_rp / (1.0_rp + kappa*yp) + c / b1 * &
145 (exp(-yp/b1) - (1.0_rp - yp/b2) * exp(-yp/b2))
158 function solve_cpu(u, y, guess, nu, kappa, C, B1, B2)
result(utau)
159 real(kind=
rp),
intent(in) :: u
160 real(kind=
rp),
intent(in) :: y
161 real(kind=
rp),
intent(in) :: guess
162 real(kind=
rp),
intent(in) :: nu, kappa, c, b1, b2
163 real(kind=
rp) :: yp, up, utau
164 real(kind=
rp) :: error, f, df, old, tol
165 integer :: k, maxiter
167 character(len=LOG_SIZE) :: log_msg
187 if (utau .le. 0.0_rp) utau = 0.5_rp * old
189 error = abs((old - utau)/old)
191 if (error .lt. tol)
then
197 if (.not. converged)
then
200 write(log_msg, *)
"Newton not converged", error, f, utau
integer, parameter, public neko_log_debug
Debug.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
real(kind=rp), parameter, public neko_eps
Machine epsilon .
integer, parameter, public rp
Global precision used in computations.
Implements the CPU kernel for the reichardt_t type.
pure real(kind=rp) function reichardt_dup(yp, kappa, c, b1, b2)
Evaluate the derivative du+/dy+ of Reichardt's law of the wall.
subroutine, public reichardt_compute_cpu(u, v, w, n_x, n_y, n_z, nu, rho_w, h, tau_x, tau_y, tau_z, n_nodes, kappa, c, b1, b2, tstep)
Compute the wall shear stress on cpu using Reichardt's law.
pure real(kind=rp) function reichardt_up(yp, kappa, c, b1, b2)
Evaluate Reichardt's law of the wall, u+ as a function of y+.
real(kind=rp) function solve_cpu(u, y, guess, nu, kappa, c, b1, b2)
Newton solver for the algebraic equation defined by the law on cpu. Solves f(utau) = utau * u+(y utau...