34#ifndef __FLUID_EULER_RES_KERNEL__
35#define __FLUID_EULER_RES_KERNEL__
39 T * __restrict__ rhs_m_x,
40 T * __restrict__ rhs_m_y,
41 T * __restrict__ rhs_m_z,
42 T * __restrict__ rhs_E,
43 const T * __restrict__ visc_rho,
44 const T * __restrict__ visc_m_x,
45 const T * __restrict__ visc_m_y,
46 const T * __restrict__ visc_m_z,
47 const T * __restrict__ visc_E,
48 const T * __restrict__ Binv,
52 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
53 const int str = blockDim.x * gridDim.x;
55 for (
int i = idx;
i < n;
i += str) {
57 rhs_rho[
i] = -rhs_rho[
i] - Bi * visc_rho[
i];
58 rhs_m_x[
i] = -rhs_m_x[
i] - Bi * visc_m_x[
i];
59 rhs_m_y[
i] = -rhs_m_y[
i] - Bi * visc_m_y[
i];
60 rhs_m_z[
i] = -rhs_m_z[
i] - Bi * visc_m_z[
i];
61 rhs_E[
i] = -rhs_E[
i] - Bi * visc_E[
i];
70 const T * __restrict__ m_x,
71 const T * __restrict__ m_y,
72 const T * __restrict__ m_z,
73 const T * __restrict__ rho_field,
74 const T * __restrict__ p,
77 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
78 const int str = blockDim.x * gridDim.x;
80 for (
int i = idx;
i < n;
i += str) {
81 f_x[
i] = m_x[
i] * m_x[
i] / rho_field[
i] + p[
i];
82 f_y[
i] = m_x[
i] * m_y[
i] / rho_field[
i];
83 f_z[
i] = m_x[
i] * m_z[
i] / rho_field[
i];
91 const T * __restrict__ m_x,
92 const T * __restrict__ m_y,
93 const T * __restrict__ m_z,
94 const T * __restrict__ rho_field,
95 const T * __restrict__ p,
98 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
99 const int str = blockDim.x * gridDim.x;
101 for (
int i = idx;
i < n;
i += str) {
102 f_x[
i] = m_y[
i] * m_x[
i] / rho_field[
i];
103 f_y[
i] = m_y[
i] * m_y[
i] / rho_field[
i] + p[
i];
104 f_z[
i] = m_y[
i] * m_z[
i] / rho_field[
i];
108template<
typename T >
110 T * __restrict__ f_y,
111 T * __restrict__ f_z,
112 const T * __restrict__ m_x,
113 const T * __restrict__ m_y,
114 const T * __restrict__ m_z,
115 const T * __restrict__ rho_field,
116 const T * __restrict__ p,
119 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
120 const int str = blockDim.x * gridDim.x;
122 for (
int i = idx;
i < n;
i += str) {
123 f_x[
i] = m_z[
i] * m_x[
i] / rho_field[
i];
124 f_y[
i] = m_z[
i] * m_y[
i] / rho_field[
i];
125 f_z[
i] = m_z[
i] * m_z[
i] / rho_field[
i] + p[
i];
129template<
typename T >
131 T * __restrict__ f_y,
132 T * __restrict__ f_z,
133 const T * __restrict__ m_x,
134 const T * __restrict__ m_y,
135 const T * __restrict__ m_z,
136 const T * __restrict__ rho_field,
137 const T * __restrict__ p,
138 const T * __restrict__ E,
141 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
142 const int str = blockDim.x * gridDim.x;
144 for (
int i = idx;
i < n;
i += str) {
145 f_x[
i] = (E[
i] + p[
i]) * m_x[
i] / rho_field[
i];
146 f_y[
i] = (E[
i] + p[
i]) * m_y[
i] / rho_field[
i];
147 f_z[
i] = (E[
i] + p[
i]) * m_z[
i] / rho_field[
i];
151template<
typename T >
153 T * __restrict__ rhs_m_x,
154 T * __restrict__ rhs_m_y,
155 T * __restrict__ rhs_m_z,
156 T * __restrict__ rhs_E,
157 const T * __restrict__ mult,
160 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
161 const int str = blockDim.x * gridDim.x;
163 for (
int i = idx;
i < n;
i += str) {
164 rhs_rho[
i] = rhs_rho[
i] * mult[
i];
165 rhs_m_x[
i] = rhs_m_x[
i] * mult[
i];
166 rhs_m_y[
i] = rhs_m_y[
i] * mult[
i];
167 rhs_m_z[
i] = rhs_m_z[
i] * mult[
i];
168 rhs_E[
i] = rhs_E[
i] * mult[
i];
172template<
typename T >
174 T * __restrict__ m_x,
175 T * __restrict__ m_y,
176 T * __restrict__ m_z,
178 const T * __restrict__ k_rho_i,
179 const T * __restrict__ k_m_x_i,
180 const T * __restrict__ k_m_y_i,
181 const T * __restrict__ k_m_z_i,
182 const T * __restrict__ k_E_i,
187 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
188 const int str = blockDim.x * gridDim.x;
190 for (
int i = idx;
i < n;
i += str) {
191 rho[
i] = rho[
i] +
dt * c * k_rho_i[
i];
192 m_x[
i] = m_x[
i] +
dt * c * k_m_x_i[
i];
193 m_y[
i] = m_y[
i] +
dt * c * k_m_y_i[
i];
194 m_z[
i] = m_z[
i] +
dt * c * k_m_z_i[
i];
195 E[
i] = E[
i] +
dt * c * k_E_i[
i];
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ h1
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dt
__global__ void compressible_res_part_coef_mult_kernel(T *__restrict__ rhs_rho, T *__restrict__ rhs_m_x, T *__restrict__ rhs_m_y, T *__restrict__ rhs_m_z, T *__restrict__ rhs_E, const T *__restrict__ mult, const int n)
__global__ void inviscid_res_part_my_flux_kernel(T *__restrict__ f_x, T *__restrict__ f_y, T *__restrict__ f_z, const T *__restrict__ m_x, const T *__restrict__ m_y, const T *__restrict__ m_z, const T *__restrict__ rho_field, const T *__restrict__ p, const int n)
__global__ void compressible_res_part_visc_kernel(T *__restrict__ rhs_rho, T *__restrict__ rhs_m_x, T *__restrict__ rhs_m_y, T *__restrict__ rhs_m_z, T *__restrict__ rhs_E, const T *__restrict__ visc_rho, const T *__restrict__ visc_m_x, const T *__restrict__ visc_m_y, const T *__restrict__ visc_m_z, const T *__restrict__ visc_E, const T *__restrict__ Binv, T *__restrict__ h1, const int n)
__global__ void inviscid_res_part_mz_flux_kernel(T *__restrict__ f_x, T *__restrict__ f_y, T *__restrict__ f_z, const T *__restrict__ m_x, const T *__restrict__ m_y, const T *__restrict__ m_z, const T *__restrict__ rho_field, const T *__restrict__ p, const int n)
__global__ void compressible_res_part_rk_sum_kernel(T *__restrict__ rho, T *__restrict__ m_x, T *__restrict__ m_y, T *__restrict__ m_z, T *__restrict__ E, const T *__restrict__ k_rho_i, const T *__restrict__ k_m_x_i, const T *__restrict__ k_m_y_i, const T *__restrict__ k_m_z_i, const T *__restrict__ k_E_i, const T dt, const T c, const int n)
__global__ void inviscid_res_part_E_flux_kernel(T *__restrict__ f_x, T *__restrict__ f_y, T *__restrict__ f_z, const T *__restrict__ m_x, const T *__restrict__ m_y, const T *__restrict__ m_z, const T *__restrict__ rho_field, const T *__restrict__ p, const T *__restrict__ E, const int n)
__global__ void inviscid_res_part_mx_flux_kernel(T *__restrict__ f_x, T *__restrict__ f_y, T *__restrict__ f_z, const T *__restrict__ m_x, const T *__restrict__ m_y, const T *__restrict__ m_z, const T *__restrict__ rho_field, const T *__restrict__ p, const int n)