public double Fuel() { var fuel = 0.0; var a = new Assemblies(); while (_burningReactor.AssembliesCount >= MaxAssembliesCount) { RemoveBurntAssemblies(a); } int j = 0; double kinf = _burningReactor.NArray.Sum(x => x * (K0 - A * _burningReactor.DeltaE * j++)) / _burningReactor.NArray.Sum(); double r = Math.Sqrt(A2 * _burningReactor.AssembliesCount / Math.PI); double keff = kinf / (1 + Math.Pow(M * BesselConst / r, 2.0)); const double minFreshCount = 0.01; var freshAssemblies = new Assemblies(minFreshCount, 0.0, 1); while (keff < 1.0125) { _burningReactor.Insert(freshAssemblies); fuel += minFreshCount; j = 0; kinf = _burningReactor.NArray.Sum(x => x * (K0 - A * _burningReactor.DeltaE * j++)) / _burningReactor.NArray.Sum(); r = Math.Sqrt(A2 * _burningReactor.AssembliesCount / Math.PI); keff = kinf / (1 + Math.Pow(M * BesselConst / r, 2.0)); } _burningReactor.Mef = keff; _burningReactor.T += 1; return(fuel); }
public void Run() { Assemblies a = new Assemblies(); for (int i = 0; i < Days; i++) { a.Count = Count; a.E1 = _stoppedReactor.NArray.FindIndex(x => x > 0) * _stoppedReactor.DeltaE; a.E2 = a.E1 + DeltaE; var a1 = _stoppedReactor.Remove(a); _reactor.Insert(a1); _reactorSystem.DayPass(); } }
public void Run() { Assemblies a = new Assemblies(); Assemblies a1; bool tmp = true; for (int i = 0; i < Days; i++) { if (_reactor.AssembliesCount + Count < 1670) { a.Count = Count; if (tmp) { a.E1 = _stoppedReactor.NArray.FindIndex(x => x > 0) * _stoppedReactor.DeltaE; a.E2 = a.E1 + DeltaE; } else { //for (int k = StoppedReactor.NArray.Count - 1; k >= 0; k--) //{ // if (Math.Abs(StoppedReactor.NArray[k]) > 0.01) // { // a.E2 = k * StoppedReactor.DeltaE; // break; // } //} int id0 = _stoppedReactor.NArray.FindIndex(x => x > 0); int k = id0 + (_stoppedReactor.NArray.Count - id0) / 2; a.E2 = k * _stoppedReactor.DeltaE + DeltaE / 2; a.E1 = a.E2 - DeltaE; } a1 = _stoppedReactor.Remove(a); _reactor.Insert(a1); } _reactorSystem.DayPass(); tmp = !tmp; } }