Supporting two options for solid boundary condition

This commit is contained in:
James McClure
2014-06-01 07:32:44 -04:00
parent 942f8ec070
commit 34572e6e34

View File

@@ -1154,7 +1154,7 @@ int main(int argc, char **argv)
//int newton_steps = 0;
//...........................................................................
int ncubes = (Nx-2)*(Ny-2)*(Nz-2); // Exclude the "upper" halo
IntArray cubeList(3,ncubes);
// IntArray cubeList(3,ncubes);
IntArray LocalBlobID(Nx,Ny,Nz);
IntArray LocalBlobTable(100,MAX_LOCAL_BLOB_COUNT); // hold the neighboring ranks and the local blob averages (tcat)
IntArray LocalBlobCubeList(3,ncubes); // store indices for blobs (cubes)
@@ -1176,9 +1176,8 @@ int main(int argc, char **argv)
// node i,j,k is in the porespace
Blobs(nblobs) = ComputeBlob(LocalBlobCubeList,nblobs,ncubes,LocalBlobID,Phase,SignDist,0.0,0.0,i,j,k,temp);
nblobs++;
if (!(nblobs < MAX_LOCAL_BLOB_COUNT){
// better exit now!!
}
INSIST(nblobs < MAX_LOCAL_BLOB_COUNT,"Not enough to store the local blobs!");
}
}
}
@@ -2198,53 +2197,18 @@ int main(int argc, char **argv)
Jwn = Kwn = efawns = 0.0;
trJwn = trawn = 0.0;
/// Compute volume averages
for (k=kstart; k<kfinish; k++){
for (j=1; j<Ny-1; j++){
for (i=1; i<Nx-1; i++){
if ( SignDist(i,j,k) > 0.0 ){
// 1-D index for this cube corner
n = i + j*Nx + k*Nx*Ny;
// Compute the non-wetting phase volume contribution
if ( Phase(i,j,k) > 0.0 )
nwp_volume += 1.0;
// volume averages over the non-wetting phase
if ( Phase(i,j,k) > 0.999 ){
// volume the excludes the interfacial region
vol_n += 1.0;
// pressure
pan += Press(i,j,k);
// velocity
van(0) += Vel_x(i,j,k);
van(1) += Vel_y(i,j,k);
van(2) += Vel_z(i,j,k);
}
// volume averages over the wetting phase
if ( Phase(i,j,k) < -0.999 ){
// volume the excludes the interfacial region
vol_w += 1.0;
// pressure
paw += Press(i,j,k);
// velocity
vaw(0) += Vel_x(i,j,k);
vaw(1) += Vel_y(i,j,k);
vaw(2) += Vel_z(i,j,k);
}
}
}
}
}
for (c=0;c<ncubes;c++){
start = 0;
for (a=0;a<nblobs;a++){
finish = start+cubes_in_blob(a);
for (c=start;c<finish;c++){
// Get cube from the list
i = cubeList(0,c);
j = cubeList(1,c);
k = cubeList(2,c);
i = LocalBlobCubeList(0,c);
j = LocalBlobCubeList(1,c);
k = LocalBlobCubeList(2,c);
//...........................................................................
/* // Compute volume averages
// Compute volume averages
for (p=0;p<8;p++){
if ( SignDist(i+cube[p][0],j+cube[p][1],k+cube[p][2]) > 0 ){
@@ -2281,7 +2245,7 @@ int main(int argc, char **argv)
}
}
*/ //...........................................................................
//...........................................................................
// Construct the interfaces and common curve
pmmc_ConstructLocalCube(SignDist, Phase, solid_isovalue, fluid_isovalue,
nw_pts, nw_tris, values, ns_pts, ns_tris, ws_pts, ws_tris,
@@ -2315,6 +2279,7 @@ int main(int argc, char **argv)
lwns += pmmc_CubeCurveLength(local_nws_pts,n_local_nws_pts);
//...........................................................................
}
}
//...........................................................................
MPI_Barrier(MPI_COMM_WORLD);
MPI_Allreduce(&nwp_volume,&nwp_volume_global,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
@@ -2446,9 +2411,9 @@ int main(int argc, char **argv)
for (c=0;c<ncubes;c++){
// Get cube from the list
i = cubeList(0,c);
j = cubeList(1,c);
k = cubeList(2,c);
i = LocalBlobCubeList(0,c);
j = LocalBlobCubeList(1,c);
k = LocalBlobCubeList(2,c);
//...........................................................................
// Construct the interfaces and common curve
pmmc_ConstructLocalCube(SignDist, Phase, solid_isovalue, fluid_isovalue,