Skip to content

Reactor lifetime for molten salt reactor counts up from 0 rather than down #20

@j-bos

Description

@j-bos

The displayed reactor lifetime counts up from zero as it accumulates Actinides. Should the "fuel_lifetime_d = Math.Min(fuel_lifetime_d, availability / fuel_use);" line be removed in the ReactorProducts loop?

            foreach (var product in current_fuel_mode.ReactorProducts)
            {
                double availability = getResourceAvailability(product.FuelName);
                GUILayout.BeginHorizontal();
                GUILayout.Label(product.FuelName, bold_label, GUILayout.Width(150));
                GUILayout.Label((availability * product.Density * 1000).ToString("0.000000") + " kg", GUILayout.Width(150));
                GUILayout.EndHorizontal();

                double fuel_use = total_power_per_frame * product.ProductUsePerMJ * fuelUsePerMJMult / TimeWarp.fixedDeltaTime / FuelEfficiency * current_fuel_mode.NormalisedReactionRate * GameConstants.EARH_DAY_SECONDS;
                fuel_lifetime_d = Math.Min(fuel_lifetime_d, availability / fuel_use);
                GUILayout.BeginHorizontal();
                GUILayout.Label(product.FuelName, bold_label, GUILayout.Width(150));
                GUILayout.Label(fuel_use.ToString("0.000000") + " " + product.Unit + "/day", GUILayout.Width(150));
                GUILayout.EndHorizontal();
            }

            PrintToGUILayout("Current Lifetime", (double.IsNaN(fuel_lifetime_d) ? "-" : (fuel_lifetime_d).ToString("0.00")) + " days", bold_label);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions