From cddcfa0188d932f755981e92ede2d71c5394d267 Mon Sep 17 00:00:00 2001 From: Rex Zhe Li Date: Tue, 10 Dec 2019 16:54:42 -0500 Subject: [PATCH] fix the bug and now have a workable greyscale BGK model in both CPU and GPU --- cpu/Greyscale.cpp | 54 +++++++++++++++++---------------------- gpu/Greyscale.cu | 52 +++++++++++++++++-------------------- models/GreyscaleModel.cpp | 14 +++++++++- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/cpu/Greyscale.cpp b/cpu/Greyscale.cpp index fa9a1f49..48e61a56 100644 --- a/cpu/Greyscale.cpp +++ b/cpu/Greyscale.cpp @@ -1,6 +1,6 @@ #include -extern "C" void ScaLBL_D3Q19_AAeven_Greyscale(double *dist, int start, int finish, int Np, double rlx, double Fx, double Fy, double Fz, +extern "C" void ScaLBL_D3Q19_AAeven_Greyscale(double *dist, int start, int finish, int Np, double rlx, double Gx, double Gy, double Gz, double *Poros,double *Perm, double *Velocity){ int n; // conserved momemnts @@ -14,6 +14,7 @@ extern "C" void ScaLBL_D3Q19_AAeven_Greyscale(double *dist, int start, int finis double perm;//voxel permeability double c0, c1; //Guo's model parameters double mu = (1.0/rlx-0.5)/3.0;//kinematic viscosity + double Fx, Fy, Fz;//The total body force including Brinkman force and user-specified (Gx,Gy,Gz) for (int n=start; nRegularLayout(Map,&Porosity[0],PhaseField); + FILE *POROS_FILE; + sprintf(LocalRankFilename,"Porosity.%05i.raw",rank); + POROS_FILE = fopen(LocalRankFilename,"wb"); + fwrite(PhaseField.data(),8,N,POROS_FILE); + fclose(POROS_FILE); + ScaLBL_Comm->RegularLayout(Map,&Permeability[0],PhaseField); + FILE *PERM_FILE; + sprintf(LocalRankFilename,"Permeability.%05i.raw",rank); + PERM_FILE = fopen(LocalRankFilename,"wb"); + fwrite(PhaseField.data(),8,N,PERM_FILE); + fclose(PERM_FILE); }