Mapping signed distance within averaging routines ComputeLocal and ComponentAverages to fix bug with labeling
This commit is contained in:
parent
5da421a7f0
commit
87e8c501ad
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user