public OvLayer EulerStep(double tau, OvLayer dqLayer, bool synchMe = true, bool syncDqLayer = true, bool calcDqLayerFluxes = true)
        {
            var lr0 = this;

            if (synchMe)
            {
                foreach (var c in lr0.RealCells)
                {
                    c.Sync();
                }
                lr0.SetBounds();
            }

            if (calcDqLayerFluxes)
            {
                foreach (var b in dqLayer.RealBounds)
                {
                    b.SetFlux();
                }
            }

            var lr1 = lr0.Clone() as OvLayer;

            lr1.StrechStep(tau);
            for (int i = 0; i < lr1.RealCells.Count; i++)
            {
                var c_0  = lr0.RealCells[i];
                var c_n  = lr1.RealCells[i];
                var c_dq = dqLayer.RealCells[i];
                var qs   = (c_0.q * c_0.W + tau * c_dq.Get_dQS()) / c_n.W;

                c_n.SetQ(qs);
            }
            return(lr1);
        }
Esempio n. 2
0
        public static WBSolver GetNewSolver2(WBProjectOptions options)
        {
            var layerOpts2 = StandartOpts;
            var geom       = new GunShape();

            geom.AddPoint(layerOpts2.X_left - 0.2, 0.132);
            geom.AddPoint(layerOpts2.X_right + 5, 0.132);
            var initLayer = new OvLayer();

            initLayer.Geom = geom;
            GunPowder powder = new GunPowder();

            powder = powder_AGARD();
            List <GunPowder> powder_list = new List <GunPowder>()
            {
                powder
            };
            List <double> conc_list = new List <double>()
            {
                1
            };
            MixtureGunPowder mixture = new MixtureGunPowder(powder_list, conc_list);

            initLayer.InitLayer(0d, layerOpts2, MySuoerFunc(mixture), InitOvBound);
            var grid   = new OvGridRK("OvGrid_tst1", initLayer);
            var solver = new WBSolver(grid, options);

            initLayer.SynchNodes_X_V();
            return(solver);
        }
Esempio n. 3
0
 public OvGridRK(string name, IWBNodeLayer initLayer) : base(name, initLayer)
 {
     lrInit            = initLayer as OvLayer;
     lrInit.LeftBorder = new OvBorderWall()
     {
         OwnerLayer = lrInit,
         BorderPos  = WBBorderPos.leftBorder
     };
     lrInit.RightBorder = new OvBorderWall()
     {
         OwnerLayer = lrInit,
         A_0_func   = A_0_function,
         BorderPos  = WBBorderPos.rightBorder
     };
 }