save the work, CPU versions seem to work, but need non-unity porosity test

This commit is contained in:
Rex Zhe Li 2020-01-17 18:46:28 -05:00
parent 38f97c2848
commit 9fa091a49d
5 changed files with 1093 additions and 7 deletions

View File

@ -391,7 +391,7 @@ void Domain::Decomp(std::string Filename)
for (int idx=0; idx<ReadValues.size(); idx++){ for (int idx=0; idx<ReadValues.size(); idx++){
long int label=ReadValues[idx]; long int label=ReadValues[idx];
long int count=LabelCount[idx]; long int count=LabelCount[idx];
printf("Label=%d, Count=%d \n",label,count); printf("Label=%ld, Count=%ld \n",label,count);
} }
} }

View File

@ -62,6 +62,13 @@ extern "C" void ScaLBL_D3Q19_AAeven_Greyscale(double *dist, int start, int finis
extern "C" void ScaLBL_D3Q19_AAodd_Greyscale(int *neighborList, double *dist, int start, int finish, int Np, double rlx, double Fx, double Fy, double Fz, extern "C" void ScaLBL_D3Q19_AAodd_Greyscale(int *neighborList, double *dist, int start, int finish, int Np, double rlx, double Fx, double Fy, double Fz,
double *Poros,double *Perm, double *Velocity); double *Poros,double *Perm, double *Velocity);
extern "C" void ScaLBL_D3Q19_AAeven_Greyscale_IMRT(double *dist, int start, int finish, int Np, double rlx, double Fx, double Fy, double Fz,
double *Poros,double *Perm, double *Velocity,double Den);
extern "C" void ScaLBL_D3Q19_AAodd_Greyscale_IMRT(int *neighborList, double *dist, int start, int finish, int Np, double rlx, double Fx, double Fy, double Fz,
double *Poros,double *Perm, double *Velocity,double Den);
// MRT MODEL // MRT MODEL
extern "C" void ScaLBL_D3Q19_AAeven_MRT(double *dist, int start, int finish, int Np, double rlx_setA, double rlx_setB, double Fx, extern "C" void ScaLBL_D3Q19_AAeven_MRT(double *dist, int start, int finish, int Np, double rlx_setA, double rlx_setB, double Fx,
double Fy, double Fz); double Fy, double Fz);

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ color lattice boltzmann model
#include <time.h> #include <time.h>
ScaLBL_GreyscaleModel::ScaLBL_GreyscaleModel(int RANK, int NP, MPI_Comm COMM): ScaLBL_GreyscaleModel::ScaLBL_GreyscaleModel(int RANK, int NP, MPI_Comm COMM):
rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tau(0),Fx(0),Fy(0),Fz(0),flux(0),din(0),dout(0), rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tau(0),Den(0),Fx(0),Fy(0),Fz(0),flux(0),din(0),dout(0),
Nx(0),Ny(0),Nz(0),N(0),Np(0),nprocx(0),nprocy(0),nprocz(0),BoundaryCondition(0),Lx(0),Ly(0),Lz(0),comm(COMM) Nx(0),Ny(0),Nz(0),N(0),Np(0),nprocx(0),nprocy(0),nprocz(0),BoundaryCondition(0),Lx(0),Ly(0),Lz(0),comm(COMM)
{ {
SignDist.resize(Nx,Ny,Nz); SignDist.resize(Nx,Ny,Nz);
@ -30,6 +30,7 @@ void ScaLBL_GreyscaleModel::ReadParams(string filename){
// set defaults // set defaults
timestepMax = 100000; timestepMax = 100000;
tau = 1.0; tau = 1.0;
Den = 1.0;//constant density
tolerance = 0.01; tolerance = 0.01;
Fx = Fy = Fz = 0.0; Fx = Fy = Fz = 0.0;
Restart=false; Restart=false;
@ -37,13 +38,16 @@ void ScaLBL_GreyscaleModel::ReadParams(string filename){
flux=0.0; flux=0.0;
dp = 10.0; //unit of 'dp': voxel dp = 10.0; //unit of 'dp': voxel
// Color Model parameters // Greyscale Model parameters
if (greyscale_db->keyExists( "timestepMax" )){ if (greyscale_db->keyExists( "timestepMax" )){
timestepMax = greyscale_db->getScalar<int>( "timestepMax" ); timestepMax = greyscale_db->getScalar<int>( "timestepMax" );
} }
if (greyscale_db->keyExists( "tau" )){ if (greyscale_db->keyExists( "tau" )){
tau = greyscale_db->getScalar<double>( "tau" ); tau = greyscale_db->getScalar<double>( "tau" );
} }
if (greyscale_db->keyExists( "Den" )){
Den = greyscale_db->getScalar<double>( "Den" );
}
if (greyscale_db->keyExists( "dp" )){ if (greyscale_db->keyExists( "dp" )){
dp = greyscale_db->getScalar<double>( "dp" ); dp = greyscale_db->getScalar<double>( "dp" );
} }
@ -423,15 +427,19 @@ void ScaLBL_GreyscaleModel::Run(){
//************************************************************************/ //************************************************************************/
timestep++; timestep++;
ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL
ScaLBL_D3Q19_AAodd_Greyscale(NeighborList, fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity); //ScaLBL_D3Q19_AAodd_Greyscale(NeighborList, fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity);
ScaLBL_D3Q19_AAodd_Greyscale_IMRT(NeighborList, fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity,Den);
ScaLBL_Comm->RecvD3Q19AA(fq); //WRITE INTO OPPOSITE ScaLBL_Comm->RecvD3Q19AA(fq); //WRITE INTO OPPOSITE
ScaLBL_D3Q19_AAodd_Greyscale(NeighborList, fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity); //ScaLBL_D3Q19_AAodd_Greyscale(NeighborList, fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity);
ScaLBL_D3Q19_AAodd_Greyscale_IMRT(NeighborList, fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity,Den);
ScaLBL_DeviceBarrier(); MPI_Barrier(comm); ScaLBL_DeviceBarrier(); MPI_Barrier(comm);
timestep++; timestep++;
ScaLBL_Comm->SendD3Q19AA(fq); //READ FORM NORMAL ScaLBL_Comm->SendD3Q19AA(fq); //READ FORM NORMAL
ScaLBL_D3Q19_AAeven_Greyscale(fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity); //ScaLBL_D3Q19_AAeven_Greyscale(fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity);
ScaLBL_D3Q19_AAeven_Greyscale_IMRT(fq, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity,Den);
ScaLBL_Comm->RecvD3Q19AA(fq); //WRITE INTO OPPOSITE ScaLBL_Comm->RecvD3Q19AA(fq); //WRITE INTO OPPOSITE
ScaLBL_D3Q19_AAeven_Greyscale(fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity); //ScaLBL_D3Q19_AAeven_Greyscale(fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity);
ScaLBL_D3Q19_AAeven_Greyscale_IMRT(fq, 0, ScaLBL_Comm->LastExterior(), Np, rlx, Fx, Fy, Fz,Porosity,Permeability,Velocity,Den);
ScaLBL_DeviceBarrier(); MPI_Barrier(comm); ScaLBL_DeviceBarrier(); MPI_Barrier(comm);
//************************************************************************/ //************************************************************************/

View File

@ -36,6 +36,7 @@ public:
int timestep,timestepMax; int timestep,timestepMax;
int BoundaryCondition; int BoundaryCondition;
double tau; double tau;
double Den;//constant density
double tolerance; double tolerance;
double Fx,Fy,Fz,flux; double Fx,Fy,Fz,flux;
double din,dout; double din,dout;