Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,15 @@ public FissionReactor(int size, int depth, double controlRodInsertion) {
effectiveCoolantChannels = new ArrayList<>();
// 2pi * r^2 + 2pi * r * l
surfaceArea = (reactorRadius * reactorRadius) * Math.PI * 2 + reactorDepth * reactorRadius * Math.PI * 2;
structuralMass = reactorDepth * reactorRadius * reactorRadius * Math.PI *
300; // Assuming 300 kg/m^3 when it's basically empty, does not have to be precise

// Apparently we do need to initialize it here as well.
structuralMass = reactorDepth * reactorRadius * reactorRadius * Math.PI * 300;
}

public void prepareThermalProperties() {
structuralMass = reactorDepth * reactorRadius * reactorRadius * Math.PI *
300; // Assuming 300 kg/m^3 when it's basically empty, does not have to be precise

int idRod = 0, idControl = 0, idChannel = 0;

for (int i = 0; i < reactorLayout.length; i++) {
Expand Down Expand Up @@ -676,6 +680,7 @@ public void updatePressure() {
}

public void updateNeutronPoisoning() {
this.decayProductsAmount *= decayProductRate;
this.neutronPoisonAmount += this.decayProductsAmount * (1 - decayProductRate) * poisonFraction;
this.neutronPoisonAmount *= decayProductRate * Math.exp(-crossSectionRatio * power / surfaceArea);
}
Expand All @@ -699,14 +704,14 @@ public void updatePower() {
this.neutronFlux *= Math.exp(inverseReactorPeriod);

this.fuelDepletion += this.neutronFlux * reactorDepth;
this.decayProductsAmount += Math.max(neutronFlux, 0.) / 1000;
// Should be about 0.001x of the value of the variable "power".
this.decayProductsAmount += Math.max(neutronFlux, 0.) / 250000;

this.power = this.neutronFlux * this.neutronToPowerConversion;
} else {
this.neutronFlux *= 0.5;
this.power *= 0.5;
}
this.decayProductsAmount *= decayProductRate;
}

public boolean checkForMeltdown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void setInternalFuelRod(FuelRod rod) {

@Override
public boolean isDepleted(double totalDepletion) {
return this.depletionPoint <= totalDepletion;
return this.depletionPoint <= totalDepletion * this.internalFuelRod.getWeight();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/supercritical/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ supercritical.gui.fission.pressure=Pressure: %.3f Pa
supercritical.gui.fission.power=Power: %.3f MW / %.3f MW
supercritical.gui.fission.k_eff=Neutron multiplication factor: %f
supercritical.gui.fission.depletion=Current depletion: %f%%
supercritical.gui.fission.depleted_rod=Depleted rod: %s
supercritical.gui.fission.depleted_rod=Making %s

supercritical.gui.fission.lock.locked=Reactor locked and active!
supercritical.gui.fission.lock.unlocked=Reactor not active
Expand Down
Loading