Debugging component averaging

This commit is contained in:
James E McClure
2015-07-13 14:57:39 -04:00
parent 5983df27e8
commit dfd6eac3d6

View File

@@ -734,13 +734,11 @@ void TwoPhase::ComponentAverages(){
// Globally reduce the non-wetting phase averages
RecvBuffer.resize(BLOB_AVG_COUNT);
printf("Reducing the NWP averages \n");
for (int b=0; b<NumberComponents_NWP; b++){
MPI_Barrier(MPI_COMM_WORLD);
MPI_Allreduce(&ComponentAverages_NWP(0,b),&RecvBuffer(0),BLOB_AVG_COUNT,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
for (int idx=0; idx<BLOB_AVG_COUNT; idx++) ComponentAverages_NWP(idx,b)=RecvBuffer(idx);
}
printf("Finalizing the NWP averages \n");
for (int b=0; b<NumberComponents_NWP; b++){
if (ComponentAverages_NWP(VOL,b) > 0.0){
double Vn,pn,awn,ans,Jwn,Kwn,lwns,cwns,vsq;
@@ -796,14 +794,12 @@ void TwoPhase::ComponentAverages(){
}
// reduce the wetting phase averages
printf("Reducing the WP averages \n");
for (int b=0; b<NumberComponents_WP; b++){
MPI_Barrier(MPI_COMM_WORLD);
MPI_Allreduce(&ComponentAverages_WP(0,b),&RecvBuffer(0),BLOB_AVG_COUNT,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
for (int idx=0; idx<BLOB_AVG_COUNT; idx++) ComponentAverages_WP(idx,b)=RecvBuffer(idx);
}
printf("Finalizing the WP averages \n");
for (int b=0; b<NumberComponents_WP; b++){
if (ComponentAverages_WP(VOL,b) > 0.0){
double Vw,pw,awn,ans,Jwn,Kwn,lwns,cwns,vsq;
@@ -1006,6 +1002,8 @@ void TwoPhase::PrintComponents(int timestep){
fprintf(NWPLOG,"%.5g ",ComponentAverages_NWP(GWNXZ,b));
fprintf(NWPLOG,"%.5g\n",ComponentAverages_NWP(GWNYZ,b));
}
fflush(NWPLOG);
for (int b=0; b<NumberComponents_WP; b++){
fprintf(WPLOG,"%i ",timestep-5);
@@ -1035,6 +1033,8 @@ void TwoPhase::PrintComponents(int timestep){
fprintf(WPLOG,"%.5g ",ComponentAverages_WP(GWNXZ,b));
fprintf(WPLOG,"%.5g\n",ComponentAverages_WP(GWNYZ,b));
}
fflush(WPLOG);
}
}