38 use json_module,
only : json_file
56 real(kind=
rp) :: kappa = 0.41_rp
58 real(kind=
rp) :: b = 0.0_rp
60 real(kind=
rp) :: z0 = 0.0_rp
65 procedure, pass(this) :: init_from_components => &
83 type(
coef_t),
intent(in) :: coef
84 integer,
intent(in) :: msk(:)
85 integer,
intent(in) :: facet(:)
86 real(kind=
rp),
intent(in) :: nu
87 integer,
intent(in) :: h_index
88 type(json_file),
intent(inout) :: json
89 real(kind=
rp) :: kappa, b, z0
95 call this%init_from_components(coef, msk, facet, nu, h_index, kappa, b, z0)
108 nu, h_index, kappa, B, z0)
110 type(
coef_t),
intent(in) :: coef
111 integer,
intent(in) :: msk(:)
112 integer,
intent(in) :: facet(:)
113 real(kind=
rp),
intent(in) :: nu
114 integer,
intent(in) :: h_index
115 real(kind=
rp),
intent(in) :: kappa
116 real(kind=
rp),
intent(in) :: b
117 real(kind=
rp),
intent(in) :: z0
120 call neko_error(
"The rough loglaw is only available on the CPU backend.")
123 call this%init_base(coef, msk, facet, nu, h_index)
135 call this%free_base()
144 real(kind=
rp),
intent(in) :: t
145 integer,
intent(in) :: tstep
150 real(kind=
rp) :: ui, vi, wi, magu, utau, normu
156 do i = 1, this%n_nodes
158 ui = u%x(this%ind_r(i), this%ind_s(i), this%ind_t(i), this%ind_e(i))
159 vi = v%x(this%ind_r(i), this%ind_s(i), this%ind_t(i), this%ind_e(i))
160 wi = w%x(this%ind_r(i), this%ind_s(i), this%ind_t(i), this%ind_e(i))
163 normu = ui * this%n_x%x(i) + vi * this%n_y%x(i) + wi * this%n_z%x(i)
165 ui = ui - normu * this%n_x%x(i)
166 vi = vi - normu * this%n_y%x(i)
167 wi = wi - normu * this%n_z%x(i)
169 magu = sqrt(ui**2 + vi**2 + wi**2)
172 utau = (magu - this%B) * this%kappa / log(this%h%x(i) / this%z0)
175 this%tau_x(i) = -utau**2 * ui / magu
176 this%tau_y(i) = -utau**2 * vi / magu
177 this%tau_z(i) = -utau**2 * wi / magu
183 end module rough_log_law
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.
Defines a mapping of the degrees of freedom.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Utilities for retrieving parameters from the case files.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Implements rough_log_law_t.
subroutine rough_log_law_init_from_components(this, coef, msk, facet, nu, h_index, kappa, B, z0)
Constructor from components.
subroutine rough_log_law_init(this, coef, msk, facet, nu, h_index, json)
Constructor from JSON.
subroutine rough_log_law_free(this)
Destructor for the rough_log_law_t (base) class.
subroutine rough_log_law_compute(this, t, tstep)
Compute the wall shear stress.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Wall model based on the log-law for a rough wall. The formula defining the law is ....
Base abstract type for wall-stress models for wall-modelled LES.