125 n_x, n_y, n_z, h, tau_x, tau_y, tau_z, n_nodes, lx, nelv, &
126 kappa, mu_w, rho_w, g_vec, Pr, z0, z0h_in, bc_type, bc_value, tstep, &
127 Ri_b_diagn, L_ob_diagn, utau_diagn, magu_diagn, ti_diagn, ts_diagn,&
128 q_diagn, h_x_idx, h_y_idx, h_z_idx)
129 integer,
intent(in) :: n_nodes, lx, nelv, tstep
130 real(kind=
rp),
dimension(lx, lx, lx, nelv),
intent(in) :: u, v, w, temp
131 integer,
intent(in),
dimension(n_nodes) :: ind_r, ind_s, ind_t, ind_e
132 real(kind=
rp),
dimension(n_nodes),
intent(in) :: n_x, n_y, n_z, h
133 real(kind=
rp),
intent(in) :: kappa, z0, z0h_in, bc_value, pr
134 real(kind=
rp),
dimension(3),
intent(in) :: g_vec
135 real(kind=
rp),
dimension(n_nodes),
intent(in) :: mu_w, rho_w
136 real(kind=
rp) :: g_dot_n
137 character(len=*),
intent(in) :: bc_type
138 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: tau_x, tau_y, tau_z
140 real(kind=
rp) :: ui, vi, wi, hi, rho, mu
141 real(kind=
rp) :: normu, z0h
143 real(kind=
rp),
parameter :: tol = 0.001_rp
144 real(kind=
rp),
parameter :: nr_step = 0.001_rp
145 real(kind=
rp),
parameter :: ri_threshold = 0.0001_rp
146 character(len=LOG_SIZE) :: log_buf
147 real(kind=
rp) :: utau, ri_b, l_ob, magu, q, ti, ts
148 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: ri_b_diagn, l_ob_diagn
149 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: utau_diagn, magu_diagn
150 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: ti_diagn, ts_diagn
151 real(kind=
rp),
dimension(n_nodes),
intent(inout) :: q_diagn
152 integer,
dimension(n_nodes),
intent(in) :: h_x_idx
153 integer,
dimension(n_nodes),
intent(in) :: h_y_idx
154 integer,
dimension(n_nodes),
intent(in) :: h_z_idx
158 ui = u(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
159 vi = v(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
160 wi = w(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
161 ti = temp(ind_r(i), ind_s(i), ind_t(i), ind_e(i))
167 normu = ui * n_x(i) + vi * n_y(i) + wi * n_z(i)
168 ui = ui - normu * n_x(i)
169 vi = vi - normu * n_y(i)
170 wi = wi - normu * n_z(i)
173 magu = sqrt(ui**2 + vi**2 + wi**2)
174 magu =
max(magu, 1.0e-6_rp)
175 utau = magu*kappa / log(hi/z0)
180 z0h = z0 * exp(z0h_in*sqrt((utau*z0)/(mu/rho)))
190 g_dot_n = abs(g_vec(1)*n_x(i) + g_vec(2)*n_y(i) + g_vec(3)*n_z(i))
193 call compute_ri_b(bc_type, g_dot_n, hi, ti, ts, magu, kappa, q, ri_b)
199 utau = sqrt(
tau_ptr(magu, ri_b, hi, z0, l, kappa))
200 select case (bc_type)
203 ts = ti - (q * pr * log(hi/z0h)) / (
max(utau, 1e-6_rp) * kappa)
207 q =
heat_flux_ptr(ti, ts, ri_b, hi, magu, z0h, pr, l, utau, kappa)
209 call neko_error(
"Invalid specified temperature b.c. type " // &
210 "('neumann' or 'dirichlet'?)")
215 magu =
max(magu, 1.0e-6_rp)
216 tau_x(i) = -rho*utau**2 * ui / magu
217 tau_y(i) = -rho*utau**2 * vi / magu
218 tau_z(i) = -rho*utau**2 * wi / magu
219 if (abs(ri_b) <= ri_threshold)
then
223 l_ob = -(ts*utau**3)/(kappa*g_dot_n*q)
231 ts_diagn(i) = temp(ind_r(i) - h_x_idx(i), ind_s(i) - h_y_idx(i), &
232 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.