add zeta potential to Poisson

This commit is contained in:
James McClure
2020-08-11 16:52:56 -04:00
parent 6ff5a9a8ae
commit 30014a49c0
4 changed files with 24 additions and 2 deletions

View File

@@ -183,7 +183,16 @@ void ScaLBL_Poisson::Create(){
ScaLBL_AllocateDeviceMemory((void **) &fq, 7*dist_mem_size);
ScaLBL_AllocateDeviceMemory((void **) &Psi, sizeof(double)*Np);
ScaLBL_AllocateDeviceMemory((void **) &ElectricField, 3*sizeof(double)*Np);
ScaLBL_AllocateDeviceMemory((void **) &zeta, sizeof(double)*ScaLBL_Comm->n_bb_d3q7);
//...........................................................................
// initialize the zeta function (example is zeta is constant on solid surface)
double *tmpZeta = new double[ScaLBL_Comm->n_bb_d3q7];
for int (i=0; i<ScaLBL_Comm->n_bb_d3q7; i++){
tmpZeta[i] = 1.0/k2_inv; // this has to be read from input file
}
ScaLBL_CopyToDevice(zeta, tmpZeta, sizeof(double)*ScaLBL_Comm->n_bb_d3q7);
delete [] tmpZeta;
// Update GPU data structures
if (rank==0) printf ("Setting up device map and neighbor list \n");
// copy the neighbor list
@@ -225,6 +234,7 @@ void ScaLBL_Poisson::Run(double *ChargeDensity){
// Set boundary conditions
/* ... */
ScaLBL_D3Q7_AAodd_Poisson(NeighborList, fq, ChargeDensity, Psi, ElectricField, rlx, epsilon_LB, deltaT, 0, ScaLBL_Comm->LastExterior(), Np);
ScaLBL_Comm->SolidDirichletD3Q7(fq, zeta);
ScaLBL_DeviceBarrier(); MPI_Barrier(comm);
// *************EVEN TIMESTEP*************//
@@ -235,6 +245,7 @@ void ScaLBL_Poisson::Run(double *ChargeDensity){
// Set boundary conditions
/* ... */
ScaLBL_D3Q7_AAeven_Poisson(fq, ChargeDensity, Psi, ElectricField, rlx, epsilon_LB, deltaT, 0, ScaLBL_Comm->LastExterior(), Np);
ScaLBL_Comm->SolidDirichletD3Q7(fq, zeta);
ScaLBL_DeviceBarrier(); MPI_Barrier(comm);
//************************************************************************/