Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuclear fission #2093

Open
wants to merge 199 commits into
base: master
Choose a base branch
from
Open

Nuclear fission #2093

wants to merge 199 commits into from

Conversation

Zalgo239
Copy link
Member

@Zalgo239 Zalgo239 commented Sep 24, 2023

What

This is the fabled Nuclear Fission PR (most anticipated event since the release of Half Life 3, the second coming of Christ, the full release of Star Citizen, the backport of Create to 1.12.2 (latest real version), a shader mod that isn't Optifine, the end of Micro$oft's practices slowly ruining the game, the mystery video from Ghostipedia, the release of Mechaenetia etc...).
Aim of this is to finally add a nuclear fission reactor that feels realistic, intuitive and original into the mod.

Implementation Details

The main focus of this are multiblocks, new ones are added:

  • Fission Reactor
  • Heat Exchanger
  • Spent Fuel Pool
  • Gas Centrifuge

Each one performs a specific function that a nuclear program just can't go without.

Gas Centrifuge

A large, assembly line like multilayer machine that takes in fluorides of elements (as gases) and separates the isotopes based on their mass, inspired by modern Zippe-type centrifuges.

Heat Exchanger

A simpler structure, it can transfer heat between fluids, depending on its configuration it can perform both cocurrent and countercurrent flow. Here is a handy diagram on what that means.

Spent Fuel Pool

This is where spent fuel rods are placed while they are fresh out of the reactor, in this state they are still producing a lot of decay heat, so they must be kept in a pool of water that gets cycled and cooled. Swimming on the pool is safe but diving to the rods will lead to radiation poisoning and possibly to the worst possible death imaginable, we shall just use an AABB of instant death for now.
Also, the water has to be purified to prevent erosion of the cladding on fuel rods and the release of radioactive material, therefore there should be a punishment for leaving the spent fuel pool out in the rain.

Fission Reactor

The one thing you wanted to read about, and that I did not want to write about due to how much there is to unpack here.
The reactor is a very unique multiblock in many ways, first being its structure, it's in fact the first GT multiblock that is a cylinder with variable radius and height. The interior is almost completely freeform, with the only requirement being that each horizontal slice inside to be identical to the ones above and below. The logic of the reactor is relatively simple, it transitions between multiple known operational regimes with varying speeds depending on factors depending on the geometry of the reactor, the fuel / coolant used, and on the way the machine is operated in general.
The reactor has "stats" that are calculated from the interior geometry when the structure is formed. This is to avoid having to recalculate them many times as this is relatively intensive. The calculation is an iteration over every possible pair of fuel rods inside the reactor, and proceeds roughly as follows:

  1. For each pair a moderation factor depending on the distance and materials between the rods is calculated and saved to a matrix, this will be used to determine how much slow or fast neutron flux each rod will receive, only paths that do not have an extra fuel rod in the middle are considered (to simplify calculations);
  2. With a similar procedure all the control rods that are effective are found (they are only effective if placed in the path between two or more fuel rods);
  3. The same procedure also finds how many coolant channels are intercepted by neutron flux, this is used to calculate a void coefficient to simulate the effects of coolant boiling inside the reactor.

From the results of the iteration described above and with a fair bit of averaging a series of reactor stats are produced, these dictate how the reactor will behave when activated. Overall the system is pretty forgiving, making a working reactor shouldn't be too difficult and accidents will generally only occurr when people make either large mistakes or try to push their designs too far.

This required new special hatches to be implemented that are "locked" when the reactor is active to prevent the fuel or coolant type from being swapped while the reactor is running. Allowing hotswapping would potentially carry a significant performance loss as the stats have to be recalculated each time those things are changed.

New material properties are introduced, to track stats on the effectiveness as a fuel/coolant/moderator.

Outcome

The new machines mentioned above and their respective mechanics are added. This includes new special blocks to give them a unique look.

Additional Information

Example Gas Centrifuges build.
2023-09-16_16 34 37

Potential Compatibility Issues

A new API package is added to contain nuclear related classes and interfaces. Other hatches have been added too as mentioned before, as well as new material properties. Considering that these are all additions and not changes per se I don't expect significant compatibility issues to arise.

The Big Checklist

  • Add Fission Reactor Structure
  • Add Spent Fuel Pool Structure
  • Add Heat Exchanger Structure
  • Add Gas Centrifuge Structure
  • Fission Reactor stats calculation
  • Hatches only allow one type of item/fluid IO when the reactor is formed or active
  • Hatches check reactor geometry to ensure proper placement
  • Fuel consumption logic
  • Hot coolant output logic
  • Consequences of failures (meltdowns and possible explosions)
  • Radiation damage from spent fuel items
  • Recipe autogeneration from material properties
  • Go through every material and add the appropriate properties to them :desolate:.

@Zalgo239 Zalgo239 added status: open for discussion Issue or PR is open for discussion type: feature New feature or request labels Sep 24, 2023
@screret
Copy link
Member

screret commented Sep 24, 2023

oh fuck more shit to port

@StarL0st
Copy link
Contributor

Epic

@PrototypeTrousers
Copy link
Contributor

  • Should this be rebased on the 2.8 branch?

@ALongStringOfNumbers ALongStringOfNumbers added type: feature New feature or request and removed type: feature New feature or request labels Oct 4, 2023
@serenibyss serenibyss added this to the 2.9 milestone Oct 31, 2023
@htmlcsjs htmlcsjs added the deployment: artifact PR should build artifacts label Dec 31, 2023
@htmlcsjs htmlcsjs marked this pull request as ready for review December 31, 2023 11:13
@htmlcsjs htmlcsjs requested a review from a team as a code owner December 31, 2023 11:13
@Zalgo239 Zalgo239 requested a review from a team as a code owner January 5, 2024 00:19
@serenibyss serenibyss force-pushed the nuclear-fission branch 2 times, most recently from ec0b657 to ed24504 Compare January 5, 2024 00:29
@bruberu bruberu requested a review from a team as a code owner June 2, 2024 18:35
@@ -1,4 +1,4 @@
name: Nuclear Test Release
name: Java CI with Gradle on main Commit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to remove this workflow before merging this PR. Not something to do quite yet though, writing this as a reminder for later.

gradle.properties Outdated Show resolved Hide resolved
src/main/java/gregtech/api/capability/ICoolantHandler.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/capability/IFuelRodHandler.java Outdated Show resolved Hide resolved
@bruberu bruberu mentioned this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment: artifact PR should build artifacts status: open for discussion Issue or PR is open for discussion type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.