Ejemplo n.º 1
0
        public Neutron(CustomPoint3D startPoint, double sigmaA, double sigmaTr)
        {
            this._sigmaA = sigmaA;
            this._sigmaTr = sigmaTr;
            this.AverageFreePathLength = 0;

            this.isAbsorbed = false;
            this.FreePathLength = new List<double>() { 0 };
            this.GuidedCos = new List<Vector3D>() { new Vector3D() };
            this.CollisionPoint = new List<CustomPoint3D>() { startPoint };
        }
Ejemplo n.º 2
0
        public Neutron(CustomPoint3D startPoint, double sigmaA, double sigmaS, double sigmaTr, double sigmaT)
        {
            _sigmaA = sigmaA;
            _sigmaS = sigmaS;
            _sigmaTr = sigmaTr;
            _sigmaT = sigmaT;
            AverageFreePathLength = 0;

            IsAbsorbed = false;
            FreePathLength = new List<double>() { 0 };
            GuidedCos = new List<Vector3D>() { new Vector3D() };
            CollisionPoint = new List<CustomPoint3D>() { startPoint };
        }
Ejemplo n.º 3
0
        private void SubStep(int step, CustomPoint3D startPoint)
        {
            var gamma1 = Rnd(double.Epsilon, 1);
            FreePathLength.Add(-Math.Log(gamma1) / _sigmaS);
            var gamma2x = Rnd(0, 1);
            var gamma2y = Rnd(0, 1);
            //var gamma2z = Rnd(0, 1);
            //var wz = 1 - 2 * gamma2z;
            //var tmp2 = Math.Sqrt(1 - Math.Pow(cosZ, 2));
            //var wx = tmp2 * Math.Cos(TwoPi * gamma2x);
            //var vy = tmp2 * Math.Sin(TwoPi * gamma2y);
            var wx = Math.Cos(TwoPi * gamma2x);
            var wy = Math.Sin(TwoPi * gamma2y);
            var wz = 0;
            GuidedCos.Add(new Vector3D(wx, wy, wz));
            CollisionPoint.Add(new CustomPoint3D(
                startPoint.X + GuidedCos[step].X * FreePathLength[step],
                startPoint.Y + GuidedCos[step].Y * FreePathLength[step],
                startPoint.Z + GuidedCos[step].Z * FreePathLength[step]));
            PathLength += FreePathLength[step];
            var gamma3 = Rnd(0, 1);
            if (gamma3 <= _sigmaA/_sigmaT)
                IsAbsorbed = true;

            //Console.WriteLine(@"FreePathLength: {0};	wx: {1};	wy: {2};wz: {3};	gamma3: {4};	SigmaA: {5};	SigmaTr: {6};	{7}", FreePathLength[step], wx, wy, wz, gamma3, _sigmaA, _sigmaTr, _sigmaA/_sigmaTr);
        }
Ejemplo n.º 4
0
 private void SubStep(int step, double gamma, CustomPoint3D startPoint)
 {
     FreePathLength.Add(-Math.Log(gamma) / _sigmaTr);
     var cosZ = 1 - 2 * gamma;
     var tmp2 = Math.Sqrt(1 - Math.Pow(cosZ, 2));
     GuidedCos.Add(new Vector3D(tmp2 * Math.Cos(TWO_PI * gamma), tmp2 * Math.Sin(TWO_PI * gamma), cosZ));
     CollisionPoint.Add(new CustomPoint3D(
         startPoint.X + GuidedCos[step].X * FreePathLength[step],
         startPoint.Y + GuidedCos[step].Y * FreePathLength[step],
         startPoint.Z + GuidedCos[step].Z * FreePathLength[step]));
     AverageFreePathLength = CustomPoint3D.DistanceBetween(CollisionPoint[step], CollisionPoint[step - 1]);
     if (Rnd(0, 1) <= _sigmaA/_sigmaTr)
         this.isAbsorbed = true;
 }