57 S, S_lag1, S_lag2, S_lag3, bdf_coeffs, dt, n)
58 integer,
intent(in) :: n
59 real(kind=
rp),
dimension(n),
intent(out) :: entropy_residual
60 real(kind=
rp),
dimension(n),
intent(in) :: s, s_lag1, s_lag2, s_lag3
61 real(kind=
rp),
intent(in) :: bdf_coeffs(4)
62 real(kind=
rp),
intent(in) :: dt
65 do concurrent(i = 1:n)
66 entropy_residual(i) = (bdf_coeffs(1) * s(i) &
67 - bdf_coeffs(2) * s_lag1(i) &
68 - bdf_coeffs(3) * s_lag2(i) &
69 - bdf_coeffs(4) * s_lag3(i)) / dt
82 entropy_residual, h, c_avisc_entropy, n_S, n)
83 integer,
intent(in) :: n
84 real(kind=
rp),
dimension(n),
intent(out) :: reg_coeff
85 real(kind=
rp),
dimension(n),
intent(in) :: entropy_residual, h
86 real(kind=
rp),
intent(in) :: c_avisc_entropy, n_s
89 do concurrent(i = 1:n)
90 reg_coeff(i) = c_avisc_entropy * h(i) * h(i) * entropy_residual(i) / n_s
100 integer,
intent(in) :: lx, nelv
101 real(kind=
rp),
dimension(lx, lx, lx, nelv),
intent(inout) :: reg_coeff
102 integer :: i, j, k, el
103 real(kind=
rp) :: max_visc_el
111 max_visc_el =
max(max_visc_el, reg_coeff(i, j, k, el))
119 reg_coeff(i, j, k, el) = max_visc_el
134 h, max_wave_speed, c_avisc_low, n)
135 integer,
intent(in) :: n
136 real(kind=
rp),
dimension(n),
intent(inout) :: reg_coeff
137 real(kind=
rp),
dimension(n),
intent(in) :: h, max_wave_speed
138 real(kind=
rp),
intent(in) :: c_avisc_low
140 real(kind=
rp) :: low_order_visc
142 do concurrent(i = 1:n)
143 low_order_visc = c_avisc_low * h(i) * max_wave_speed(i)
144 reg_coeff(i) = min(reg_coeff(i), low_order_visc)
155 temp_field, mult_field, n)
156 integer,
intent(in) :: n
157 real(kind=
rp),
dimension(n),
intent(out) :: reg_coeff
158 real(kind=
rp),
dimension(n),
intent(in) :: temp_field, mult_field
161 do concurrent(i = 1:n)
162 reg_coeff(i) = temp_field(i) / mult_field(i)
CPU backend for entropy viscosity regularization.
subroutine, public entropy_viscosity_compute_viscosity_cpu(reg_coeff, entropy_residual, h, c_avisc_entropy, n_s, n)
Compute viscosity from entropy residual on CPU.
subroutine, public entropy_viscosity_compute_residual_cpu(entropy_residual, s, s_lag1, s_lag2, s_lag3, bdf_coeffs, dt, n)
Compute entropy residual on CPU.
subroutine, public entropy_viscosity_smooth_divide_cpu(reg_coeff, temp_field, mult_field, n)
Divide by multiplicity for smoothing on CPU.
subroutine, public entropy_viscosity_clamp_to_low_order_cpu(reg_coeff, h, max_wave_speed, c_avisc_low, n)
Clamp regularization coefficient to low-order viscosity on CPU.
subroutine, public entropy_viscosity_apply_element_max_cpu(reg_coeff, lx, nelv)
Apply element-wise maximum on CPU.
integer, parameter, public rp
Global precision used in computations.