Updating type in common/TwoPhase.h lbpm_morphdrain_pp and lbpm_morphopen_pp
This commit is contained in:
@@ -117,7 +117,7 @@ public:
|
|||||||
DoubleArray Gws_global;
|
DoubleArray Gws_global;
|
||||||
//...........................................................................
|
//...........................................................................
|
||||||
//...........................................................................
|
//...........................................................................
|
||||||
int Nx,Ny,Nz;
|
uint64 Nx,Ny,Nz;
|
||||||
IntArray PhaseID; // Phase ID array (solid=0, non-wetting=1, wetting=2)
|
IntArray PhaseID; // Phase ID array (solid=0, non-wetting=1, wetting=2)
|
||||||
BlobIDArray Label_WP; // Wetting phase label
|
BlobIDArray Label_WP; // Wetting phase label
|
||||||
BlobIDArray Label_NWP; // Non-wetting phase label index (0:nblobs-1)
|
BlobIDArray Label_NWP; // Non-wetting phase label index (0:nblobs-1)
|
||||||
|
|||||||
@@ -234,8 +234,8 @@ int main(int argc, char **argv)
|
|||||||
int Nz = nz;
|
int Nz = nz;
|
||||||
int GlobalNumber = 1;
|
int GlobalNumber = 1;
|
||||||
|
|
||||||
int count,countGlobal,totalGlobal;
|
double count,countGlobal,totalGlobal;
|
||||||
count = 0;
|
count = 0.f;
|
||||||
for (int k=1; k<nz-1; k++){
|
for (int k=1; k<nz-1; k++){
|
||||||
for (int j=1; j<ny-1; j++){
|
for (int j=1; j<ny-1; j++){
|
||||||
for (int i=1; i<nx-1; i++){
|
for (int i=1; i<nx-1; i++){
|
||||||
@@ -244,13 +244,13 @@ int main(int argc, char **argv)
|
|||||||
else{
|
else{
|
||||||
// initially saturated with wetting phase
|
// initially saturated with wetting phase
|
||||||
id[n] = 2;
|
id[n] = 2;
|
||||||
count++;
|
count+=1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// total Global is the number of nodes in the pore-space
|
// total Global is the number of nodes in the pore-space
|
||||||
MPI_Allreduce(&count,&totalGlobal,1,MPI_INT,MPI_SUM,comm);
|
MPI_Allreduce(&count,&totalGlobal,1,MPI_DOUBLE,MPI_SUM,comm);
|
||||||
float porosity=float(totalGlobal)/(nprocx*nprocy*nprocz*(nx-2)*(ny-2)*(nz-2));
|
float porosity=float(totalGlobal)/(nprocx*nprocy*nprocz*(nx-2)*(ny-2)*(nz-2));
|
||||||
if (rank==0) printf("Media Porosity: %f \n",porosity);
|
if (rank==0) printf("Media Porosity: %f \n",porosity);
|
||||||
|
|
||||||
@@ -297,8 +297,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
while (GlobalNumber != 0){
|
while (GlobalNumber != 0){
|
||||||
|
|
||||||
if (rank==0) printf("GlobalNumber=%i \n",GlobalNumber);
|
if (rank==0) printf("GlobalNumber=%f \n",GlobalNumber);
|
||||||
int LocalNumber=GlobalNumber=0;
|
double LocalNumber=GlobalNumber=0;
|
||||||
for(k=0; k<Nz; k++){
|
for(k=0; k<Nz; k++){
|
||||||
for(j=0; j<Ny; j++){
|
for(j=0; j<Ny; j++){
|
||||||
for(i=0; i<Nx; i++){
|
for(i=0; i<Nx; i++){
|
||||||
@@ -317,7 +317,7 @@ int main(int argc, char **argv)
|
|||||||
int nn = kk*nx*ny+jj*nx+ii;
|
int nn = kk*nx*ny+jj*nx+ii;
|
||||||
double dsq = double((ii-i)*(ii-i)+(jj-j)*(jj-j)+(kk-k)*(kk-k));
|
double dsq = double((ii-i)*(ii-i)+(jj-j)*(jj-j)+(kk-k)*(kk-k));
|
||||||
if (id[nn] == 2 && dsq <= Rcrit_new*Rcrit_new){
|
if (id[nn] == 2 && dsq <= Rcrit_new*Rcrit_new){
|
||||||
LocalNumber++;
|
LocalNumber+=1.0;
|
||||||
id[nn]=1;
|
id[nn]=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ int main(int argc, char **argv)
|
|||||||
UnpackID(Dm.recvList_YZ, Dm.recvCount_YZ ,recvID_YZ, id);
|
UnpackID(Dm.recvList_YZ, Dm.recvCount_YZ ,recvID_YZ, id);
|
||||||
//......................................................................................
|
//......................................................................................
|
||||||
|
|
||||||
MPI_Allreduce(&LocalNumber,&GlobalNumber,1,MPI_INT,MPI_SUM,comm);
|
MPI_Allreduce(&LocalNumber,&GlobalNumber,1,MPI_DOUBLE,MPI_SUM,comm);
|
||||||
|
|
||||||
// Layer the inlet with NWP
|
// Layer the inlet with NWP
|
||||||
if (kproc == 0){
|
if (kproc == 0){
|
||||||
@@ -433,19 +433,19 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
count = 0;
|
count = 1.f;
|
||||||
for (int k=1; k<Nz-1; k++){
|
for (int k=1; k<Nz-1; k++){
|
||||||
for (int j=1; j<Ny-1; j++){
|
for (int j=1; j<Ny-1; j++){
|
||||||
for (int i=1; i<Nx-1; i++){
|
for (int i=1; i<Nx-1; i++){
|
||||||
n=k*Nx*Ny+j*Nx+i;
|
n=k*Nx*Ny+j*Nx+i;
|
||||||
if (id[n] == 2){
|
if (id[n] == 2){
|
||||||
count++;
|
count+=1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,comm);
|
MPI_Allreduce(&count,&countGlobal,1,MPI_DOUBLE,MPI_SUM,comm);
|
||||||
sw_new= double(countGlobal)/totalGlobal;
|
sw_new= countGlobal/totalGlobal;
|
||||||
sw_diff_new = abs(sw_new-SW);
|
sw_diff_new = abs(sw_new-SW);
|
||||||
// if (rank==0){
|
// if (rank==0){
|
||||||
// printf("Final saturation=%f\n",sw_new);
|
// printf("Final saturation=%f\n",sw_new);
|
||||||
|
|||||||
Reference in New Issue
Block a user