Skip to content

Commit

Permalink
fix: prevent NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jul 4, 2024
1 parent d365547 commit 7f4535b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public ControlRod(double maxTemperature, boolean tipModeration, double thermalCo

public static void normalizeWeights(ArrayList<ControlRod> effectiveControlRods, int fuelRodNum) {
for (ControlRod control_rod : effectiveControlRods) {
control_rod.weight /= (fuelRodNum * fuelRodNum) - fuelRodNum;
if (fuelRodNum != 1)
control_rod.weight /= (fuelRodNum * fuelRodNum) - fuelRodNum;
}
}

Expand Down

0 comments on commit 7f4535b

Please sign in to comment.