122 n_x, n_y, n_z, h, tau_x, tau_y, tau_z, n_nodes, lx, nelv, &
123 kappa, mu_w, rho_w, g_vec, Pr, z0, z0h_in, bc_type, bc_value, tstep, &
124 Ri_b_diagn, L_ob_diagn, utau_diagn, magu_diagn, ti_diagn, ts_diagn,&
125 q_diagn, h_x_idx, h_y_idx, h_z_idx)
126 integer,
intent(in) :: n_nodes, lx, nelv, tstep
127 real(kind=
rp),
dimension(lx, lx, lx, nelv),
intent(in) :: u, v, w, temp
128 integer,
intent(in),
dimension(n_nodes) :: ind_r, ind_s, ind_t, ind_e
129 real(kind=
rp),
dimension(n_nodes),
intent(in) :: n_x, n_y, n_z, h
130 real(kind=
rp),
intent(in) :: kappa, z0, z0h_in, bc_value, pr
131 real(kind=
rp),
dimension(3),
intent(in) :: g_vec
132 real(kind=
rp),
dimension(n_nodes),
intent(in) :: mu_w, rho_w
133 real(kind=
rp) :: g_dot_n
134 character(len=*),
intent(in) :: bc_type
135 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: tau_x, tau_y, tau_z
137 real(kind=
rp) :: ui, vi, wi, hi, rho, mu
138 real(kind=
rp) :: normu, z0h
140 real(kind=
rp),
parameter :: tol = 0.001_rp
141 real(kind=
rp),
parameter :: nr_step = 0.001_rp
142 real(kind=
rp),
parameter :: ri_threshold = 0.0001_rp
143 character(len=LOG_SIZE) :: log_buf
144 real(kind=
rp) :: utau, ri_b, l_ob, magu, q, ti, ts
145 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: ri_b_diagn, l_ob_diagn
146 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: utau_diagn, magu_diagn
147 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: ti_diagn, ts_diagn
148 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: q_diagn
149 integer,
dimension(n_nodes),
intent(in) :: h_x_idx
150 integer,
dimension(n_nodes),
intent(in) :: h_y_idx
151 integer,
dimension(n_nodes),
intent(in) :: h_z_idx
155 ui = u(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
156 vi = v(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
157 wi = w(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
158 ti = temp(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
164 normu = ui * n_x(i) + vi * n_y(i) + wi * n_z(i)
165 ui = ui - normu * n_x(i)
166 vi = vi - normu * n_y(i)
167 wi = wi - normu * n_z(i)
170 magu = sqrt(ui**2 + vi**2 + wi**2)
171 magu =
max(magu, 1.0e-6_rp)
172 utau = magu*kappa / log(hi/z0)
177 z0h = z0 * exp(z0h_in*sqrt((utau*z0)/(mu/rho)))
187 g_dot_n = abs(g_vec(1)*n_x(i) + g_vec(2)*n_y(i) + g_vec(3)*n_z(i))
190 call compute_ri_b(bc_type, g_dot_n, hi, ti, ts, magu, kappa, q, ri_b)
196 utau = sqrt(
tau_ptr(magu, ri_b, hi, z0, l, kappa))
197 select case (bc_type)
200 ts = ti - (q * pr * log(hi/z0h)) / (
max(utau, 1e-6_rp) * kappa)
204 q =
heat_flux_ptr(ti, ts, ri_b, hi, magu, z0h, pr, l, utau, kappa)
206 call neko_error(
"Invalid specified temperature b.c. type ('neumann' or 'dirichlet'?)")
210 magu =
max(magu, 1.0e-6_rp)
211 tau_x(i) = -rho*utau**2 * ui / magu
212 tau_y(i) = -rho*utau**2 * vi / magu
213 tau_z(i) = -rho*utau**2 * wi / magu
214 if (abs(ri_b) <= ri_threshold)
then
218 l_ob = -(ts*utau**3)/(kappa*g_dot_n*q)
226 ts_diagn(i) = temp(ind_r(i)-h_x_idx(i), ind_s(i)-h_y_idx(i), ind_t(i)-h_z_idx(i), ind_e(i))
subroutine, public richardson_compute_cpu(u, v, w, temp, ind_r, ind_s, ind_t, ind_e, n_x, n_y, n_z, h, tau_x, tau_y, tau_z, n_nodes, lx, nelv, kappa, mu_w, rho_w, g_vec, pr, z0, z0h_in, bc_type, bc_value, tstep, ri_b_diagn, l_ob_diagn, utau_diagn, magu_diagn, ti_diagn, ts_diagn, q_diagn, h_x_idx, h_y_idx, h_z_idx)
Main routine to compute the surface stresses based on richardson.