Exemple #1
0
        //protected virtual int pack_task(int, char*, int) = 0;
        //protected virtual int unpack_task(char*, int) = 0;
        //protected virtual void copy_task(int, int, int, int) = 0;

        //protected void grow_percell(int);
        //protected void grow_list();
        protected double mol_inflow(double indot, double vscale, double fraction)
        {
            double scosine = indot / vscale;

            if (scosine < -3.0)
            {
                return(0.0);
            }
            double inward_number_flux = vscale * fraction *
                                        (Math.Exp(-scosine * scosine) + Math.Sqrt(MyConst.MY_PI) * scosine * (1.0 + MyConst.Erf(scosine))) /
                                        (2 * Math.Sqrt(MyConst.MY_PI));

            return(inward_number_flux);
        }
Exemple #2
0
        public override double vremax_init(int igroup, int jgroup)
        {
            // parent has set mixture ptr

            List <Particle.Species> species = sparta.particle.species;

            double[] vscale    = mixture.vscale;
            int[]    mix2group = mixture.mix2group;
            int      nspecies  = sparta.particle.nspecies;

            double vrmgroup = 0.0;

            for (int isp = 0; isp < nspecies; isp++)
            {
                if (mix2group[isp] != igroup)
                {
                    continue;
                }
                for (int jsp = 0; jsp < nspecies; jsp++)
                {
                    if (mix2group[jsp] != jgroup)
                    {
                        continue;
                    }

                    double diam  = 0.5 * (mparams[isp].diam + mparams[jsp].diam);
                    double omega = 0.5 * (mparams[isp].omega + mparams[jsp].omega);
                    double tref  = 0.5 * (mparams[isp].tref + mparams[jsp].tref);
                    double mr    = species[isp].mass * species[jsp].mass /
                                   (species[isp].mass + species[jsp].mass);
                    double cxs = diam * diam * MyConst.MY_PI;
                    prefactor[isp, jsp] = cxs * Math.Pow(2.0 * sparta.update.boltz * tref / mr, omega - 0.5) / MyConst.Gamma(2.5 - omega);
                    double beta = Math.Max(vscale[isp], vscale[jsp]);
                    double vrm  = 2.0 * cxs * beta;
                    vrmgroup = Math.Max(vrmgroup, vrm);
                }
            }

            return(vrmgroup);
        }