18 logger.startTimer(
"generateBC1");
20 real alpha = intgSchm.alphaImplicit[subStep];
23 real *bc1_r = thrust::raw_pointer_cast(&bc1[0]),
24 *q_r = thrust::raw_pointer_cast(&q[0]),
25 *dx = thrust::raw_pointer_cast(&(domInfo->dx[0])),
26 *dy = thrust::raw_pointer_cast(&(domInfo->dy[0])),
27 *dxD = thrust::raw_pointer_cast(&(domInfo->dxD[0])),
28 *dyD = thrust::raw_pointer_cast(&(domInfo->dyD[0]));
30 real *xminus = thrust::raw_pointer_cast(&(bc[
XMINUS][0])),
31 *xplus = thrust::raw_pointer_cast(&(bc[
XPLUS][0])),
32 *yminus = thrust::raw_pointer_cast(&(bc[
YMINUS][0])),
33 *yplus = thrust::raw_pointer_cast(&(bc[
YPLUS][0]));
35 real dx0, dx1, dy0, dy1,
36 nu = (*paramDB)[
"flow"][
"nu"].get<
real>(),
37 dt = (*paramDB)[
"simulation"][
"dt"].get<
real>();
41 const int blocksize = 256;
51 cusp::blas::fill(bc1, 0.0);
53 dim3 dimGridx(
int((nx - 0.5)/blocksize) + 1, 1),
54 dimGridy(
int((ny - 0.5)/blocksize) + 1, 1);
56 dim3 dimBlock(blocksize, 1);
63 dy1 = 0.5*(dy[0] + dy[1]);
65 C = alpha * 2.0 * nu / (dy0 * (dy0+dy1));
66 kernels::bc1DirichletU <<<dimGridx, dimBlock>>> (bc1_r, nx-1, nx, 0, 1, dxD, C, yminus);
69 C = alpha * 2.0 * nu / (dy[0] * (dy[0]+dy[1]));
70 kernels::bc1DirichletV <<<dimGridx, dimBlock>>> (bc1_r, nx, nx, numU, 0, 1, dyD, C, yminus, nx-1);
78 dy0 = 0.5*(dy[ny-2] + dy[ny-1]);
80 C = alpha * 2.0 * nu / (dy1 * (dy0+dy1));
81 kernels::bc1DirichletU <<<dimGridx, dimBlock>>> (bc1_r, nx-1, nx, (nx-1)*(ny-1), 1, dxD, C, yplus);
84 C = alpha * 2.0 * nu / (dy[ny-1] * (dy[ny-1]+dy[ny-2]));
85 kernels::bc1DirichletV <<<dimGridx, dimBlock>>> (bc1_r, nx, nx, numU, nx*(ny-2), 1, dyD, C, yplus, nx-1);
90 beta = bcInfo[
YPLUS][1].value * dt / (0.5 * dy[ny-1]);
91 dy0 = 0.5*(dy[ny-2] + dy[ny-1]);
93 C = alpha * 2.0 * nu / (dy1 * (dy0+dy1));
94 kernels::bc1ConvectiveU <<<dimGridx, dimBlock>>> (bc1_r, nx-1, nx, (nx-1)*(ny-1), 1, dxD, dyD, C, yplus, q_r, beta);
97 beta = bcInfo[
YPLUS][1].value * dt / dy[ny-1];
98 C = alpha * 2.0 * nu / (dy[ny-1] * (dy[ny-1]+dy[ny-2]));
99 kernels::bc1ConvectiveV <<<dimGridx, dimBlock>>> (bc1_r, nx, nx, numU, nx*(ny-2), 1, dxD, dyD, C, yplus, nx-1, q_r, beta);
101 else if(bcInfo[YPLUS][0].type ==
SPECIAL)
104 dy0 = 0.5*(dy[ny-2] + dy[ny-1]);
105 dy1 = 0.5*(dy[ny-1]);
106 C = alpha * 2.0 * nu / (dy1 * (dy0+dy1));
107 kernels::bc1SpecialU <<<dimGridx, dimBlock>>> (bc1_r, nx-1, nx, (nx-1)*(ny-1), 1, dxD, C, yplus, (timeStep+1)*dt);
110 C = alpha * 2.0 * nu / (dy[ny-1] * (dy[ny-1]+dy[ny-2]));
111 kernels::bc1DirichletV <<<dimGridx, dimBlock>>> (bc1_r, nx, nx, numU, nx*(ny-2), 1, dyD, C, yplus, nx-1);
118 C = alpha * 2.0 * nu / ( dx[0] * (dx[0]+dx[1]) );
119 kernels::bc1DirichletU <<<dimGridy, dimBlock>>> (bc1_r, ny, nx, 0, (nx-1), dxD, C, xminus);
123 dx1 = 0.5*(dx[0] + dx[1]);
124 C = alpha * 2.0 * nu / (dx0 * (dx0+dx1));
125 kernels::bc1DirichletV <<<dimGridy, dimBlock>>> (bc1_r, ny-1, nx, numU, 0, nx, dyD, C, xminus, ny);
133 C = alpha * 2.0 * nu / ( dx[nx-1] * (dx[nx-1]+dx[nx-2]) );
134 kernels::bc1DirichletU <<<dimGridy, dimBlock>>> (bc1_r, ny, nx, nx-2, (nx-1), dxD, C, xplus);
137 dx0 = 0.5*(dx[nx-1] + dx[nx-2]);
138 dx1 = 0.5*(dx[nx-1]);
139 C = alpha * 2.0 * nu / (dx1 * (dx0+dx1));
140 kernels::bc1DirichletV <<<dimGridy, dimBlock>>> (bc1_r, ny-1, nx, numU, nx-1, nx, dyD, C, xplus, ny);
145 beta = bcInfo[
XPLUS][0].value * dt / dx[nx-1];
146 C = alpha * 2.0 * nu / ( dx[nx-1] * (dx[nx-1]+dx[nx-2]) );
147 kernels::bc1ConvectiveU <<<dimGridy, dimBlock>>> (bc1_r, ny, nx, nx-2, nx-1, dxD, dyD, C, xplus, q_r, beta);
150 beta = bcInfo[
XPLUS][0].value * dt / (0.5*dx[nx-1]);
151 dx0 = 0.5*(dx[nx-1] + dx[nx-2]);
152 dx1 = 0.5*(dx[nx-1]);
153 C = alpha * 2.0 * nu / (dx1 * (dx0+dx1));
154 kernels::bc1ConvectiveV <<<dimGridy, dimBlock>>> (bc1_r, ny-1, nx, numU, nx-1, nx, dxD, dyD, C, xplus, ny, q_r, beta);
157 logger.stopTimer(
"generateBC1");
Declaration of the kernels to generate right hand-side terms of the intermediate velocity flux solver...
virtual void generateBC1()
double real
Is a float or a double depending on the machine precision.
Dirichlet boundary condition.
convective boundary condition
Stores the type of boundary condition and its value.