Пример #1
0
        // ==========================
        // Check boundary conditions
        // ==========================



        // ========================
        // Check level set movement
        // ========================

        //[Test] Deactivated, because failing & to much variations
        public static void LineMovementTest(
            [Values(LevelSetEvolution.FastMarching, LevelSetEvolution.ExtensionVelocity, LevelSetEvolution.ScalarConvection, LevelSetEvolution.Fourier)]  LevelSetEvolution lsEvo,
            [Values(LevelSetHandling.Coupled_Once, LevelSetHandling.LieSplitting, LevelSetHandling.Coupled_Iterative)] LevelSetHandling lsHandl,
            [Values(TimeSteppingScheme.ImplicitEuler, TimeSteppingScheme.CrankNicolson, TimeSteppingScheme.BDF2)] TimeSteppingScheme tsScheme,
            [Values(0.5)] double cLength)
        {
            var C = PhysicalBasedTestcases.ChannelFlow.CF_LevelSetMovementTest(1, cLength, lsEvo, lsHandl, tsScheme);

            using (var solver = new XNSE_SolverMain())
            {
                solver.Init(C);
                solver.RunSolverMode();

                double[] BmQ_LL = solver.ComputeBenchmarkQuantities_LineInterface();

                double err_thrsld = 1e-4;

                // length of contact-line
                double err = Math.Abs(2 - BmQ_LL[0]);
                Assert.Less(err, err_thrsld, "error interface length");
                Console.WriteLine("error in interface length = {0}", err);

                // area of species
                err = Math.Abs(cLength * 1 - BmQ_LL[1]);
                Assert.Less(err, err_thrsld, "error in area");
                Console.WriteLine("error in area = {0}", err);
            }
        }
Пример #2
0
        public static void TestRayleighTaylorInstability()
        {
            var C = BoSSS.Application.XNSE_Solver.PhysicalBasedTestcases.RayleighTaylorInstability.RT_Test();

            using (var solver = new XNSE_SolverMain()) {
                solver.Init(C);
                solver.RunSolverMode();
            }
        }
Пример #3
0
        public static void TestCapillaryWave()
        {
            var C = BoSSS.Application.XNSE_Solver.PhysicalBasedTestcases.CapillaryWave.CW_Test();

            using (var solver = new XNSE_SolverMain()) {
                solver.Init(C);
                solver.RunSolverMode();
            }
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        //[Test] Deactivated, because failing & to much variations
        public static void CircleMovementTest(
            [Values(LevelSetEvolution.FastMarching, LevelSetEvolution.ExtensionVelocity, LevelSetEvolution.ScalarConvection, LevelSetEvolution.Fourier)]  LevelSetEvolution lsEvo,
            [Values(LevelSetHandling.Coupled_Once, LevelSetHandling.LieSplitting, LevelSetHandling.Coupled_Iterative)] LevelSetHandling lsHandl,
            [Values(TimeSteppingScheme.ImplicitEuler, TimeSteppingScheme.CrankNicolson, TimeSteppingScheme.BDF2)] TimeSteppingScheme tsScheme,
            [Values(0.25)] double cLength)
        {
            Assert.False(lsEvo == LevelSetEvolution.ScalarConvection, "ScalarConvection is not working due to wrong Agglomeration!");
            var C = PhysicalBasedTestcases.ChannelFlow.CF_LevelSetMovementTest(2, cLength, lsEvo, lsHandl, tsScheme);

            using (var solver = new XNSE_SolverMain())
            {
                solver.Init(C);
                solver.RunSolverMode();

                double[] BmQ_RB = solver.ComputeBenchmarkQuantities_RisingBubble();

                double err_thrsld = 1e-4;

                // area
                double err = Math.Abs(cLength * cLength * Math.PI - BmQ_RB[0]);
                Assert.Less(err, err_thrsld, "error in area");
                Console.WriteLine("error in area = {0}", err);

                // x-position
                err = Math.Abs(0.6 - BmQ_RB[1]);
                Assert.Less(err, err_thrsld, "error in x-position too high");
                Console.WriteLine("error in x-position = {0}", err);

                // y-position
                err = Math.Abs(0.5 - BmQ_RB[2]);
                Assert.Less(err, err_thrsld, "error in y-position too high");
                Console.WriteLine("error in y-position = {0}", err);

                // circularity
                err = Math.Abs(1.0 - BmQ_RB[3]);
                Assert.Less(err, err_thrsld, "error in circularity too high");
                Console.WriteLine("error in circularity = {0}", err);

                // x-velocity
                err = Math.Abs(1.0 - BmQ_RB[4]);
                Assert.Less(err, err_thrsld, "error in x-velocity too high");
                Console.WriteLine("error in x-velocity = {0}", err);

                // y-velocity
                err = Math.Abs(BmQ_RB[5]);
                Assert.Less(err, err_thrsld, "error in y-velocity too high");
                Console.WriteLine("error in y-velocity = {0}", err);
            }
        }
Пример #5
0
        //[Test] Deactivated, because failing & to much variations
        public static void SlottedDiskRotationTest(
            [Values(LevelSetEvolution.FastMarching, LevelSetEvolution.ExtensionVelocity, LevelSetEvolution.ScalarConvection, LevelSetEvolution.Fourier)]  LevelSetEvolution lsEvo,
            [Values(LevelSetHandling.Coupled_Once, LevelSetHandling.LieSplitting, LevelSetHandling.Coupled_Iterative)] LevelSetHandling lsHandl,
            [Values(XNSE_Control.TimesteppingScheme.ImplicitEuler, XNSE_Control.TimesteppingScheme.CrankNicolson, XNSE_Control.TimesteppingScheme.BDF2)] XNSE_Control.TimesteppingScheme tsScheme,
            [Values(0.25)] double cLength)
        {
            Assert.False(lsEvo == LevelSetEvolution.ScalarConvection, "ScalarConvection is not working due to wrong Agglomeration!");
            var C = PhysicalBasedTestcases.ChannelFlow.CF_LevelSetRotationTest(2, cLength, lsEvo, lsHandl, tsScheme);

            using (var solver = new XNSE_SolverMain())
            {
                solver.Init(C);
                solver.RunSolverMode();

                double[] BmQ_RB = solver.ComputeBenchmarkQuantities_RisingBubble();

                double err_thrsld = 1e-4;

                double[]     xCutout = new double[] { -0.1, 0.1 };
                ZalesaksDisk disk    = new ZalesaksDisk(xCutout, -0.1, cLength);

                double diskArea = disk.GetArea();

                // area
                double err = Math.Abs(diskArea - BmQ_RB[0]);
                Assert.Less(err, err_thrsld, "error in area");
                Console.WriteLine("error in area = {0}", err);

                // x-position
                err = Math.Abs(0.0 - BmQ_RB[1]);
                Assert.Less(err, err_thrsld, "error in x-position too high");
                Console.WriteLine("error in x-position = {0}", err);

                // y-position
                err = Math.Abs(0.0 - BmQ_RB[2]);
                Assert.Less(err, err_thrsld, "error in y-position too high");
                Console.WriteLine("error in y-position = {0}", err);

                // x-velocity
                err = Math.Abs(0.0 - BmQ_RB[4]);
                Assert.Less(err, err_thrsld, "error in x-velocity too high");
                Console.WriteLine("error in x-velocity = {0}", err);

                // y-velocity
                err = Math.Abs(0.0 - BmQ_RB[5]);
                Assert.Less(err, err_thrsld, "error in y-velocity too high");
                Console.WriteLine("error in y-velocity = {0}", err);
            }
        }