Neko 1.99.5
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
most.f90
Go to the documentation of this file.
1! Copyright (c) 2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
33!
35module most
36 use field, only : field_t
37 use num_types, only : rp
38 use json_module, only : json_file
39 use coefs, only : coef_t
41 use wall_model, only : wall_model_t
46 use most_cpu, only : most_compute_cpu
49 use logger, only : log_size, neko_log
50 use vector, only : vector_t
52 use math, only: masked_gather_copy_0
54 use, intrinsic :: iso_c_binding, only : c_ptr, c_null_ptr, c_associated
56 implicit none
57 private
58
63 type, public, extends(wall_model_t) :: most_t
65 real(kind=rp) :: kappa
67 real(kind=rp) :: pr
69 real(kind=rp) :: z0
71 real(kind=rp) :: z0h_in
72 ! The dynamic viscosity at the boundary
73 type(vector_t) :: mu_w
74 ! The fluid density at the boundary
75 type(vector_t) :: rho_w
77 real(kind=rp) :: g(3)
79 character(len=:), allocatable :: bc_type
81 real(kind=rp) :: bc_value
83 character(len=:), allocatable :: scalar_name
85 type(vector_t) :: ri_b, l_ob, utau, magu, ti, ts, q
86 integer, allocatable :: h_x_idx(:), h_y_idx(:), h_z_idx(:)
87 type(c_ptr) :: h_x_idx_d = c_null_ptr
88 type(c_ptr) :: h_y_idx_d = c_null_ptr
89 type(c_ptr) :: h_z_idx_d = c_null_ptr
90 contains
92 procedure, pass(this) :: init => most_init
95 procedure, pass(this) :: partial_init => most_partial_init
97 procedure, pass(this) :: finalize => most_finalize
99 procedure, pass(this) :: init_from_components => &
102 procedure, pass(this) :: free => most_free
104 procedure, pass(this) :: compute => most_compute
105 ! Extract fluid properties at the wall (mu and rho)
106 procedure, pass(this) :: extract_properties => most_extract_properties
107 end type most_t
108
109contains
117 subroutine most_init(this, scheme_name, coef, msk, facet, &
118 h_index, json)
119 class(most_t), intent(inout) :: this
120 character(len=*), intent(in) :: scheme_name
121 type(coef_t), intent(in) :: coef
122 integer, intent(in) :: msk(:)
123 integer, intent(in) :: facet(:)
124 integer, intent(in) :: h_index
125 type(json_file), intent(inout) :: json
126 real(kind=rp) :: kappa, z0, z0h_in, pr
127 character(len=:), allocatable :: bc_type
128 character(len=:), allocatable :: scalar_name
129 real(kind=rp) :: bc_value
130 real(kind=rp), allocatable :: g_tmp(:)
131 real(kind=rp) :: g(3)
132 logical :: if_time_dependent
133
134 call json_get_or_lookup_or_default(json, "kappa", kappa, 0.4_rp)
135 call json_get_or_lookup_or_default(json, "Pr", pr, 1.0_rp)
136 call json_get_or_lookup(json, "z0", z0)
137 ! If z0h is specified and positive, z0h will be constant and equal to
138 ! what's specified in the case file.
139 ! If z0h is specified and negative, the Zilitinkevich 1995 formulation
140 ! is used, with the specified value acting as -C_Zil.
141 ! If z0h is not specified, assign to have the same value as z0.
142 call json_get_or_lookup_or_default(json, "z0h", z0h_in, z0)
143 call json_get(json, "type_of_temp_bc", bc_type)
144 call json_get(json, "scalar_field", scalar_name)
145 call json_get_or_lookup(json, "bottom_bc_flux_or_temp", bc_value)
146 call json_get_or_default(json, "time_dependent_temp_bc", &
147 if_time_dependent, .false.)
148
149 if (if_time_dependent) then
150 call neko_const_registry%add_real_scalar(bc_value, "bc_value")
151 end if
152
153 call json_get_or_lookup(json, "g", g_tmp)
154 if (size(g_tmp) == 3) then
155 g = g_tmp
156 else
157 call neko_error("MOST WM: The gravity vector should have " // &
158 "exactly 3 components")
159 end if
160 deallocate(g_tmp)
161
162 call this%init_from_components(scheme_name, scalar_name, coef, msk, &
163 facet, h_index, &
164 kappa, g, pr, z0, z0h_in, bc_type, bc_value)
165 deallocate(bc_type)
166 deallocate(scalar_name)
167 end subroutine most_init
168
172 subroutine most_partial_init(this, coef, json)
173 class(most_t), intent(inout) :: this
174 type(coef_t), intent(in) :: coef
175 type(json_file), intent(inout) :: json
176 real(kind=rp), allocatable :: g_tmp(:)
177 character(len=LOG_SIZE) :: log_buf
178 logical :: if_time_dependent
179
180 call this%partial_init_base(coef, json)
181 call json_get_or_lookup_or_default(json, "kappa", this%kappa, 0.4_rp)
182 call json_get_or_lookup_or_default(json, "Pr", this%Pr, 1.0_rp)
183 call json_get_or_lookup(json, "z0", this%z0)
184 call json_get_or_lookup_or_default(json, "z0h", this%z0h_in, this%z0)
185 call json_get(json, "type_of_temp_bc", this%bc_type)
186 call json_get(json, "scalar_field", this%scalar_name)
187 call json_get_or_lookup(json, "bottom_bc_flux_or_temp", this%bc_value)
188 call json_get_or_default(json, "time_dependent_temp_bc", &
189 if_time_dependent, .false.)
190
191 if (if_time_dependent) then
192 call neko_const_registry%add_real_scalar(this%bc_value, "bc_value")
193 end if
194
195
196 call json_get_or_lookup(json, "g", g_tmp)
197 if (size(g_tmp) == 3) then
198 this%g = g_tmp
199 else
200 call neko_error("MOST WM: The gravity vector should have " // &
201 "exactly 3 components")
202 end if
203 deallocate(g_tmp)
204
205 call neko_log%section('Wall model')
206 write(log_buf, '(A, A)') 'Model : MOST'
207 call neko_log%message(log_buf)
208 write(log_buf, '(A, A)') 'scalar_name : ', trim(this%scalar_name)
209 call neko_log%message(log_buf)
210 write(log_buf, '(A, A)') 'bc_type : ', trim(this%bc_type)
211 call neko_log%message(log_buf)
212 write(log_buf, '(A, E15.7)') 'bc_value : ', this%bc_value
213 call neko_log%message(log_buf)
214 write(log_buf, '(A, E15.7)') 'kappa : ', this%kappa
215 call neko_log%message(log_buf)
216 write(log_buf, '(A, E15.7)') 'z0 : ', this%z0
217 call neko_log%message(log_buf)
218 write(log_buf, '(A, E15.7)') 'z0h : ', this%z0h_in
219 call neko_log%message(log_buf)
220 write(log_buf, '(A, E15.7)') 'Pr : ', this%Pr
221 call neko_log%message(log_buf)
222 write(log_buf, '(A, 3(E15.7,1X))') 'g : ', this%g
223 call neko_log%message(log_buf)
224 call neko_log%end_section()
225
226 end subroutine most_partial_init
227
231 subroutine most_finalize(this, msk, facet)
232 class(most_t), intent(inout) :: this
233 integer, intent(in) :: msk(:)
234 integer, intent(in) :: facet(:)
235 integer :: i, fid
236
237
238 call this%finalize_base(msk, facet)
239
240 call this%Ri_b%init(this%n_nodes)
241 call this%L_ob%init(this%n_nodes)
242 call this%utau%init(this%n_nodes)
243 call this%magu%init(this%n_nodes)
244 call this%ti%init(this%n_nodes)
245 call this%ts%init(this%n_nodes)
246 call this%q%init(this%n_nodes)
247
248 call this%mu_w%init(this%n_nodes)
249 call this%rho_w%init(this%n_nodes)
250
251 allocate(this%h_x_idx(this%n_nodes))
252 allocate(this%h_y_idx(this%n_nodes))
253 allocate(this%h_z_idx(this%n_nodes))
254 if (neko_bcknd_device .eq. 1) then
255 call device_map(this%h_x_idx, this%h_x_idx_d, this%n_nodes)
256 call device_map(this%h_y_idx, this%h_y_idx_d, this%n_nodes)
257 call device_map(this%h_z_idx, this%h_z_idx_d, this%n_nodes)
258 end if
259
260 do i = 1, this%n_nodes
261 fid = this%facet(i)
262 select case (fid)
263 case (1)
264 this%h_x_idx(i) = this%h_index
265 this%h_y_idx(i) = 0
266 this%h_z_idx(i) = 0
267 case (2)
268 this%h_x_idx(i) = - this%h_index
269 this%h_y_idx(i) = 0
270 this%h_z_idx(i) = 0
271 case (3)
272 this%h_x_idx(i) = 0
273 this%h_y_idx(i) = this%h_index
274 this%h_z_idx(i) = 0
275 case (4)
276 this%h_x_idx(i) = 0
277 this%h_y_idx(i) = - this%h_index
278 this%h_z_idx(i) = 0
279 case (5)
280 this%h_x_idx(i) = 0
281 this%h_y_idx(i) = 0
282 this%h_z_idx(i) = this%h_index
283 case (6)
284 this%h_x_idx(i) = 0
285 this%h_y_idx(i) = 0
286 this%h_z_idx(i) = - this%h_index
287 case default
288 call neko_error("The face index is not correct (most.f90)")
289 end select
290
291 end do
292 if (neko_bcknd_device .eq. 1) then
293 call device_memcpy(this%h_x_idx, this%h_x_idx_d, this%n_nodes, &
294 host_to_device, sync = .false.)
295 call device_memcpy(this%h_y_idx, this%h_y_idx_d, this%n_nodes, &
296 host_to_device, sync = .false.)
297 call device_memcpy(this%h_z_idx, this%h_z_idx_d, this%n_nodes, &
298 host_to_device, sync = .false.)
299 end if
300 end subroutine most_finalize
301
303 subroutine most_extract_properties(this)
304 class(most_t), intent(inout) :: this
305
306 if (neko_bcknd_device .eq. 1) then
307 call device_masked_gather_copy_0(this%mu_w%x_d, this%mu%x_d, &
308 this%msk_d, &
309 this%mu%size(), this%mu_w%size())
310 call device_masked_gather_copy_0(this%rho_w%x_d, this%rho%x_d, &
311 this%msk_d, &
312 this%rho%size(), this%rho_w%size())
313 else
314 call masked_gather_copy_0(this%mu_w%x, this%mu%x, this%msk, &
315 this%mu%size(), this%mu_w%size())
316 call masked_gather_copy_0(this%rho_w%x, this%rho%x, this%msk, &
317 this%rho%size(), this%rho_w%size())
318 end if
319 end subroutine most_extract_properties
320
335 subroutine most_init_from_components(this, scheme_name, scalar_name, &
336 coef, msk, facet, h_index, kappa, g, Pr, z0, &
337 z0h_in, bc_type, bc_value)
338 class(most_t), intent(inout) :: this
339 character(len=*), intent(in) :: scheme_name
340 character(len=*), intent(in) :: bc_type
341 character(len=*), intent(in) :: scalar_name
342 type(coef_t), intent(in) :: coef
343 integer, intent(in) :: msk(:)
344 integer, intent(in) :: facet(:)
345 integer, intent(in) :: h_index
346 real(kind=rp), intent(in) :: g(3)
347 real(kind=rp) :: g_mag, g_dot_n, cos_alpha, max_ang
348 integer :: i
349 real(kind=rp), intent(in) :: kappa
350 real(kind=rp), intent(in) :: z0, z0h_in, bc_value, pr
351 character(len=LOG_SIZE) :: log_buf
352
353 call this%free()
354 call this%init_base(scheme_name, coef, msk, facet, h_index)
355
356 this%kappa = kappa
357 this%g = g
358 this%Pr = pr
359 this%z0 = z0
360 this%z0h_in = z0h_in
361 this%bc_type = bc_type
362 this%bc_value = bc_value
363 this%scalar_name = scalar_name
364
365 call this%mu_w%init(this%n_nodes)
366 call this%rho_w%init(this%n_nodes)
367
369 g_mag = sqrt(sum(g**2))
370 if (g_mag < 1.0e-6_rp) then
371 call neko_error("MOST WM: Gravity magnitude is zero. Check " // &
372 "your input configuration.")
373 end if
374
376 max_ang = 0.0_rp
377 do i = 1, this%n_nodes
378 g_dot_n = abs(g(1) * this%n_x%x(i) + g(2) * this%n_y%x(i) + &
379 g(3) * this%n_z%x(i))
380 cos_alpha = g_dot_n / g_mag
381 max_ang = max(max_ang, acos(min(1.0_rp, cos_alpha)))
382 end do
383 max_ang = max_ang * 180.0_rp / (4.0_rp * atan(1.0_rp))
384 if (max_ang > 8.0_rp) then
385 write(log_buf, '(A, F6.2, A)') &
386 "MOST WM: Significant gravity-normal misalignment (max ", &
387 max_ang, " deg). Stability corrections will use projected gravity."
388 call neko_warning(trim(log_buf))
389 end if
390
392 if (any(this%h%x(1:this%n_nodes) .le. this%z0)) then
393 call neko_error("MOST WM: Sampling height h must be greater " // &
394 "than roughness z0.")
395 else if ((this%z0h_in .gt. 0.0_rp) .and. &
396 any(this%h%x(1:this%n_nodes) .le. this%z0h_in)) then
397 call neko_error("MOST WM: Sampling height h must be greater " // &
398 "than thermal roughness z0h.")
399 else if (this%z0 .eq. 0.0_rp) then
400 call neko_error("MOST WM: Roughness z0 must be greater than 0.")
401 else if (this%z0h_in .eq. 0.0_rp) then
402 call neko_error("MOST WM: Thermal roughness z0h must be greater than 0.")
403 end if
404
405 end subroutine most_init_from_components
406
408 subroutine most_free(this)
409 class(most_t), intent(inout) :: this
410
411 if (allocated(this%bc_type)) then
412 deallocate(this%bc_type)
413 end if
414
415 if (allocated(this%scalar_name)) then
416 deallocate(this%scalar_name)
417 end if
418
419 call this%mu_w%free()
420 call this%rho_w%free()
421 call this%free_base()
422
423 call this%Ri_b%free()
424 call this%L_ob%free()
425 call this%utau%free()
426 call this%magu%free()
427 call this%ti%free()
428 call this%ts%free()
429 call this%q%free()
430
431 if (allocated(this%h_x_idx)) then
432 if (c_associated(this%h_x_idx_d)) then
433 call device_unmap(this%h_x_idx, this%h_x_idx_d)
434 end if
435 deallocate(this%h_x_idx)
436 end if
437
438 if (allocated(this%h_y_idx)) then
439 if (c_associated(this%h_y_idx_d)) then
440 call device_unmap(this%h_y_idx, this%h_y_idx_d)
441 end if
442 deallocate(this%h_y_idx)
443 end if
444
445 if (allocated(this%h_z_idx)) then
446 if (c_associated(this%h_z_idx_d)) then
447 call device_unmap(this%h_z_idx, this%h_z_idx_d)
448 end if
449 deallocate(this%h_z_idx)
450 end if
451
452 end subroutine most_free
453
457 subroutine most_compute(this, t, tstep)
458 class(most_t), intent(inout) :: this
459 real(kind=rp), intent(in) :: t
460 integer, intent(in) :: tstep
461 type(field_t), pointer :: u
462 type(field_t), pointer :: v
463 type(field_t), pointer :: w
464 type(field_t), pointer :: temp
465 real(kind=rp), pointer :: updated_bc_value
466
467 ! Extract boundary values for mu and rho
468 call this%extract_properties()
469
470 u => neko_registry%get_field("u")
471 v => neko_registry%get_field("v")
472 w => neko_registry%get_field("w")
473 temp => neko_registry%get_field(this%scalar_name)
474
475 if (neko_const_registry%real_scalar_exists("bc_value")) then
476 updated_bc_value => neko_const_registry%get_real_scalar("bc_value")
477 this%bc_value = updated_bc_value
478 end if
479
480 if (neko_bcknd_device .eq. 1) then
481 call most_compute_device(u%x_d, v%x_d, w%x_d, temp%x_d, &
482 this%ind_r_d, this%ind_s_d, this%ind_t_d, &
483 this%ind_e_d, this%n_x%x_d, this%n_y%x_d, this%n_z%x_d, &
484 this%h%x_d, this%tau_x%x_d, this%tau_y%x_d, &
485 this%tau_z%x_d, this%n_nodes, u%Xh%lx, this%kappa, &
486 this%mu_w%x_d, this%rho_w%x_d, this%g, this%Pr, this%z0, &
487 this%z0h_in, &
488 this%bc_type, this%bc_value, tstep, this%Ri_b%x_d, &
489 this%L_ob%x_d, this%utau%x_d, this%magu%x_d, this%ti%x_d, &
490 this%ts%x_d, &
491 this%q%x_d, this%h_x_idx_d, this%h_y_idx_d, this%h_z_idx_d)
492 else
493 call most_compute_cpu(u%x, v%x, w%x, temp%x, this%ind_r, &
494 this%ind_s, this%ind_t, this%ind_e, this%n_x%x, &
495 this%n_y%x, this%n_z%x, this%h%x, this%tau_x%x, &
496 this%tau_y%x, this%tau_z%x, this%n_nodes, u%Xh%lx, &
497 u%msh%nelv, this%kappa, this%mu_w%x, this%rho_w%x, &
498 this%g, this%Pr, this%z0, this%z0h_in, this%bc_type, &
499 this%bc_value, tstep, this%Ri_b%x, this%L_ob%x, &
500 this%utau%x, this%magu%x, this%ti%x, this%ts%x, &
501 this%q%x, this%h_x_idx, this%h_y_idx, this%h_z_idx)
502 end if
503
504 call most_log_diagnostics(this%Ri_b, this%L_ob, &
505 this%utau, this%magu, this%ti, this%ts, this%q, &
506 this%n_nodes, this%bc_value)
507
508 nullify(u, v, w, temp, updated_bc_value)
509
510 end subroutine most_compute
511
512 subroutine most_log_diagnostics(Ri_b, L_ob, utau, magu, ti, ts, q, &
513 n_nodes, bc_value)
514 character(len=LOG_SIZE) :: log_buf
515 integer, intent(in) :: n_nodes
516 real(kind=rp), intent(in) :: bc_value
517 type(vector_t), intent(in) :: ri_b, l_ob, utau
518 type(vector_t), intent(in) :: magu, ti, ts, q
519
520 call neko_log%section("Wall model diagnostics")
521 write(log_buf, '(A)') '--- sum --- ' !min max ---'
522 call neko_log%message(trim(log_buf))
523 write(log_buf,'(A,3E15.7)') "Ri_b: ",&
524 vector_glsum(ri_b, n_nodes) !, &
525 ! vector_glmin(Ri_b, n_nodes), vector_glmax(Ri_b, n_nodes)
526 call neko_log%message(trim(log_buf))
527
528 write(log_buf,'(A,3E15.7)') "L_ob: ", &
529 vector_glsum(l_ob, n_nodes)!, &
530 ! vector_glmin(L_ob, n_nodes), vector_glmax(L_ob, n_nodes)
531 call neko_log%message(trim(log_buf))
532
533 write(log_buf,'(A,3E15.7)') "utau: ", &
534 vector_glsum(utau, n_nodes)!, &
535 ! vector_glmin(utau, n_nodes), vector_glmax(utau, n_nodes)
536 call neko_log%message(trim(log_buf))
537
538 write(log_buf,'(A,3E15.7)') "magu: ", &
539 vector_glsum(magu, n_nodes)!, &
540 ! vector_glmin(magu, n_nodes), vector_glmax(magu, n_nodes)
541 call neko_log%message(trim(log_buf))
542
543 write(log_buf,'(A,3E15.7)') "ti: ", &
544 vector_glsum(ti, n_nodes)!, &
545 ! vector_glmin(ti, n_nodes), vector_glmax(ti, n_nodes)
546 call neko_log%message(trim(log_buf))
547
548 write(log_buf,'(A,3E15.7)') "ts: ", &
549 vector_glsum(ts, n_nodes)!, &
550 ! vector_glmin(ts, n_nodes), vector_glmax(ts, n_nodes)
551 call neko_log%message(trim(log_buf))
552
553 write(log_buf,'(A,3E15.7)') "q: ", &
554 vector_glsum(q, n_nodes)!, &
555 ! vector_glmin(q, n_nodes), vector_glmax(q, n_nodes)
556 call neko_log%message(trim(log_buf))
557
558 write(log_buf,'(A,E15.7)') "bc_value: ", bc_value
559 call neko_log%message(trim(log_buf))
560
561 call neko_log%end_section()
562
563 end subroutine most_log_diagnostics
564
565
566end module most
__inline__ __device__ void nonlinear_index(const int idx, const int lx, int *index)
Definition bc_utils.h:44
__global__ void most_compute(const T *__restrict__ u_d, const T *__restrict__ v_d, const T *__restrict__ w_d, const T *__restrict__ temp_d, const T *__restrict__ h_d, const T *__restrict__ n_x_d, const T *__restrict__ n_y_d, const T *__restrict__ n_z_d, const int *__restrict__ ind_r_d, const int *__restrict__ ind_s_d, const int *__restrict__ ind_t_d, const int *__restrict__ ind_e_d, T *__restrict__ tau_x_d, T *__restrict__ tau_y_d, T *__restrict__ tau_z_d, int n_nodes, int lx, T kappa, const T *__restrict__ mu_w_d, const T *__restrict__ rho_w_d, T g1, T g2, T g3, T Pr, T z0, T z0h_in, T bc_value, T *__restrict__ Ri_b_diagn, T *__restrict__ L_ob_diagn, T *__restrict__ utau_diagn, T *__restrict__ magu_diagn, T *__restrict__ ti_diagn, T *__restrict__ ts_diagn, T *__restrict__ q_diagn, const int *__restrict__ h_x_idx, const int *__restrict__ h_y_idx, const int *__restrict__ h_z_idx)
Map a Fortran array to a device (allocate and associate)
Definition device.F90:78
Copy data between host and device (or device and device)
Definition device.F90:72
Unmap a Fortran array from a device (deassociate and free)
Definition device.F90:84
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Coefficients.
Definition coef.f90:34
subroutine, public device_masked_gather_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Gather a masked vector .
Device abstraction, common interface for various accelerators.
Definition device.F90:34
integer, parameter, public host_to_device
Definition device.F90:48
Defines a field.
Definition field.f90:34
Utilities for retrieving parameters from the case files.
Logging routines.
Definition log.f90:34
type(log_t), public neko_log
Global log stream.
Definition log.f90:80
integer, parameter, public log_size
Definition log.f90:46
Definition math.f90:60
subroutine, public masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
Definition math.f90:360
Implements the CPU kernel for the most_t type.
Definition most_cpu.f90:34
subroutine, public most_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 MOST.
Definition most_cpu.f90:170
Implements the device kernel for the most_t type.
subroutine, public most_compute_device(u_d, v_d, w_d, temp_d, ind_r_d, ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, mu_w_d, rho_w_d, g, 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)
Compute the wall shear stress on device using the rough log-law model.
Implements most_t.
Definition most.f90:35
subroutine most_init(this, scheme_name, coef, msk, facet, h_index, json)
Constructor from JSON.
Definition most.f90:119
subroutine most_finalize(this, msk, facet)
Finalize the construction using the mask and facet arrays of the bc.
Definition most.f90:232
subroutine most_init_from_components(this, scheme_name, scalar_name, coef, msk, facet, h_index, kappa, g, pr, z0, z0h_in, bc_type, bc_value)
Constructor from components.
Definition most.f90:338
subroutine most_free(this)
Destructor for the most_t (base) class.
Definition most.f90:409
subroutine most_log_diagnostics(ri_b, l_ob, utau, magu, ti, ts, q, n_nodes, bc_value)
Definition most.f90:514
subroutine most_extract_properties(this)
Extract the values of rho and mu at the boundary.
Definition most.f90:304
subroutine most_partial_init(this, coef, json)
Constructor from JSON.
Definition most.f90:173
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:144
type(registry_t), target, public neko_const_registry
This registry is used to store user-defined scalars and vectors, provided under the constants section...
Definition registry.f90:150
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Utilities.
Definition utils.f90:35
subroutine, public neko_warning(warning_msg)
Reports a warning to standard output.
Definition utils.f90:398
real(kind=rp) function, public vector_glmin(a, n)
Global minimum of all elements in a vector .
real(kind=rp) function, public vector_glsum(a, n)
real(kind=rp) function, public vector_glmax(a, n)
Global maximum of all elements in a vector .
Defines a vector.
Definition vector.f90:34
Implements wall_model_t.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:62
Wall model based on the Monin-Obukhov Similarity Theory for atmospheric boundary layer flows....
Definition most.f90:63
Base abstract type for wall-stress models for wall-modelled LES.
#define max(a, b)
Definition tensor.cu:40