Mapping signed distance within averaging routines ComputeLocal and ComponentAverages to fix bug with labeling

This commit is contained in:
James E McClure 2015-09-02 07:43:33 -04:00
parent 5da421a7f0
commit 87e8c501ad
2 changed files with 36 additions and 1 deletions

View File

@ -366,6 +366,14 @@ void TwoPhase::ComputeLocal()
if (Dm.BoundaryCondition > 0 && Dm.kproc == 0) kmin=4;
if (Dm.BoundaryCondition > 0 && Dm.kproc == Dm.nprocz-1) kmax=Nz-4;
// Map solid to erode the fluid so that interfaces can be calculated accurately
for (k=0; k<Nz; k++){
for (j=0; j<Ny; j++){
for (i=0; i<Nx; i++){
SDs(i,j,k) += 1.0;
}
}
}
for (k=kmin; k<kmax; k++){
for (j=1; j<Ny-1; j++){
for (i=1; i<Nx-1; i++){
@ -464,6 +472,15 @@ void TwoPhase::ComputeLocal()
}
}
}
// Map solid back
for (k=0; k<Nz; k++){
for (j=0; j<Ny; j++){
for (i=0; i<Nx; i++){
SDs(i,j,k) -= 1.0;
}
}
}
}
@ -516,6 +533,15 @@ void TwoPhase::ComponentAverages()
if (Dm.BoundaryCondition > 0 && Dm.kproc == 0) kmin=4;
if (Dm.BoundaryCondition > 0 && Dm.kproc == Dm.nprocz-1) kmax=Nz-4;
// Map solid to erode the fluid so that interfaces can be calculated accurately
for (k=0; k<Nz; k++){
for (j=0; j<Ny; j++){
for (i=0; i<Nx; i++){
SDs(i,j,k) += 1.0;
}
}
}
for (k=kmin; k<kmax; k++){
for (j=1; j<Ny-1; j++){
for (i=1; i<Nx-1; i++){
@ -712,6 +738,15 @@ void TwoPhase::ComponentAverages()
}
}
}
// Map solid to erode the fluid so that interfaces can be calculated accurately
for (k=0; k<Nz; k++){
for (j=0; j<Ny; j++){
for (i=0; i<Nx; i++){
SDs(i,j,k) -= 1.0;
}
}
}
if (Dm.rank==0){
printf("Component averages computed locally -- reducing result... \n");

View File

@ -571,7 +571,7 @@ int main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
//.......................................................................
// Once phase has been initialized, map solid to account for 'smeared' interface
for (i=0; i<N; i++) Averages->SDs(i) -= (1.0); //
//for (i=0; i<N; i++) Averages->SDs(i) -= (1.0); //
//.......................................................................
// Finalize setup for averaging domain
//Averages->SetupCubes(Dm);