Commits

Michael Kuhlen committed 0f27276

Fixed two bugs in FluxFix_Grid_CorrectForRefinedFluxes.C: (1) Removed Correct{Left,Right}BoundaryFlux conditions for flux correction; (2) Split CorrectionAmount into CorrectionAmountLeft and CorrectionAmountRight.

Comments (0)

Files changed (1)

src/enzo/FluxFix_Grid_CorrectForRefinedFluxes.C

   int CorrectLeftBaryonField, CorrectRightBaryonField;
   //For correction of the Parent Grid (this grid) boundary flux.
   int CorrectLeftBoundaryFlux, CorrectRightBoundaryFlux;
-  float CorrectionAmount; 
+  float CorrectionAmountLeft, CorrectionAmountRight; 
  
   long_int GlobalDim;
  
 		      + (k - GridFluxStartIndex[2])*GridFluxDim[1]*GridFluxDim[0];
 		
 		
-		    if (CorrectLeftBoundaryFlux)
+// 		    if (CorrectLeftBoundaryFlux)
 //		      BoundaryFluxesThisTimeStep->LeftFluxes[field][dim][GridFluxIndex] =
 //			RefinedFluxes->LeftFluxes[field][dim][FluxIndex];
 		
 		    if(CorrectLeftBaryonField){
 		
 		      if( SUBlingGrid == FALSE ){
-			CorrectionAmount = 
+			CorrectionAmountLeft = 
 			  InitialFluxes->LeftFluxes[field][dim][FluxIndex] -
 			  RefinedFluxes->LeftFluxes[field][dim][FluxIndex];
-			BaryonField[field][FieldIndex] += CorrectionAmount;
+			BaryonField[field][FieldIndex] += CorrectionAmountLeft;
 			
 		      }else{ /* if( SUBlingGrid == False) */
 			
-			CorrectionAmount = 
+			CorrectionAmountLeft = 
 			  -(InitialFluxes->LeftFluxes[field][dim][FluxIndex] -
 			    RefinedFluxes->RightFluxes[field][dim][RefinedFluxIndex]);
-			BaryonField[field][FieldIndex] += CorrectionAmount;
+			BaryonField[field][FieldIndex] += CorrectionAmountLeft;
 			
 		      }
 		    }
 		
-		    if (CorrectRightBoundaryFlux)
+// 		    if (CorrectRightBoundaryFlux)
 //		      BoundaryFluxesThisTimeStep->RightFluxes[field][dim] [GridFluxIndex] =
 //			RefinedFluxes->RightFluxes[field][dim][FluxIndex];
 		
 		
 		      if( SUBlingGrid == FALSE ){
 
-			CorrectionAmount = 
+			CorrectionAmountRight = 
 			  -(InitialFluxes->RightFluxes[field][dim][FluxIndex] -
 			    RefinedFluxes->RightFluxes[field][dim][FluxIndex]);
 			  
-			BaryonField[field][FieldIndex + Offset] += CorrectionAmount;
+			BaryonField[field][FieldIndex + Offset] += CorrectionAmountRight;
 			
 		      }else{ /* if( SUBlingGrid == FALSE ){ */
-			  CorrectionAmount = 
+			  CorrectionAmountRight = 
 			    InitialFluxes->RightFluxes[field][dim][FluxIndex] -
 			    RefinedFluxes->LeftFluxes[field][dim][RefinedFluxIndex];
-			  BaryonField[field][FieldIndex + Offset] += CorrectionAmount;
+			  BaryonField[field][FieldIndex + Offset] += CorrectionAmountRight;
 			
 		      } // else{ /* if( SUBlingGrid == FALSE ){ */
 		    } // if(CorrectRightBaryonField)
 
 		      if (CorrectLeftBaryonField &&
 			  BaryonField[field][FieldIndex] <= 0) {
-			BaryonField[field][FieldIndex] -= CorrectionAmount;
+			BaryonField[field][FieldIndex] -= CorrectionAmountLeft;
 
 			if (SUBlingGrid == FALSE) {
 			  printf("P(%d) -- CFRFl warn: %e %e %e %e %"ISYM
 				 MyProcessorNumber, BaryonField[field][FieldIndex],
 				 InitialFluxes->LeftFluxes[field][dim][FluxIndex],
 				 RefinedFluxes->LeftFluxes[field][dim][FluxIndex],
-				 CorrectionAmount,
+				 CorrectionAmountLeft,
 				 i, j, k, dim, field);
 			  for (ffield = 0; ffield < NumberOfBaryonFields; ffield++)
 			    RefinedFluxes->LeftFluxes[ffield][dim][FluxIndex] =
 				 MyProcessorNumber, BaryonField[field][FieldIndex],
 				 InitialFluxes->LeftFluxes[field][dim][FluxIndex],
 				 RefinedFluxes->RightFluxes[field][dim][RefinedFluxIndex],
-				 CorrectionAmount,
+				 CorrectionAmountLeft,
 				 i, j, k, dim, field);
 			  for (ffield = 0; ffield < NumberOfBaryonFields; ffield++)
 			    RefinedFluxes->RightFluxes[ffield][dim][RefinedFluxIndex] =
 
 		      if (CorrectRightBaryonField &&
 			  BaryonField[field][FieldIndex+Offset] <= 0) {
-			BaryonField[field][FieldIndex+Offset] -= CorrectionAmount;
+			BaryonField[field][FieldIndex+Offset] -= CorrectionAmountRight;
 
 			if (SUBlingGrid == FALSE) {
 			  printf("P(%d) -- CFRFr warn: %e %e %e %e %"ISYM
 				 MyProcessorNumber, BaryonField[field][FieldIndex],
 				 InitialFluxes->RightFluxes[field][dim][FluxIndex],
 				 RefinedFluxes->RightFluxes[field][dim][FluxIndex],
-				 CorrectionAmount,
+				 CorrectionAmountRight,
 				 i, j, k, dim, field);
 			  for (ffield = 0; ffield < NumberOfBaryonFields; ffield++)
 			    RefinedFluxes->RightFluxes[ffield][dim][FluxIndex] =
 				 MyProcessorNumber, BaryonField[field][FieldIndex],
 				 InitialFluxes->LeftFluxes[field][dim][FluxIndex],
 				 RefinedFluxes->RightFluxes[field][dim][RefinedFluxIndex],
-				 CorrectionAmount,
+				 CorrectionAmountRight,
 				 i, j, k, dim, field);
 			  for (ffield = 0; ffield < NumberOfBaryonFields; ffield++)
 			    RefinedFluxes->LeftFluxes[ffield][dim][RefinedFluxIndex] =