Introduction
Introduction Statistics Contact Development Disclaimer Help
tnoflow BC at dynamic top wall if bc_top == 1 - sphere - GPU-based 3D discrete …
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit e5b95050497b410896ead7a91e9288ec8a91a236
parent 2acbed5f2f251f9407971a685c64bbc5500a4678
Author: Anders Damsgaard <[email protected]>
Date: Mon, 12 Jan 2015 13:36:10 +0100
noflow BC at dynamic top wall if bc_top == 1
Diffstat:
M src/darcy.cuh | 22 ++++++++++++++++++++++
M src/device.cu | 15 +++++++++++++++
2 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/src/darcy.cuh b/src/darcy.cuh
t@@ -698,6 +698,28 @@ __global__ void setDarcyTopWallPressure(
}
}
+// Enforce fixed-flow BC at top wall
+__global__ void setDarcyTopWallFixedFlow(
+ const unsigned int wall0_iz,
+ Float* __restrict__ dev_darcy_p)
+{
+ // 3D thread index
+ const unsigned int x = blockDim.x * blockIdx.x + threadIdx.x;
+ const unsigned int y = blockDim.y * blockIdx.y + threadIdx.y;
+ const unsigned int z = blockDim.z * blockIdx.z + threadIdx.z;
+
+ // check that the thread is located at the top boundary
+ if (x < devC_grid.num[0] &&
+ y < devC_grid.num[1] &&
+ z == wall0_iz+1) {
+
+ // Write the new pressure the top boundary cells
+ __syncthreads();
+ const Float new_pressure = dev_darcy_p[idx(x,y,z-2)];
+ dev_darcy_p[idx(x,y,z)] = new_pressure;
+ }
+}
+
// Find the cell permeabilities from the Kozeny-Carman equation
__global__ void findDarcyPermeabilities(
diff --git a/src/device.cu b/src/device.cu
t@@ -2021,6 +2021,21 @@ __host__ void DEM::startTime()
checkForCudaErrorsIter("Post updateDarcySolution",
iter);
+ if (darcy.bc_top == 1) {
+ if (PROFILING == 1)
+ startTimer(&kernel_tic);
+ setDarcyTopWallFixedFlow
+ <<<dimGridFluid, dimBlockFluid>>>
+ (wall0_iz, dev_darcy_p);
+ cudaThreadSynchronize();
+ if (PROFILING == 1)
+ stopTimer(&kernel_tic, &kernel_toc,
+ &kernel_elapsed,
+ &t_updateDarcySolution);
+ checkForCudaErrorsIter(
+ "Post setDarcyTopWallFixedFlow", iter);
+ }
+
// Copy new values to current values
if (PROFILING == 1)
startTimer(&kernel_tic);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.