Updates for relperm

This commit is contained in:
James E McClure
2015-06-18 07:52:39 -04:00
parent 14fa6ce01f
commit d50713b42c
4 changed files with 8 additions and 30 deletions

View File

@@ -846,12 +846,9 @@ inline void SSO(DoubleArray &Distance, char *ID, Domain &Dm, int timesteps){
nz = 0.5*(Distance(i,j,k+1) - Distance(i,j,k-1));
W = 0.0; Dx = Dy = Dz = 0.0;
// Ignore any values that have distances less than a lattice unit
// since sometimes the positions may be guessed more accurately from
// another source (such as a simulation)
// also ignore places where the gradient is zero since this will not
// result in any local change to Distance
if (nx*nx+ny*ny+nz*nz > 0.0 && !(Distance(i,j,k)*Distance(i,j,k) < 1.0) ){
if (nx*nx+ny*ny+nz*nz > 0.0 ){
for (q=0; q<26; q++){
Cqx = 1.0*D3Q27[q][0];
Cqy = 1.0*D3Q27[q][1];

View File

@@ -997,7 +997,7 @@ int main(int argc, char **argv)
//...........................................................................
//...........................................................................
if (InitialCondition == 2){
if (rank==0) printf("Initialize from segmented data: solid=0, wetting=1, nonwetting=2 \n");
if (rank==0) printf("Initialize from segmented data: solid=0, NWP=1, WP=2 \n");
sprintf(LocalRankFilename,"ID.%05i",rank);
FILE *IDFILE = fopen(LocalRankFilename,"rb");
if (IDFILE==NULL) ERROR("Error opening file: ID.xxxxx");

View File

@@ -180,39 +180,20 @@ int main(int argc, char **argv)
int count = 0;
N=nx*ny*nz;
/* char *id;
id = new char [N];
for (k=0;k<nz;k++){
/* for (k=0;k<nz;k++){
for (j=0;j<ny;j++){
for (i=0;i<nx;i++){
n = k*nx*ny+j*nx+i;
if (Dm.id[n] == 1) Dm.id[n]=2;
else if (Dm.id[n] == 2) Dm.id[n]=1;
// Initialize the solid phase
// if (Dm.id[n] == 0) id[n] = 0;
// else id[n] = 1;
}
}
}
DoubleArray Distance(nx,ny,nz);
// Initialize the signed distance function
for (k=0;k<nz;k++){
for (j=0;j<ny;j++){
for (i=0;i<nx;i++){
n=k*nx*ny+j*nx+i;
// Initialize distance to +/- 1
Distance(i,j,k) = 1.0*id[n]-0.5;
}
}
}
*/
// if (rank==0) printf("Nx = %i \n",(int)Distance.size(0));
// if (rank==0) printf("Ny = %i \n",(int)Distance.size(1));
// if (rank==0) printf("Nz = %i \n",(int)Distance.size(2));
// printf("Initialized! Converting to Signed Distance function \n");
// SSO(Distance,id,Dm,10);
char LocalRankFilename[40];
char LocalRankFilename[40];
sprintf(LocalRankFilename,"ID.%05i",rank);
FILE *ID = fopen(LocalRankFilename,"wb");

View File

@@ -186,8 +186,8 @@ int main(int argc, char **argv)
for (j=0;j<ny;j++){
for (i=0;i<nx;i++){
n = k*nx*ny+j*nx+i;
// Initialize the solid phase
if (Dm.id[n] == 2) id[n] = 1;
// Initialize the non-wetting phase
if (Dm.id[n] == 1) id[n] = 1;
else id[n] = 0;
}
}