Esempio n. 1
0
        public static FSI_Control TestParticleInShearFlow(int k = 2)
        {
            FSI_Control C = new FSI_Control(k, "ParticleInShearFlow");
            // grid and boundary conditions
            // ============================
            List <string> boundaryValues = new List <string> {
                "Velocity_Inlet_left",
                "Velocity_Inlet_right",
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 4, lengthY: 6, cellsPerUnitLength: 5, periodicX: false, periodicY: true);
            C.SetAddaptiveMeshRefinement(amrLevel: 1);

            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityY", X => 0.02);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityY", X => - 0.02);
            C.Timestepper_LevelSetHandling      = LevelSetHandling.LieSplitting;
            C.hydrodynamicsConvergenceCriterion = 1e-1;
            double particleDensity = 1;

            C.gravity = new Vector(0, 0);
            InitializeMotion motion = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, false, true);

            C.Particles.Add(new Particle_Sphere(motion, 0.4, new double[] { 0.0, 0.0 }));
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.25;
            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================
            C.AdvancedDiscretizationOptions.PenaltySafety = 1;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.1;
            C.LevelSetSmoothing                   = false;
            C.LinearSolver.SolverCode             = LinearSolverCode.classic_pardiso;
            C.LinearSolver.MaxSolverIterations    = 100;
            C.LinearSolver.MinSolverIterations    = 1;
            C.NonLinearSolver.MaxSolverIterations = 100;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;

            // Timestepping
            // ============

            C.Timestepper_Scheme = FSI_Control.TimesteppingScheme.BDF2;
            double dt = 0.1;

            C.dtFixed       = dt;
            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 120;
            C.NoOfTimesteps = 25;



            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 2
0
        public static FSI_Control TestHydrodynamicForces(int k = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "HydrodynamicForces");
            //C.SetSaveOptions(@"/home/ij83requ/default_bosss_db", 1);

            List <string> boundaryValues = new List <string> {
                "Velocity_Inlet_left",
                "Pressure_Outlet_right",
                "Wall_lower",
                "Wall_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 8, lengthY: 6, cellsPerUnitLength: 2, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel: 1);
            C.hydrodynamicsConvergenceCriterion = 1e-4;
            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityX", X => 1.0);

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 0.1;
            C.PhysicalParameters.mu_A     = 1e-1;
            C.PhysicalParameters.Material = true;
            double particleDensity = 1.0;

            C.gravity = new Vector(0, 0);
            InitializeMotion motion = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, false, false, 1);

            // Particle Properties
            // =============================
            C.Particles = new List <Particle>();
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle_Sphere(motion, 0.5, new double[] { 0.0, 0.0 }, startAngl: 0));
            }

            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;

            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = true;

            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LSunderrelax = 1.0;

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000;



            // Timestepping
            // =============================
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-3;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1e-3;
            C.NoOfTimesteps = 2;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 3
0
        /// <summary>
        /// Testing of particle/wall interactions using a single particle
        /// </summary>
        public static FSI_Control Test_DryParticleCollision(string _DbPath = null, bool MeshRefine = false)
        {
            FSI_Control C = new FSI_Control {
                // basic database options
                // ======================

                DbPath             = _DbPath,
                savetodb           = _DbPath != null,
                saveperiod         = 1,
                ProjectName        = "ParticleCollisionTest",
                ProjectDescription = "Gravity"
            };

            C.SessionName = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = true;


            // DG degrees
            // ==========

            C.SetDGdegree(1);

            // grid and boundary conditions
            // ============================

            double[] Xnodes = GenericBlas.Linspace(-1, 1, 21);
            double[] Ynodes = GenericBlas.Linspace(-1, 1, 21);
            double   h      = Math.Min((Xnodes[1] - Xnodes[0]), (Ynodes[1] - Ynodes[0]));

            C.GridFunc = delegate {
                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);
                grd.EdgeTagNames.Add(1, "Wall");
                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 1;
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Wall");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;


            // Fluid Properties
            C.PhysicalParameters.rho_A = 1;
            C.PhysicalParameters.mu_A  = 0.1;


            // Particles
            // =========

            C.pureDryCollisions = true;
            double             particleDensity = 1.0;
            ParticleMotionInit motion          = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions);

            C.Particles.Add(new Particle_Sphere(motion, 0.15, new double[] { -0.6, +0.1 }, startAngl: 90.0, startTransVelocity: new double[] { 1, 0 }, startRotVelocity: 0));

            C.Particles.Add(new Particle_Sphere(motion, 0.15, new double[] { +0.6, -0.1 }, startAngl: 90.0, startTransVelocity: new double[] { -1, 0 }, startRotVelocity: 0));

            C.collisionModel = FSI_Control.CollisionModel.MomentumConservation;

            double V = 0;

            foreach (var p in C.Particles)
            {
                V = Math.Max(V, p.Motion.GetTranslationalVelocity(0).L2Norm());
            }

            if (V <= 0)
            {
                throw new ArithmeticException();
            }


            // Physical Parameters
            // ===================
            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.AdaptiveMeshRefinement = MeshRefine;

            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;

            double dt = (h / V) * (MeshRefine ? 0.5 * 0.5 * 0.5 * 0.2 : 0.1);

            C.dtMax = dt;
            C.dtMin = dt;

            C.Endtime       = 100.0 / V;
            C.NoOfTimesteps = 200;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 4
0
        public static FSI_Control Test_HydrodynamicForces(int k = 2)
        {
            FSI_Control C = new FSI_Control {
                // basic database options
                // =============================
                //C.DbPath = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\straightChannel";
                savetodb           = false,
                saveperiod         = 1,
                ProjectName        = "Test_singleActiveParticle",
                ProjectDescription = "Test_singleActiveParticle"
            };

            C.SessionName = C.ProjectName;
            C.Tags.Add("activeParticle");

            // DG degrees
            // =============================
            C.SetDGdegree(k);

            // Grid
            // =============================
            //Generating grid
            C.GridFunc = delegate
            {
                int q = new int(); // #Cells in x-dircetion + 1
                int r = new int(); // #Cells in y-dircetion + 1

                q = 40;
                r = 30;

                double[] Xnodes = GenericBlas.Linspace(-4, 4, q);
                double[] Ynodes = GenericBlas.Linspace(-3, 3, r);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_right");
                grd.EdgeTagNames.Add(3, "Wall_lower");
                grd.EdgeTagNames.Add(4, "Wall_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-4)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-4)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-3)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-3)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };


            // Mesh refinement
            // =============================
            C.AdaptiveMeshRefinement = false;
            C.RefinementLevel        = 1;


            // Boundary conditions
            // =============================
            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityX", X => 1.0);
            C.AddBoundaryValue("Pressure_Outlet_right");//, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Wall_upper");


            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 0.1;  //pg/(mum^3)
            C.PhysicalParameters.mu_A     = 1e-1; //pg(mum*s)
            C.PhysicalParameters.Material = true;
            C.gravity = new double[] { 0, 0 };
            double particleDensity = 1.0;

            C.hydrodynamicsConvergenceCriterion = 1e-2;
            ParticleUnderrelaxationParam underrelaxationParam = new ParticleUnderrelaxationParam(C.hydrodynamicsConvergenceCriterion, ParticleUnderrelaxationParam.UnderrelaxationMethod.ProcentualRelaxation, 9, true);
            ParticleMotionInit           motion = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions, false, false, underrelaxationParam, 1);

            // Particle Properties
            // =============================
            C.Particles = new List <Particle>();
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle_Sphere(motion, 0.5, new double[] { 0.0, 0.0 }, startAngl: 0));
            }

            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;

            //Initial Values
            // =============================
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);

            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = true;

            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LSunderrelax = 1.0;

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000;



            // Timestepping
            // =============================
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-3;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1e-3;
            C.NoOfTimesteps = 2;

            // haben fertig...
            // ===============

            return(C);
        }
        public static FSI_Control StickyTrap(string _DbPath = null, int k = 2, double VelXBase = 0.0, double angle = 0.0)
        {
            FSI_Control C = new FSI_Control();


            const double BaseSize = 1.0;


            // basic database options
            // ======================

            //C.DbPath = @"\\dc1\userspace\deriabina\bosss_db";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = false;
            C.RefinementLevel        = 2;
            C.SessionName            = "fjkfjksdfhjk";

            C.pureDryCollisions = true;
            C.SetDGdegree(k);

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate
            {
                int q, r;

                q = 40;
                r = 40;

                double[] Xnodes = GenericBlas.Linspace(-1.5 * BaseSize, 1.5 * BaseSize, q + 1);
                double[] Ynodes = GenericBlas.Linspace(-1.5 * BaseSize, 1.5 * BaseSize, r + 1);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Wall_left");
                grd.EdgeTagNames.Add(2, "Wall_right");
                grd.EdgeTagNames.Add(3, "Pressure_Outlet_lower");
                grd.EdgeTagNames.Add(4, "Pressure_Outlet_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }

                    if (Math.Abs(X[1] - (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }


                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };

            C.GridPartType = GridPartType.Hilbert;

            C.AddBoundaryValue("Wall_left");
            C.AddBoundaryValue("Wall_right");
            C.AddBoundaryValue("Pressure_Outlet_lower");
            C.AddBoundaryValue("Pressure_Outlet_upper");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;

            // Fluid Properties
            C.PhysicalParameters.rho_A = 1.0;
            C.PhysicalParameters.mu_A  = 0.1;
            C.CoefficientOfRestitution = 0;

            // Particle Properties
            //C.PhysicalParameters.mu_B = 0.1;
            //C.particleMass = 1;


            C.Particles.Add(new Particle_Sphere(new double[] { 0.0, 0.6 })
            {
                radius_P                 = 0.18,
                particleDensity          = 4,
                GravityVertical          = -9.81,
                AddaptiveUnderrelaxation = true,
                underrelaxation_factor   = 9,// underrelaxation with [factor * 10^exponent]
                ClearSmallValues         = true,
                neglectAddedDamping      = false,
                IncludeRotation          = false
            });

            C.Particles.Add(new Particle_superEllipsoid(new double[] { 0.45, 0 }, startAngl: 45)
            {
                particleDensity = 1,
                thickness_P     = 0.2,
                length_P        = 0.4,
                //radius_P = 0.4,
                superEllipsoidExponent = 4,
                GravityVertical        = -0,
                IncludeRotation        = false,
                IncludeTranslation     = false,
            });


            C.Particles.Add(new Particle_superEllipsoid(new double[] { -0.45, 0 }, startAngl: -45)
            {
                particleDensity = 1,
                thickness_P     = 0.2,
                length_P        = 0.4,
                //radius_P = 0.4,
                superEllipsoidExponent = 4,
                GravityVertical        = -0,
                IncludeRotation        = false,
                IncludeTranslation     = false,
            });
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);
            C.PhysicalParameters.IncludeConvection = false;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = true;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.ForceAndTorque_ConvergenceCriterion = 1e-2;


            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 10.0;
            C.NoOfTimesteps = 50;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 6
0
        public static FSI_Control TestActiveParticle(string _DbPath = null, int k = 2, double VelXBase = 0.0, double stressM = 1e0, double cellAgg = 0.2, int maxCurv = 20, double muA = 1e0, double timestepX = 1e-3)
        {
            FSI_Control C = new FSI_Control();


            // General scaling parameter
            // =============================
            const double BaseSize = 1.0e0;


            // basic database options
            // =============================
            //C.DbPath = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\active_particle_test";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "ActiveParticleTest";
            C.ProjectDescription = "Active";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");


            // DG degrees
            // =============================
            C.SetDGdegree(k);


            // Grid
            // =============================
            //Generating grid
            C.GridFunc = delegate
            {
                int q = new int(); // #Cells in x-dircetion + 1
                int r = new int(); // #Cells in y-dircetion + 1

                q = 20;
                r = 8;

                double[] Xnodes = GenericBlas.Linspace(-5 * BaseSize, 5 * BaseSize, q);
                double[] Ynodes = GenericBlas.Linspace(-2 * BaseSize, 2 * BaseSize, r);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Wall_left");
                grd.EdgeTagNames.Add(2, "Wall_right");
                grd.EdgeTagNames.Add(3, "Wall_lower");
                grd.EdgeTagNames.Add(4, "Wall_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };


            // Mesh refinement
            // =============================
            C.AdaptiveMeshRefinement = true;
            C.RefinementLevel        = 2;
            C.maxCurvature           = maxCurv;


            // Boundary conditions
            // =============================
            C.AddBoundaryValue("Wall_left");  //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_right"); //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Wall_upper");


            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 0.9982e0; //pg/(mum^3)
            C.PhysicalParameters.mu_A     = muA;      //pg(mum*s)
            C.PhysicalParameters.Material = true;


            // Particle Properties
            // =============================
            // Defining particles
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle_Sphere(new double[] { 0 + 14 * d, 0.0 }, startAngl: 180 * d)
                {
                    radius_P        = 1,
                    particleDensity = 1.5,//pg/(mum^3)
                    GravityVertical = 0,
                    ActiveParticle  = true,
                    ActiveStress    = stressM,
                    //thickness_P = 0.1 * BaseSize,  Sphere kann nur einen radius haben! fk.
                    //length_P = 2 * BaseSize,       Sphere kann nur einen radius haben! fk.
                    //superEllipsoidExponent = 4, // only even numbers are supported
                    AddaptiveUnderrelaxation = true, // set true if you want to define a constant underrelaxation (not recommended)
                    underrelaxation_factor   = 9,    // underrelaxation with [factor * 10^exponent]
                });
            }
            //Define level-set
            //Func<double[], double, double> phiComplete = delegate (double[] X, double t)
            //{
            //    //Generating the correct sign
            //    int exp = C.Particles.Count - 1;
            //    double ret = Math.Pow(-1, exp);
            //    //Level-set function depending on #particles
            //    for (int i = 0; i < C.Particles.Count; i++)
            //    {
            //        ret *= C.Particles[i].Phi_P(X);
            //    }
            //    return ret;
            //};


            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;


            //Initial Values
            // =============================
            //C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);


            // For restart
            // =============================
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6 -b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = false;


            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = cellAgg;
            C.LevelSetSmoothing = false;
            //C.MaxSolverIterations = 1000;
            //C.MinSolverIterations = 1;
            //C.NoOfMultigridLevels = 1;
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;

            C.ForceAndTorque_ConvergenceCriterion = 1e-6;
            C.LSunderrelax = 1.0;


            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;
            C.max_iterations_fully_coupled = 10000;

            // Timestepping
            // =============================
            //switch (C.Timestepper_LevelSetHandling)
            //{
            //    case LevelSetHandling.Coupled_Once:
            //        C.Timestepper_Mode = FSI_Control.TimesteppingMode.MovingMesh;
            //        break;

            //    case LevelSetHandling.Coupled_Iterative:
            //        C.Timestepper_Mode = FSI_Control.TimesteppingMode.MovingMesh;
            //        break;

            //    case LevelSetHandling.LieSplitting:
            //        C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            //        break;

            //    case LevelSetHandling.StrangSplitting:
            //        C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            //        break;

            //    case LevelSetHandling.None:
            //        C.Timestepper_Mode = FSI_Control.TimesteppingMode.None;
            //        break;
            //}
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = timestepX;//s

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1000000;
            C.NoOfTimesteps = 10000;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 7
0
        public static FSI_Control TestActiveParticle(string _DbPath = null, int k = 2, double VelXBase = 0.0, double stressM = 1, double cellAgg = 0.2, int maxCurv = 20, double muA = 1e-1)
        {
            FSI_Control C = new FSI_Control();


            // General scaling parameter
            // =============================
            const double BaseSize = 1.0;


            // basic database options
            // =============================
            //C.DbPath = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\active_particle_test";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "ActiveParticleTest";
            C.ProjectDescription = "Active";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");


            // DG degrees
            // =============================
            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree   = k - 1,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Curvature", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });


            // Grid
            // =============================
            //Generating grid
            C.GridFunc = delegate {
                int q = new int();
                int r = new int();

                switch (99)
                {
                case 1:
                    q = 60;
                    r = 178;
                    break;

                case 2:
                    q = 41;
                    r = 121;
                    break;

                case 3:
                    q = 31;
                    r = 91;
                    break;

                case 99:
                    q = 20;
                    r = 100;
                    break;

                default:

                    throw new ApplicationException();
                }

                double[] Xnodes = GenericBlas.Linspace(-1 * BaseSize, 1 * BaseSize, q);
                double[] Ynodes = GenericBlas.Linspace(-10 * BaseSize, 0 * BaseSize, r);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Pressure_Outlet_left");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_right");
                grd.EdgeTagNames.Add(3, "Wall_lower");
                grd.EdgeTagNames.Add(4, "Pressure_Outlet_upper");


                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-1 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-1 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-10 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-0 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };


            //Mesh refinement
            // =============================
            C.AdaptiveMeshRefinement = true;
            C.RefinementLevel        = 2;
            C.maxCurvature           = maxCurv;


            // Boundary conditions
            // =============================
            C.AddBoundaryValue("Pressure_Outlet_left");  //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Pressure_Outlet_right"); //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Pressure_Outlet_upper");


            // Coupling Properties
            // =============================
            //C.LevelSetMovement = "coupled";
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.splitting_fully_coupled      = true;
            C.max_iterations_fully_coupled = 1000;
            C.includeRotation    = true;
            C.includeTranslation = true;


            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 0.9982; //pg/(mum^3)
            C.PhysicalParameters.mu_A     = muA;    //pg(mum*s)
            C.PhysicalParameters.Material = true;


            // Particle Properties
            // =============================
            // Defining particles
            C.Particles = new List <Particle>();
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle(2, 9, new double[] { 0 + 14.0 * d, -1.0 }, startAngl: 180.0 * d, shape: Particle.ParticleShape.elliptic)
                                //Generates a series of opposing particles
                {
                    radius_P           = 1,
                    rho_P              = 1.1,//pg/(mum^3)
                    includeGravity     = true,
                    active_P           = false,
                    stress_magnitude_P = stressM,
                    thickness_P        = 0.05,
                    length_P           = 0.5,
                    velResidual_ConvergenceCriterion = 1e-18,
                    underrelaxationFT_constant       = false,
                    underrelaxationFT_exponent       = -0,
                    underrelaxation_factor           = 0.5
                });
            }
            //Define level-set
            Func <double[], double, double> phiComplete = delegate(double[] X, double t)
            {
                //Generating the correct sign
                int    exp = C.Particles.Count - 1;
                double ret = Math.Pow(-1, exp);
                //Level-set function depending on #particles
                for (int i = 0; i < C.Particles.Count; i++)
                {
                    ret *= C.Particles[i].phi_P(X, t);
                }
                return(ret);
            };


            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;


            //Initial Values
            // =============================
            C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);


            // For restart
            // =============================
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6 -b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = false;


            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = cellAgg;
            C.LevelSetSmoothing             = false;
            C.MaxSolverIterations           = 1000;
            C.MinSolverIterations           = 1;
            C.NoOfMultigridLevels           = 1;
            C.LevelSet_ConvergenceCriterion = 5e-10;
            C.LSunderrelax = 1.0;


            // Timestepping
            // =============================
            C.Timestepper_Mode   = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;//s

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 10;
            C.NoOfTimesteps = 10000;



            // haben fertig...
            // ===============

            return(C);
        }
        /// <summary>
        /// Testing of particle/wall interactions using a single particle
        /// </summary>
        public static FSI_Control SingleDryParticleAgainstWall(string _DbPath = null, bool MeshRefine = true)
        {
            FSI_Control C = new FSI_Control();

            // basic database options
            // ======================

            C.DbPath             = _DbPath;
            C.savetodb           = _DbPath != null;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = true;


            // DG degrees
            // ==========

            C.SetDGdegree(1);

            // grid and boundary conditions
            // ============================

            double[] Xnodes = GenericBlas.Linspace(-1, 1, 31);
            double[] Ynodes = GenericBlas.Linspace(-1, 1, 31);
            double   h      = Math.Min((Xnodes[1] - Xnodes[0]), (Ynodes[1] - Ynodes[0]));

            C.GridFunc = delegate {
                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);
                grd.EdgeTagNames.Add(1, "Wall");
                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 1;
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Wall");

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;


            // Fluid Properties
            C.PhysicalParameters.rho_A = 1;
            C.PhysicalParameters.mu_A  = 0.1;

            // Particles
            // =========
            C.Particles.Add(new Particle_Sphere(new double[] { -0.5, -0.5 }, startAngl: 90.0)
            {
                particleDensity = 1.0,
                radius_P        = 0.1,
            });
            C.Particles[0].TranslationalVelocity[0][0] = +1;
            C.Particles[0].TranslationalVelocity[0][1] = -1;
            C.Particles[0].RotationalVelocity[0]       = 0;
            C.pureDryCollisions = true;
            C.collisionModel    = FSI_Control.CollisionModel.MomentumConservation;

            double V = 0;

            foreach (var p in C.Particles)
            {
                V = Math.Max(V, p.TranslationalVelocity[0].L2Norm());
            }

            if (V <= 0)
            {
                throw new ArithmeticException();
            }


            // Physical Parameters
            // ===================

            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.AdaptiveMeshRefinement = MeshRefine;
            C.RefinementLevel        = 1;

            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;

            double dt = (h / V) * (MeshRefine ? 0.5 * 0.5 * 0.5 * 0.2 : 0.1);

            C.dtMax = dt;
            C.dtMin = dt;

            C.Endtime       = 100.0 / V;
            C.NoOfTimesteps = 500;

            // haben fertig...
            // ===============

            C.LevelSetSmoothing = false;
            return(C);
        }
Esempio n. 9
0
        public static FSI_Control ParticleUnderGravity(int k = 2, double VelXBase = 0.0, bool movingMesh = true, bool restart = false)
        {
            //List<FSI_Control> R = new List<FSI_Control>();

            // foreach (int i in new int[] {1,2, 3 }) {
            string restartSession = "e73d770a-d26f-412b-b4f2-c68421898e9e";
            string restartGrid    = "dff0fdc4-fc46-4e94-acc3-9ad99e7be5cf";

            FSI_Control C = new FSI_Control();

            const double BaseSize = 1.0;

            C.Paramstudy_CaseIdentification = new Tuple <string, object>[] {
                new Tuple <string, object>("k", k),
            };

            // k = i;

            // basic database options
            // ======================

            //C.DbPath = _DbPath;
            C.DbPath     = @"\\hpccluster\hpccluster-scratch\krause\cluster_db";
            C.savetodb   = true;
            C.saveperiod = 1;

            C.Tags.Add("ParticleUnderGravity");
            C.Tags.Add("k" + k);
            C.Tags.Add("restart_" + restart);

            if (movingMesh)
            {
                C.ProjectDescription = "ParticleUnderGravity_dt0.001_" + k + "_MM";
                C.ProjectName        = "ParticleUnderGravity_dt0.001_k" + k + "_MM";
                C.SessionName        = "ParticleUnderGravity_dt0.001_k" + k + "_MM"; //_MFVOneStepGaussAndStokes
                C.Tags.Add("MM");
            }
            else
            {
                C.ProjectDescription = "ParticleUnderGravity_dt0.001_k" + k + "_SP";
                C.ProjectName        = "ParticleUnderGravity_dt0.001_k" + k + "_SP";
                C.SessionName        = "ParticleUnderGravity_dt0.001_k" + k + "_SP";
                C.Tags.Add("SP");
            }
            // DG degrees
            // ==========

            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree   = k - 1,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });

            // restart options
            // ===============
            if (restart)
            {
                C.RestartInfo = new Tuple <Guid, TimestepNumber>(new Guid(restartSession), -1);
                C.GridGuid    = new Guid(restartGrid);
            }

            // grid and boundary conditions
            // ============================
            if (!restart)
            {
                C.GridFunc = delegate
                {
                    int q = new int();
                    int r = new int();

                    switch (k)
                    {
                    case 1:
                        q = 113; //60; DoF 150000: 113-191
                        r = 191; //178;
                        break;

                    case 2:
                        q = 71;  //41; DoF 150000: 71-141
                        r = 141; //121;
                        break;

                    case 3:
                        q = 45;  //45;//31;
                        r = 129; //129;//91;
                        break;

                    default:

                        throw new ApplicationException();
                    }

                    double[] Xnodes = GenericBlas.Linspace(-1 * BaseSize, 1 * BaseSize, q); //k1: 71; k2:41; k3: 31
                    double[] Ynodes = GenericBlas.Linspace(0 * BaseSize, 6 * BaseSize, r);  //k1: 211; k2:121; k3: 91

                    var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                    grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                    grd.EdgeTagNames.Add(2, "Velocity_Inlet_right");
                    grd.EdgeTagNames.Add(3, "Wall_lower");
                    grd.EdgeTagNames.Add(4, "Pressure_Outlet");


                    grd.DefineEdgeTags(delegate(double[] X)
                    {
                        byte et = 0;
                        if (Math.Abs(X[0] - (-1 * BaseSize)) <= 1.0e-8)
                        {
                            et = 1;
                        }
                        if (Math.Abs(X[0] + (-1 * BaseSize)) <= 1.0e-8)
                        {
                            et = 2;
                        }
                        if (Math.Abs(X[1] - (0 * BaseSize)) <= 1.0e-8)
                        {
                            et = 3;
                        }
                        if (Math.Abs(X[1] + (-6 * BaseSize)) <= 1.0e-8)
                        {
                            et = 4;
                        }

                        Debug.Assert(et != 0);
                        return(et);
                    });

                    Console.WriteLine("Cells:" + grd.NumberOfCells);

                    return(grd);
                };
                C.Particles = new List <Particle>();

                C.Particles.Add(new Particle(2, 4, new double[] { 0.0, 4.0 })
                {
                    radius_P = 0.125,
                    rho_P    = 1.25,
                });

                //Func<double[], double, double> phi = (X, t) => -(X[0] - C.initialPos[0][0]).Pow2() + -(X[1] - C.initialPos[0][1]).Pow2() + C.particleRadius.Pow2();
                //Func<double[], double, double> phi = (X, t) => -(X[0] - t+X[1]);
                //C.MovementFunc = phi;

                C.InitialValues_Evaluators.Add("Phi", X => C.Particles[0].phi_P(X, 0));
                //C.InitialValues.Add("VelocityX#B", X => 1);
                C.InitialValues_Evaluators.Add("VelocityX", X => 0);
                C.InitialValues_Evaluators.Add("VelocityY", X => 0);
                //C.InitialValues.Add("Phi", X => -1);
                //C.InitialValues.Add("Phi", X => (X[0] - 0.41));
            }


            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityY", X => 0);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityY", X => 0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Pressure_Outlet");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;
            C.includeRotation    = false;
            C.includeTranslation = true;

            // Fluid Properties
            C.PhysicalParameters.rho_A = 1.0;
            C.PhysicalParameters.mu_A  = 0.1;

            // Particle Properties
            //C.particleRho = 1.25; // 1.25;
            //C.PhysicalParameters.mu_B = 0.1;
            //C.particleRadius = 0.125;
            //C.particleMass = Math.PI * C.particleRadius * C.particleRadius * C.particleRho;
            //C.particleMass = 1;



            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6-b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // ===================

            C.PhysicalParameters.IncludeConvection = true;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing   = false;
            C.MaxSolverIterations = 100;


            // Timestepping
            // ============

            if (movingMesh)
            {
                C.Timestepper_Mode = FSI_Control.TimesteppingMode.MovingMesh;
            }
            else
            {
                C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            }

            C.NonlinearSolve = IBM_Solver.NonlinearSolverCodes.Picard;
            C.LinearSolve    = IBM_Solver.LinearSolverCodes.classic_mumps;

            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = 0.001;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1;
            C.NoOfTimesteps = 1000000;

            // haben fertig...
            // ===============

            return(C);
            // R.Add(C);
            //}

            //return R.ToArray();
        }
Esempio n. 10
0
        public static FSI_Control Test2ActiveParticle(string _DbPath = null, int k = 2, double VelXBase = 0.0, double stressM = 100)
        {
            FSI_Control C = new FSI_Control();


            const double BaseSize = 1.0;

            //C.Paramstudy_CaseIdentification = new Tuple<string, object>[] {
            //                    new Tuple<string,object>("k", k),
            //                };

            // k = i;

            // basic database options
            // ======================
            //C.DbPath = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\active_particle_test";
            C.savetodb           = false;
            C.saveperiod         = 5;
            C.ProjectName        = "Active2ParticleTest";
            C.ProjectDescription = "Active2";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = true;
            C.RefinementLevel        = 2;


            // DG degrees
            // ==========

            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree   = k - 1,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });


            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate {
                int q = new int();
                int r = new int();

                switch (99)
                {
                case 1:
                    q = 60;
                    r = 178;
                    break;

                case 2:
                    q = 41;
                    r = 121;
                    break;

                case 3:
                    q = 31;
                    r = 91;
                    break;

                case 99:
                    q = 80;
                    r = 25;
                    break;

                default:

                    throw new ApplicationException();
                }

                //q = 16;
                //r = 46;

                double[] Xnodes = GenericBlas.Linspace(-5 * BaseSize, 15 * BaseSize, q); //k1: 71; k2:41; k3: 31
                double[] Ynodes = GenericBlas.Linspace(-3 * BaseSize, 3 * BaseSize, r);  //k1: 211; k2:121; k3: 91

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                grd.EdgeTagNames.Add(2, "Velocity_Inlet_right");
                grd.EdgeTagNames.Add(3, "Pressure_Outlet_lower");
                grd.EdgeTagNames.Add(4, "Pressure_Outlet_upper");


                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-15 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-3 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-3 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };



            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityX", X => 0.0);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityX", X => 0.0);
            C.AddBoundaryValue("Pressure_Outlet_lower");
            C.AddBoundaryValue("Pressure_Outlet_upper");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;
            C.includeRotation    = true;
            C.includeTranslation = true;

            // Fluid Properties
            C.PhysicalParameters.rho_A    = 1.0;
            C.PhysicalParameters.mu_A     = 0.25;
            C.PhysicalParameters.Material = true;

            //Defining particles
            C.Particles = new List <Particle>();
            int numOfParticles = 2;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle(2, 4, new double[] { 10.0 * d, 0.0 }, startAngl: d *180.0, shape: Particle.ParticleShape.elliptic)
                {
                    radius_P           = 1,
                    rho_P              = 1.0,
                    active_P           = true,
                    stress_magnitude_P = stressM,
                    thickness_P        = 1.0,
                    length_P           = 3.0
                });
            }
            //Define level-set
            Func <double[], double, double> phiComplete = delegate(double[] X, double t)
            {
                int    exp = C.Particles.Count - 1;
                double ret = Math.Pow(-1, exp);
                for (int i = 0; i < C.Particles.Count; i++)
                {
                    ret *= C.Particles[i].phi_P(X, t);
                }
                return(ret);
            };

            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.OneStepGaussAndStokes;


            //Func<double[], double, double> phiComplete = (X, t) => -1 * (C.Particles[0].phi_P(X, t)) * (C.Particles[1].phi_P(X, t));
            //Func<double[], double, double> phiComplete = (X, t) => -1 * (C.Particles[0].phi_P(X, t) * C.Particles[1].phi_P(X, t));
            //for (int i = 0;i<C.Particles.Count; i++) {
            //    phiComplete = (X,t) => phiComplete(X,t)*C.Particles[i].phi_P(X,t);
            //}


            //Func<double[], double, double> phi = (X, t) => -(X[0] - t+X[1]);
            //C.MovementFunc = phi;

            C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            //C.InitialValues_Evaluators.Add("Phi", X => -1);
            //C.InitialValues.Add("VelocityX#B", X => 1);
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);
            //C.InitialValues.Add("Phi", X => -1);
            //C.InitialValues.Add("Phi", X => (X[0] - 0.41));

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6 -b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // ===================

            C.PhysicalParameters.IncludeConvection = true;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing   = false;
            C.MaxSolverIterations = 100;
            C.NoOfMultigridLevels = 1;


            // Timestepping
            // ============

            C.Timestepper_Mode   = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 0.001;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 10;
            C.NoOfTimesteps = 100000;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 11
0
        public static FSI_Control IBMCylinderFlowUhlmann(string _DbPath = null, int k = 2, bool xPeriodic = false, double VelXBase = 0.0, bool movingMesh = true)
        {
            FSI_Control C = new FSI_Control();

            //const double BaseSize = 1.0;
            //const double MeshFactor = 0.43;

            // basic database options
            // ======================



            C.DbPath     = _DbPath;
            C.savetodb   = true;
            C.saveperiod = 300;

            C.Tags.Add("OscillatingCylinder");
            C.Tags.Add("k" + k);

            if (movingMesh)
            {
                C.ProjectDescription = "OscillatingCylinder_k" + k + "_MM";
                C.ProjectName        = "OscillatingCylinder_k" + k + "_MM";
                C.SessionName        = "OscillatingCylinder_k" + k + "_MM";
                C.Tags.Add("MM");
            }
            else
            {
                C.ProjectDescription = "OscillatingCylinder_k" + k + "_SP";
                C.ProjectName        = "OscillatingCylinder_k" + k + "_SP";
                C.SessionName        = "OscillatingCylinder_k" + k + "_SP";
                C.Tags.Add("SP");
            }

            // DG degrees
            // ==========

            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree   = k - 1,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });

            // grid and boundary conditions
            // ============================

            //C.GridFunc = delegate {



            //    var _xNodes1 = Grid1D.TanhSpacing(-6.17, -1, Convert.ToInt32(15 * MeshFactor), 2.1, false); //15
            //    _xNodes1 = _xNodes1.GetSubVector(0, (_xNodes1.Length - 1));
            //    var _xNodes2 = GenericBlas.Linspace(-1, 1.5, Convert.ToInt32(50 * MeshFactor)); //50
            //    _xNodes2 = _xNodes2.GetSubVector(0, (_xNodes2.Length - 1));
            //    var _xNodes3 = Grid1D.TanhSpacing(1.5, 20.5, Convert.ToInt32(50 * MeshFactor), 2, true); //50

            //    var xNodes = ArrayTools.Cat(_xNodes1, _xNodes2, _xNodes3);


            //    var _yNodes1 = Grid1D.TanhSpacing(-13.3, -1.2, Convert.ToInt32(15 * MeshFactor), 2.5, false); //15
            //    _yNodes1 = _yNodes1.GetSubVector(0, (_yNodes1.Length - 1));
            //    var _yNodes2 = GenericBlas.Linspace(-1.2, 1.2, Convert.ToInt32(40 * MeshFactor)); //40
            //    _yNodes2 = _yNodes2.GetSubVector(0, (_yNodes2.Length - 1));
            //    var _yNodes3 = Grid1D.TanhSpacing(1.2, 13.3, Convert.ToInt32(15 * MeshFactor), 2.5, true); //15

            //    var yNodes = ArrayTools.Cat(_yNodes1, _yNodes2, _yNodes3);

            //    //double[] xNodes = GenericBlas.Linspace(-6.17, 20.5, 50);
            //    //double[] yNodes = GenericBlas.Linspace(-13.3, 13.3, 50);
            //    var grd = Grid2D.Cartesian2DGrid(xNodes, yNodes, periodicX: xPeriodic);
            //    grd.EdgeTagNames.Add(1, "Velocity_Inlet_lower");
            //    grd.EdgeTagNames.Add(2, "Velocity_Inlet_upper");
            //    if (!xPeriodic) {
            //        grd.EdgeTagNames.Add(3, "Velocity_Inlet_left");
            //        grd.EdgeTagNames.Add(4, "Pressure_Outlet_right");
            //    }
            //    //grd.EdgeTagNames.Add(1, "Outflow_lower");
            //    //grd.EdgeTagNames.Add(2, "Outflow_upper");
            //    //if (!xPeriodic)
            //    //{
            //    //    grd.EdgeTagNames.Add(3, "Velocity_Inlet_left");
            //    //    grd.EdgeTagNames.Add(4, "Pressure_Outlet_right");
            //    //}

            //    grd.DefineEdgeTags(delegate (double[] X) {
            //        byte et = 0;
            //        if (Math.Abs(X[1] - (-13.3)) <= 1.0e-8)
            //            et = 1;
            //        if (Math.Abs(X[1] + (-13.3)) <= 1.0e-8)
            //            et = 2;
            //        if (!xPeriodic && Math.Abs(X[0] - (-6.17)) <= 1.0e-8)
            //            et = 3;
            //        if (!xPeriodic && Math.Abs(X[0] + (-20.5)) <= 1.0e-8)
            //            et = 4;


            //        Debug.Assert(et != 0);
            //        return et;
            //    });

            //    Console.WriteLine("Cells:    {0}", grd.NumberOfCells);

            //    return grd;
            //};

            C.GridFunc = delegate
            {
                int q2 = new int();
                int r2 = new int();
                int q3 = new int();
                int r3 = new int();

                switch (k)
                {
                case 1:
                    q2 = 35;
                    r2 = 25;
                    q3 = 105;
                    r3 = 75;
                    break;

                case 2:
                    q2 = 28;
                    r2 = 20;
                    q3 = 64;
                    r3 = 48;
                    break;

                case 3:
                    q2 = 21;
                    r2 = 15;
                    q3 = 39;
                    r3 = 36;
                    break;

                default:

                    throw new ApplicationException();
                }

                // Box1
                var box1_p1 = new double[2] {
                    -6.17, -13.3
                };
                var box1_p2 = new double[2] {
                    20.5, 13.3
                };
                var box1 = new GridCommons.GridBox(box1_p1, box1_p2, 15, 15); //k1: ; k2: 15,15; k3: 15,15

                // Box2
                var box2_p1 = new double[2] {
                    -2, -4
                };
                var box2_p2 = new double[2] {
                    10, 4
                };
                var box2 = new GridCommons.GridBox(box2_p1, box2_p2, q2, r2); //k1: 35,25 ; k2: 28,20; k3: 21, 15


                // Box3
                var box3_p1 = new double[2] {
                    -1.5, -2.5
                };
                var box3_p2 = new double[2] {
                    6, 2.5
                };
                var box3 = new GridCommons.GridBox(box3_p1, box3_p2, q3, r3); //k1: 105, 75 ; k2: 64,48; k3: 39, 36

                var grd = Grid2D.HangingNodes2D(box1, box2, box3);

                grd.EdgeTagNames.Add(1, "Pressure_Outlet_lower");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_upper");
                if (!xPeriodic)
                {
                    grd.EdgeTagNames.Add(3, "Velocity_Inlet_left");
                    grd.EdgeTagNames.Add(4, "Pressure_Outlet_right");
                }

                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[1] - (-13.3)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[1] + (-13.3)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (!xPeriodic && Math.Abs(X[0] - (-6.17)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (!xPeriodic && Math.Abs(X[0] + (-20.5)) <= 1.0e-8)
                    {
                        et = 4;
                    }


                    // Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:    {0}", grd.NumberOfCells);

                return(grd);
            };


            C.AddBoundaryValue("Pressure_Outlet_lower");
            C.AddBoundaryValue("Pressure_Outlet_upper");
            if (!xPeriodic)
            {
                C.AddBoundaryValue("Velocity_Inlet_left", "VelocityX", X => 1);
            }
            C.AddBoundaryValue("Pressure_Outlet_right");

            //C.AddBoundaryCondition("Outflow_lower");
            //C.AddBoundaryCondition("Outflow_upper");
            //if (!xPeriodic)
            //{
            //    C.AddBoundaryCondition("Velocity_Inlet_left", "VelocityX#A", X => 1);
            //}
            //C.AddBoundaryCondition("Pressure_Outlet_right");

            // Level-Set Movement
            // ===================

            double radius = 0.5;

            C.includeRotation              = false;
            C.includeTranslation           = false;
            C.Timestepper_LevelSetHandling = LevelSetHandling.None;
            C.PhysicalParameters.rho_A     = 1;
            C.PhysicalParameters.mu_A      = 1.0 / 185;


            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) =>0 };

            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0.25 * Math.PI * 2 * 0.166 * -Math.Sin(Math.PI * 2 * 0.195 * t) };

            Func <double, double>           yLevSet = t => (0.2 * Math.Cos(Math.PI * 2 * 0.156 * t));
            Func <double[], double, double> phi     = (X, t) => - (X[0]).Pow2() + -(X[1] - yLevSet(t)).Pow2() + radius.Pow2();

            //Func<double[], double, double> phi = (X, t) => -(X[0]).Pow2() + -(X[1]-1).Pow2() + radius.Pow2();
            C.MovementFunc = phi;

            Func <double, double> xVelocity = t => 0;
            Func <double, double> yVelocity = t => (0.2 * Math.PI * 2 * 0.156 * -Math.Sin(Math.PI * 2 * 0.156 * t));

            Func <double, double>[] particleTransVelocity = { xVelocity, yVelocity };
            Func <double, double>[] particleAnglVelocity  = { xVelocity, xVelocity };

            C.transVelocityFunc = particleTransVelocity;
            C.anglVelocityFunc  = particleAnglVelocity;

            // Initial Values
            // ==============

            C.InitialValues_Evaluators.Add("Phi", X => phi(X, 0));
            ////C.InitialValues.Add("Phi", X => -1);

            C.InitialValues_Evaluators.Add("VelocityX", X => 1);
            //C.InitialValues_Evaluators.Add("VelocityX#B", X => 0);
            ////C.InitialValues.Add("VelocityY#A", X => osciVelocity(X, 0));
            //C.InitialValues.Add("VelocityX", delegate (double[] X) {
            //    double x = X[0];
            //    double y = X[1];

            //    double R = Math.Sqrt((x + 1).Pow2() + y.Pow2());

            //    double xVel = 1;

            //    if (R < 0.75) {
            //        xVel = 1;
            //    }
            //    return xVel;
            //});

            ////C.InitialValues.Add("VelocityY", delegate (double[] X)
            ////{
            ////    double x = X[0];
            ////    double y = X[1];

            ////    double R = Math.Sqrt((x + 2).Pow2() + y.Pow2());

            ////    double yVel = 0;

            ////    if (R < 0.75)
            ////    {
            ////        yVel = 1;
            ////    }
            ////    return yVel;
            ////});

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("8bef674a-7e37-45a0-9ee2-81a7f0cd02eb"), 1500);
            //C.GridGuid = new Guid("be76c5d5-010c-41a5-b342-e87b42d9734e");

            // Physical Parameters
            // ===================
            C.PhysicalParameters.IncludeConvection = true;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing        = false;
            C.MaxKrylovDim             = 20;
            C.MaxSolverIterations      = 100;
            C.VelocityBlockPrecondMode = MultigridOperator.Mode.SymPart_DiagBlockEquilib_DropIndefinite;
            C.NoOfMultigridLevels      = 0;

            // Timestepping
            // ============

            if (movingMesh)
            {
                C.Timestepper_Mode = FSI_Control.TimesteppingMode.MovingMesh;
            }
            else
            {
                C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            }
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = 0.1;

            C.dtFixed       = dt;
            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 300;
            C.NoOfTimesteps = 1000000000;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 12
0
        public static FSI_Control ParticleInShearFlow(string _DbPath = null, int k = 2, double VelXBase = 0.0, double particleRadius = 1)
        {
            FSI_Control C = new FSI_Control();

            const double BaseSize = 1.0;

            // basic database options
            // ======================

            C.DbPath             = _DbPath;
            C.savetodb           = true;
            C.ProjectName        = "ShearFlow_k" + k + "_particleRadius" + particleRadius;
            C.SessionName        = "ShearFlow_k" + k + "_particleRadius" + particleRadius;
            C.ProjectDescription = "ShearFlow_k" + k + "_particleRadius" + particleRadius;

            C.Tags.Add("ParticleInShearFlow");
            C.Tags.Add("k" + k);

            // Timesteps
            // ==========
            double dt;

            if (particleRadius == 1)
            {
                dt = 1;
            }
            else if (particleRadius == 0.4)
            {
                dt = 0.5;
            }
            else if (particleRadius == 0.2)
            {
                dt = 0.25;
            }
            else
            {
                throw new ApplicationException();
            }

            // DG degrees
            // ==========

            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree   = k - 1,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate
            {
                double[] Xnodes = GenericBlas.Linspace(-2 * BaseSize, 2 * BaseSize, 21);
                double[] Ynodes = GenericBlas.Linspace(-3 * BaseSize, 3 * BaseSize, 31);
                var      grd    = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: true);

                grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                grd.EdgeTagNames.Add(2, "Velocity_Inlet_right");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                return(grd);
            };



            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityY", X => 0.02);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityY", X => - 0.02);

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;
            C.includeTranslation           = false;
            C.includeRotation = true;

            // Particle Properties
            double particleDensity = 1;

            //C.particleRho = 1;
            C.particleRadius = particleRadius;
            //C.particleMass = Math.PI * C.particleRadius * C.particleRadius * C.particleRho;
            //C.particleMass = Math.PI * C.particleRadius * C.particleRadius * particleDensity;

            Func <double, double>           yLevSet = t => (t * t);
            Func <double[], double, double> phi     = (X, t) => - (X[0]).Pow2() + -(X[1]).Pow2() + C.particleRadius.Pow2();

            //Func<double[], double, double> phi = (X, t) => -(X[0] - t+X[1]);
            //C.MovementFunc = phi;

            C.InitialValues_Evaluators.Add("Phi", X => phi(X, 0));
            //C.InitialValues.Add("VelocityX#B", X => 1);
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);
            //C.InitialValues.Add("Phi", X => -1);
            //C.InitialValues.Add("Phi", X => (X[0] - 0.41));

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("fec14187-4e12-43b6-af1e-e9d535c78668"), -1);


            // Physical Parameters
            // ===================

            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.01;
            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing   = false;
            C.MaxSolverIterations = 100;
            C.NoOfMultigridLevels = 1;

            // Timestepping
            // ============

            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.Timestepper_Mode   = FSI_Control.TimesteppingMode.None;
            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 500;
            C.NoOfTimesteps = 2500;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 13
0
        public static FSI_Control IBMCylinderFlow(string _DbPath = null, int k = 2, double Re = 20, bool xPeriodic = false)
        {
            FSI_Control C = new FSI_Control();

            C.Paramstudy_CaseIdentification = new Tuple <string, object>[] {
                new Tuple <string, object>("k", k),
            };


            const double BaseSize = 1.0;

            // basic database options
            // ======================

            C.DbPath             = _DbPath;
            C.savetodb           = true;
            C.ProjectDescription = "IBMCylinder_k" + k + "_Re" + Re;
            C.ProjectName        = "IBMCylinder_k" + k + "_Re" + Re;
            C.SessionName        = "IBMCylinder_k" + k + "_Re" + Re;

            switch (k)
            {
            case 1:
                C.MeshFactor = 1.33;     // was 1.33
                break;

            case 2:
                C.MeshFactor = 0.92;
                break;

            case 3:
                C.MeshFactor = 0.7;     // was 07
                break;

            default:

                throw new ApplicationException();
            }

            C.Tags.Add("IBMCylinderFlow");
            C.Tags.Add("k" + k);

            // DG degrees
            // ==========

            C.FieldOptions.Add("VelocityX", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("VelocityY", new FieldOpts()
            {
                Degree   = k,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            //Console.WriteLine("Achtung: equal order!!!!");
            C.FieldOptions.Add("Pressure", new FieldOpts()
            {
                Degree = k - 1,

                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("PhiDG", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });
            C.FieldOptions.Add("Phi", new FieldOpts()
            {
                Degree   = 2,
                SaveToDB = FieldOpts.SaveToDBOpt.TRUE
            });

            //grid and boundary conditions
            // ============================

            C.GridFunc = delegate
            {
                var _xNodes1 = Grid1D.TanhSpacing(-2, -1, Convert.ToInt32(10 * C.MeshFactor), 0.5, false); //10
                _xNodes1 = _xNodes1.GetSubVector(0, (_xNodes1.Length - 1));
                var _xNodes2 = GenericBlas.Linspace(-1, 2, Convert.ToInt32(35 * C.MeshFactor));            //35
                _xNodes2 = _xNodes2.GetSubVector(0, (_xNodes2.Length - 1));
                var _xNodes3 = Grid1D.TanhSpacing(2, 20, Convert.ToInt32(60 * C.MeshFactor), 1.5, true);   //60

                var xNodes = ArrayTools.Cat(_xNodes1, _xNodes2, _xNodes3);


                var _yNodes1 = Grid1D.TanhSpacing(-2, -1, Convert.ToInt32(7 * C.MeshFactor), 0.9, false); //7
                _yNodes1 = _yNodes1.GetSubVector(0, (_yNodes1.Length - 1));
                var _yNodes2 = GenericBlas.Linspace(-1, 1, Convert.ToInt32(25 * C.MeshFactor));           //25
                _yNodes2 = _yNodes2.GetSubVector(0, (_yNodes2.Length - 1));
                var _yNodes3 = Grid1D.TanhSpacing(1, 2.1, Convert.ToInt32(7 * C.MeshFactor), 1.1, true);  //7
                var yNodes   = ArrayTools.Cat(_yNodes1, _yNodes2, _yNodes3);



                //double[] xNodes = GenericBlas.Linspace(0 * BaseSize, 22 * BaseSize, 25);
                //double[] yNodes = GenericBlas.Linspace(0 * BaseSize, 4.1 * BaseSize, 25);
                var grd = Grid2D.Cartesian2DGrid(xNodes, yNodes, periodicX: xPeriodic);
                grd.EdgeTagNames.Add(1, "Velocity_Inlet_upper");
                grd.EdgeTagNames.Add(2, "Velocity_Inlet_lower");
                if (!xPeriodic)
                {
                    grd.EdgeTagNames.Add(3, "Velocity_Inlet_left");
                    grd.EdgeTagNames.Add(4, "Pressure_Outlet_right");
                }

                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[1] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[1] - (+2.1 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (!xPeriodic && Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (!xPeriodic && Math.Abs(X[0] - (+20.0 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }


                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:    {0}", grd.NumberOfCells);

                return(grd);
            };

            //C.GridFunc = delegate {

            //    // Box1
            //    var box1_p1 = new double[2] { -2, -2 };
            //    var box1_p2 = new double[2] { 20, 2.1 };
            //    var box1 = new GridBox(box1_p1, box1_p2, 46, 20); //k1: 70,25 ; k2: 46,20 ; k3: 35,15

            //    // Box2
            //    var box2_p1 = new double[2] { -2, -2 };
            //    var box2_p2 = new double[2] { 3, 2.1 };
            //    var box2 = new GridBox(box2_p1, box2_p2, 26, 40); //k1: 40,50 ; k2: 26,40; k3: 20, 30

            //    // Box3
            //    var box3_p1 = new double[2] { -2, -1 };
            //    var box3_p2 = new double[2] { 1, 1 };
            //    var box3 = new GridBox(box3_p1, box3_p2, 32, 38); //k1: 48,58  ; k2: 32,38; k3: 24, 30

            //    // Box4
            //    var box4_p1 = new double[2] { -0.7, -0.72 };
            //    var box4_p2 = new double[2] { 0.7, 0.7 };
            //    var box4 = new GridBox(box4_p1, box4_p2, 30, 56); //k1: 44,84  ; k2: 30,56; k3: 22, 42

            //    var grd = Grid2D.HangingNodes2D(box1, box2, box3,box4);

            //    grd.EdgeTagNames.Add(1, "Velocity_Inlet_upper");
            //    grd.EdgeTagNames.Add(2, "Velocity_Inlet_lower");
            //    if (!xPeriodic) {
            //        grd.EdgeTagNames.Add(3, "Velocity_Inlet_left");
            //        grd.EdgeTagNames.Add(4, "Pressure_Outlet_right");
            //    }

            //    grd.DefineEdgeTags(delegate (double[] X) {
            //        byte et = 0;
            //        if (Math.Abs(X[1] - (-2 * BaseSize)) <= 1.0e-8)
            //            et = 1;
            //        if (Math.Abs(X[1] - (+2.1 * BaseSize)) <= 1.0e-8)
            //            et = 2;
            //        if (!xPeriodic && Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
            //            et = 3;
            //        if (!xPeriodic && Math.Abs(X[0] - (+20.0 * BaseSize)) <= 1.0e-8)
            //            et = 4;


            //        Debug.Assert(et != 0);
            //        return et;
            //    });

            //    Console.WriteLine("Cells:    {0}", grd.NumberOfCells);

            //    return grd;
            //};

            C.AddBoundaryValue("Velocity_Inlet_upper", "VelocityX", X => 0);
            C.AddBoundaryValue("Velocity_Inlet_lower", "VelocityX", X => 0); //-(4 * 1.5 * X[1] * (4.1 - X[1]) / (4.1 * 4.1))
            if (!xPeriodic)
            {
                C.AddBoundaryValue("Velocity_Inlet_left", "VelocityX", X => (4 * 1.5 * (X[1] + 2) * (4.1 - (X[1] + 2)) / (4.1 * 4.1)));
                //C.AddBoundaryCondition("Velocity_Inlet_left", "VelocityX#A", X => 1);
            }
            C.AddBoundaryValue("Pressure_Outlet_right");


            // Initial Values
            // ==============

            double radius = 0.5;

            C.PhysicalParameters.rho_A = 1;
            C.PhysicalParameters.mu_A  = 1.0 / Re;

            //C.InitialValues.Add("Phi", X => phi(X, 0));

            //C.InitialValues.Add("Phi", X => ((X[0] / (radius * BaseSize)) - mPx) * (X[0] / (radius * BaseSize)) - mPx) + ((X[1]) / (radius * BaseSize)) - 2.)Pow2() - radius.Pow2()));  // quadratic form
            //    );
            C.InitialValues_Evaluators.Add("Phi", X => - (X[0]).Pow2() + -(X[1]).Pow2() + radius.Pow2());
            //C.InitialValues.Add("Phi", X => -1);

            C.InitialValues_Evaluators.Add("VelocityX", X => 4 * 1.5 * (X[1] + 2) * (4.1 - (X[1] + 2)) / (4.1 * 4.1));
            //C.InitialValues.Add("VelocityX", delegate (double[] X)
            //{
            //    double x = X[0];
            //    double y = X[1];

            //    double R = Math.Sqrt((x + 1).Pow2() + y.Pow2());

            //    double xVel = 0;

            //    if (R < 0.75)
            //    {
            //        xVel = 1;
            //    }
            //    return xVel;
            //});

            //C.InitialValues.Add("VelocityY", delegate (double[] X) {
            //    double x = X[0];
            //    double y = X[1];

            //    double R = Math.Sqrt((x + 1).Pow2() + (y).Pow2());

            //    double yVel = 0;

            //    if (R < 0.75) {
            //        yVel = 1;
            //    }
            //    return yVel;
            //});

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("8f5cfed9-31c7-4be8-aa56-e92e5348e08b"), 95);
            //C.GridGuid = new Guid("71ffc0c4-66aa-4762-b07e-45385f34b03f");

            // Physical Parameters
            // ===================


            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.LevelSetSmoothing = false;
            //C.option_solver = "direct";
            C.MaxKrylovDim             = 20;
            C.MaxSolverIterations      = 50;
            C.VelocityBlockPrecondMode = MultigridOperator.Mode.SymPart_DiagBlockEquilib_DropIndefinite;
            C.NoOfMultigridLevels      = 0;

            // Timestepping
            // ============
            double dt = new double();

            if (Re == 20)
            {
                dt = 10E20;
                C.NoOfTimesteps = 1;
            }
            else if (Re == 100)
            {
                dt = 0.05;
                C.NoOfTimesteps = 1000000;
            }
            else
            {
                throw new ApplicationException();
            }

            C.Timestepper_Scheme = FSI_Control.TimesteppingScheme.BDF2;
            C.Timestepper_Mode   = FSI_Control.TimesteppingMode.None;

            C.dtMax   = dt;
            C.dtMin   = dt;
            C.Endtime = 70;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 14
0
        public static FSI_Control DeriabinaPentagoneFalle(int k = 2)
        {
            FSI_Control C = new FSI_Control();


            const double BaseSize = 1.0;


            // basic database options
            // ======================

            //C.DbPath = @"\\dc1\userspace\deriabina\bosss_db";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = false;
            C.SessionName            = "fjkfjksdfhjk";
            C.RefinementLevel        = 3;

            C.pureDryCollisions = true;
            C.SetDGdegree(k);

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate {
                int q = new int();
                int r = new int();

                q = 10;
                r = 10;


                double[] Xnodes = GenericBlas.Linspace(-1.5 * BaseSize, 1.5 * BaseSize, q + 1);
                double[] Ynodes = GenericBlas.Linspace(3.5 * BaseSize, 6.0 * BaseSize, r + 1);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Wall_left");
                grd.EdgeTagNames.Add(2, "Wall_right");
                grd.EdgeTagNames.Add(3, "Pressure_Outlet");
                grd.EdgeTagNames.Add(4, "Wall_upper");


                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-1.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (3.5 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-6.0 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }


                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };

            C.GridPartType = GridPartType.Hilbert;

            C.AddBoundaryValue("Wall_left");
            C.AddBoundaryValue("Wall_right");
            C.AddBoundaryValue("Pressure_Outlet");
            C.AddBoundaryValue("Wall_upper");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;

            // Fluid Properties
            C.PhysicalParameters.rho_A = 1.0;
            C.PhysicalParameters.mu_A  = 0.1;
            C.CoefficientOfRestitution = 1.0;
            C.gravity = new double[] { 0, -9.81 };
            double particleDensity = 2.01;

            ParticleMotionInit motion = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions);
            ParticleMotionInit fix    = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions, true, true);

            C.Particles.Add(new Particle_Sphere(motion, 0.35, new double[] { -1.0, 5.5 })
            {
            });

            C.Particles.Add(new Particle_superEllipsoid(fix, 1, 0.3, 4, new double[] { 0.60, 4.0 }, startAngl: 45)
            {
            });

            C.Particles.Add(new Particle_superEllipsoid(fix, 1, 0.3, 4, new double[] { -0.60, 4.0 }, startAngl: -45)
            {
            });

            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6-b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // ===================

            C.PhysicalParameters.IncludeConvection = false;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;


            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 30.0;
            C.NoOfTimesteps = 1000000;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 15
0
        /// <summary>
        /// Testing of particle/wall interactions using a single particle
        /// </summary>
        public static FSI_Control HundredDryActiveParticles(string _DbPath = null)
        {
            FSI_Control C = new FSI_Control();

            // basic database options
            // ======================

            C.DbPath             = _DbPath;
            C.savetodb           = _DbPath != null;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.pureDryCollisions = true;

            // DG degrees
            // ==========

            C.SetDGdegree(2);

            // grid and boundary conditions
            // ============================

            double[] Xnodes = GenericBlas.Linspace(-6, 6, 120);
            double[] Ynodes = GenericBlas.Linspace(-6, 6, 120);
            double   h      = Math.Min((Xnodes[1] - Xnodes[0]), (Ynodes[1] - Ynodes[0]));

            C.GridFunc = delegate {
                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);
                grd.EdgeTagNames.Add(1, "Wall");
                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 1;
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Wall");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;


            // Fluid Properties
            C.PhysicalParameters.rho_A = 1;
            C.PhysicalParameters.mu_A  = 0.1;

            // Particles
            // =========
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    double StartAngle = 10 * i - 10 * i * j + 8;
                    C.Particles.Add(new Particle_Ellipsoid(new double[] { -4 + 2 * i + Math.Pow(-1, j) * 0.5, -4 + 2 * j }, StartAngle)
                    {
                        particleDensity = 100.0,
                        length_P        = 0.5,
                        thickness_P     = 0.4,
                        GravityVertical = -0.001,
                        //ActiveVelocity = 1,
                    });
                }
            }

            C.collisionModel = FSI_Control.CollisionModel.MomentumConservation;


            // Physical Parameters
            // ===================

            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.AdaptiveMeshRefinement = false;
            C.RefinementLevel        = 1;

            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;

            double dt = 1e-1;

            C.dtMax = dt;
            C.dtMin = dt;

            C.Endtime       = 100000000.0;
            C.NoOfTimesteps = 225000000;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 16
0
        public static FSI_Control ParticleInShearFlow(string _DbPath = null, int k = 2, double VelXBase = 0.0)
        {
            FSI_Control C = new FSI_Control();

            const double BaseSize = 1.0;

            // basic database options
            // ======================

            C.savetodb           = false;
            C.ProjectName        = "ShearFlow_Test";
            C.ProjectDescription = "ShearFlow";
            C.Tags.Add("with immersed boundary method");

            // DG degrees
            // ==========

            C.SetDGdegree(k);

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate {
                double[] Xnodes = GenericBlas.Linspace(-2 * BaseSize, 2 * BaseSize, 21);
                double[] Ynodes = GenericBlas.Linspace(-3 * BaseSize, 3 * BaseSize, 31);
                var      grd    = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: true);

                grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                grd.EdgeTagNames.Add(2, "Velocity_Inlet_right");


                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityY", X => 0.02);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityY", X => - 0.02);

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============
            // Coupling Properties
            //C.LevelSetMovement = "coupled";
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;

            // Particle Properties
            C.Particles.Add(new Particle_Sphere(new double[] { 0.0, 0.0 })
            {
                radius_P           = 0.4,
                particleDensity    = 1.0,
                IncludeTranslation = false,
                IncludeRotation    = true
            });



            ////Define level-set
            //Func<double[], double, double> phiComplete = delegate (double[] X, double t) {
            //    int exp = C.Particles.Count - 1;
            //    double ret = Math.Pow(-1, exp);
            //    for (int i = 0; i < C.Particles.Count; i++) {
            //        ret *= C.Particles[i].Phi_P(X, t);
            //    }
            //    return ret;
            //};

            //Func<double[], double, double> phi = (X, t) => -(X[0] - t+X[1]);
            //C.MovementFunc = phi;

            //C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            //C.InitialValues.Add("VelocityX#B", X => 1);
            //C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            //C.InitialValues_Evaluators.Add("VelocityY", X => 0);
            //C.InitialValues.Add("Phi", X => -1);
            //C.InitialValues.Add("Phi", X => (X[0] - 0.41));

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("fec14187-4e12-43b6-af1e-e9d535c78668"), -1);


            // Physical Parameters
            // ===================

            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.25;
            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================
            C.AdvancedDiscretizationOptions.PenaltySafety = 1;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.1;
            C.LevelSetSmoothing                   = false;
            C.LinearSolver.SolverCode             = LinearSolverConfig.Code.classic_pardiso;
            C.LinearSolver.MaxSolverIterations    = 100;
            C.LinearSolver.MinSolverIterations    = 1;
            C.NonLinearSolver.MaxSolverIterations = 100;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;

            // Timestepping
            // ============

            C.Timestepper_Scheme = FSI_Control.TimesteppingScheme.BDF2;
            double dt = 0.1;

            C.dtFixed       = dt;
            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 120;
            C.NoOfTimesteps = 100;



            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 17
0
        public static FSI_Control Test_ParticleInShearFlow(int k = 2)
        {
            FSI_Control C = new FSI_Control();

            const double BaseSize = 1.0;

            // basic database options
            // ======================

            C.savetodb           = false;
            C.ProjectName        = "ShearFlow_Test";
            C.ProjectDescription = "ShearFlow";
            C.Tags.Add("with immersed boundary method");

            // DG degrees
            // ==========

            C.SetDGdegree(k);

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate {
                double[] Xnodes = GenericBlas.Linspace(-2 * BaseSize, 2 * BaseSize, 21);
                double[] Ynodes = GenericBlas.Linspace(-3 * BaseSize, 3 * BaseSize, 31);
                var      grd    = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: true);

                grd.EdgeTagNames.Add(1, "Velocity_Inlet_left");
                grd.EdgeTagNames.Add(2, "Velocity_Inlet_right");


                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Velocity_Inlet_left", "VelocityY", X => 0.02);
            C.AddBoundaryValue("Velocity_Inlet_right", "VelocityY", X => - 0.02);

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;
            C.gravity = new double[] { 0, 0 };
            double             particleDensity = 1;
            ParticleMotionInit motion          = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions, false, true);

            C.Particles.Add(new Particle_Sphere(motion, 0.4, new double[] { 0.0, 0.0 }));

            // For restart
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("fec14187-4e12-43b6-af1e-e9d535c78668"), -1);


            // Physical Parameters
            // ===================

            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.25;
            C.PhysicalParameters.IncludeConvection = true;


            // misc. solver options
            // ====================
            C.AdvancedDiscretizationOptions.PenaltySafety = 1;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.1;
            C.LevelSetSmoothing                   = false;
            C.LinearSolver.SolverCode             = LinearSolverCode.classic_pardiso;
            C.LinearSolver.MaxSolverIterations    = 100;
            C.LinearSolver.MinSolverIterations    = 1;
            C.NonLinearSolver.MaxSolverIterations = 100;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;

            // Timestepping
            // ============

            C.Timestepper_Scheme = FSI_Control.TimesteppingScheme.BDF2;
            double dt = 0.1;

            C.dtFixed       = dt;
            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 120;
            C.NoOfTimesteps = 100;



            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 18
0
        /// <summary>
        /// Testing particle bouncing
        /// </summary>
        public static FSI_Control DryParticleBounce(string _DbPath = null)
        {
            FSI_Control C = new FSI_Control();

            // basic database options
            // ======================

            C.DbPath             = _DbPath;
            C.savetodb           = _DbPath != null;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");


            // DG degrees
            // ==========

            C.SetDGdegree(1);

            // grid and boundary conditions
            // ============================

            double[] Xnodes = GenericBlas.Linspace(-1, 1, 20);
            double[] Ynodes = GenericBlas.Linspace(-1, 2, 30);
            double   h      = Math.Min((Xnodes[1] - Xnodes[0]), (Ynodes[1] - Ynodes[0]));

            C.GridFunc = delegate {
                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);
                grd.EdgeTagNames.Add(1, "Wall");
                grd.DefineEdgeTags(delegate(double[] X) {
                    byte et = 1;
                    return(et);
                });

                return(grd);
            };

            C.AddBoundaryValue("Wall");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.Coupled_Once;


            // Fluid Properties
            C.PhysicalParameters.rho_A = 1;
            C.PhysicalParameters.mu_A  = 0.1;


            // Particles
            // =========

            C.Particles.Add(new Particle_Sphere(new double[] { 0.0, 0.8 }, startAngl: 0.0)
            {
                particleDensity = 1.0,
                radius_P        = 0.15,
                GravityVertical = -9.81
            });

            C.collisionModel = FSI_Control.CollisionModel.MomentumConservation;


            // Physical Parameters
            // ===================

            C.pureDryCollisions = true;
            C.PhysicalParameters.IncludeConvection = true;
            C.CoefficientOfRestitution             = 1;


            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.AdaptiveMeshRefinement = false;

            // Timestepping
            // ============

            //C.Timestepper_Mode = FSI_Control.TimesteppingMode.Splitting;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;

            double dt = 1e-2;

            C.dtMax = dt;
            C.dtMin = dt;

            C.Endtime       = 2;
            C.NoOfTimesteps = 116;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 19
0
        public static FSI_Control Test_ParticleParameter(int k = 2)
        {
            FSI_Control C = new FSI_Control();


            const double BaseSize = 1.0;


            // basic database options
            // ======================

            //C.DbPath = @"\\dc1\userspace\deriabina\bosss_db";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "ParticleCollisionTest";
            C.ProjectDescription = "Gravity";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");
            C.AdaptiveMeshRefinement = false;
            C.RefinementLevel        = 1;
            C.SessionName            = "fjkfjksdfhjk";

            C.pureDryCollisions = true;
            C.SetDGdegree(k);

            // grid and boundary conditions
            // ============================

            C.GridFunc = delegate
            {
                int q, r;

                q = 30;
                r = 20;

                double[] Xnodes = GenericBlas.Linspace(-1 * BaseSize, 7 * BaseSize, q + 1);
                double[] Ynodes = GenericBlas.Linspace(-2 * BaseSize, 2 * BaseSize, r + 1);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Pressure_Outlet_left");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_right");
                grd.EdgeTagNames.Add(3, "Pressure_Outlet_lower");
                grd.EdgeTagNames.Add(4, "Pressure_Outlet_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-1 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-7 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }

                    if (Math.Abs(X[1] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }


                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };

            C.GridPartType = GridPartType.Hilbert;

            C.AddBoundaryValue("Pressure_Outlet_left");
            C.AddBoundaryValue("Pressure_Outlet_right");
            C.AddBoundaryValue("Pressure_Outlet_lower");
            C.AddBoundaryValue("Pressure_Outlet_upper");

            // Boundary values for level-set
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0.1 * 2 * Math.PI * -Math.Sin(Math.PI * 2 * 1 * t), (t) =>  0};
            //C.BoundaryFunc = new Func<double, double>[] { (t) => 0, (t) => 0 };

            // Initial Values
            // ==============

            // Coupling Properties
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;

            // Fluid Properties
            C.PhysicalParameters.rho_A = 1.0;
            C.PhysicalParameters.mu_A  = 0.1;
            C.CoefficientOfRestitution = 0;
            double             particleDensity1 = 2;
            ParticleMotionInit motion1          = new ParticleMotionInit(C.gravity, particleDensity1, C.pureDryCollisions);
            double             particleDensity2 = 1;
            ParticleMotionInit motion2          = new ParticleMotionInit(C.gravity, particleDensity2, C.pureDryCollisions);

            C.Particles.Add(new Particle_Sphere(motion1, 1, new double[] { 0.0, 0.0 }));
            C.Particles.Add(new Particle_Ellipsoid(motion2, 1, 1, new double[] { 0.0, 4.0 }, startAngl: 0));

            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);
            C.PhysicalParameters.IncludeConvection = false;

            // misc. solver options
            // ====================

            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = true;
            C.LinearSolver.MaxSolverIterations    = 10;
            C.NonLinearSolver.MaxSolverIterations = 10;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.hydrodynamicsConvergenceCriterion   = 1e-2;


            // Timestepping
            // ============

            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1e-2;
            C.NoOfTimesteps = 1;

            // haben fertig...
            // ===============

            return(C);
        }
Esempio n. 20
0
        public static FSI_Control Test_ActiveForce(int k = 2)
        {
            FSI_Control C = new FSI_Control();

            // basic database options
            // =============================
            //C.DbPath = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\straightChannel";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "Test_singleActiveParticle";
            C.ProjectDescription = "Test_singleActiveParticle";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("activeParticle");

            // DG degrees
            // =============================
            C.SetDGdegree(k);

            // Grid
            // =============================
            //Generating grid
            C.GridFunc = delegate
            {
                int q = new int(); // #Cells in x-dircetion + 1
                int r = new int(); // #Cells in y-dircetion + 1

                q = 40;
                r = 30;

                double[] Xnodes = GenericBlas.Linspace(-4, 4, q);
                double[] Ynodes = GenericBlas.Linspace(-3, 3, r);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Pressure_Outlet_left");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_right");
                grd.EdgeTagNames.Add(3, "Wall_lower");
                grd.EdgeTagNames.Add(4, "Wall_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-4)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-4)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-3)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-3)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };


            // Mesh refinement
            // =============================
            C.AdaptiveMeshRefinement = false;
            C.RefinementLevel        = 1;


            // Boundary conditions
            // =============================
            C.AddBoundaryValue("Pressure_Outlet_left");  //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Pressure_Outlet_right"); //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Wall_upper");


            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 1;   //pg/(mum^3)
            C.PhysicalParameters.mu_A     = 1e4; //pg(mum*s)
            C.PhysicalParameters.Material = true;


            // Particle Properties
            // =============================
            C.Particles = new List <Particle>();
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle_Ellipsoid(new double[] { 0.0, 0.0 }, startAngl: 0)
                {
                    particleDensity          = 1,
                    ActiveParticle           = true,
                    ActiveStress             = 1e5,
                    thickness_P              = 0.4,
                    length_P                 = 1,
                    AddaptiveUnderrelaxation = true,
                    underrelaxation_factor   = 1,// underrelaxation with [factor * 10^exponent]
                    ClearSmallValues         = true,
                    neglectAddedDamping      = false,
                    IncludeRotation          = false,
                    IncludeTranslation       = true
                });
            }
            //Define level-set
            double phiComplete(double[] X, double t)
            {
                //Generating the correct sign
                int    exp = C.Particles.Count - 1;
                double ret = Math.Pow(-1, exp);

                //Level-set function depending on # of particles
                for (int i = 0; i < C.Particles.Count; i++)
                {
                    ret *= C.Particles[i].Phi_P(X);
                }
                return(ret);
            }

            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;

            //Initial Values
            // =============================
            C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);

            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = false;

            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.LevelSetSmoothing = false;
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.ForceAndTorque_ConvergenceCriterion = 1e-2;
            C.LSunderrelax = 1.0;

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.max_iterations_fully_coupled = 1000;



            // Timestepping
            // =============================
            C.instationarySolver = true;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = 1e-3;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1e-3;
            C.NoOfTimesteps = 1;

            // haben fertig...
            // ===============

            return(C);
        }
        public static FSI_Control ActiveRod_noBackroundFlow(string _DbPath = null, int k = 2, double VelXBase = 0.0, double stressM = 1e3, double cellAgg = 0.2, double muA = 1e4, double timestepX = 1e-3)
        {
            FSI_Control C = new FSI_Control();
            // General scaling parameter
            // =============================
            const double BaseSize = 1.0;


            // basic database options
            // =============================
            C.DbPath             = @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\tiltedChannel";
            C.savetodb           = false;
            C.saveperiod         = 1;
            C.ProjectName        = "activeRod_noBackroundFlow";
            C.ProjectDescription = "Active";
            C.SessionName        = C.ProjectName;
            C.Tags.Add("with immersed boundary method");


            // DG degrees
            // =============================
            C.SetDGdegree(k);


            // Grid
            // =============================
            //Generating grid
            C.GridFunc = delegate
            {
                int q = new int(); // #Cells in x-dircetion + 1
                int r = new int(); // #Cells in y-dircetion + 1

                q = 75 / 3;
                r = 60 / 3;

                double[] Xnodes = GenericBlas.Linspace(-2 * BaseSize, 13 * BaseSize, q);
                double[] Ynodes = GenericBlas.Linspace(-6 * BaseSize, 6 * BaseSize, r);

                var grd = Grid2D.Cartesian2DGrid(Xnodes, Ynodes, periodicX: false, periodicY: false);

                grd.EdgeTagNames.Add(1, "Pressure_Outlet_left");
                grd.EdgeTagNames.Add(2, "Pressure_Outlet_right");
                grd.EdgeTagNames.Add(3, "Wall_lower");
                grd.EdgeTagNames.Add(4, "Wall_upper");


                grd.DefineEdgeTags(delegate(double[] X)
                {
                    byte et = 0;
                    if (Math.Abs(X[0] - (-2 * BaseSize)) <= 1.0e-8)
                    {
                        et = 1;
                    }
                    if (Math.Abs(X[0] + (-13 * BaseSize)) <= 1.0e-8)
                    {
                        et = 2;
                    }
                    if (Math.Abs(X[1] - (-6 * BaseSize)) <= 1.0e-8)
                    {
                        et = 3;
                    }
                    if (Math.Abs(X[1] + (-6 * BaseSize)) <= 1.0e-8)
                    {
                        et = 4;
                    }

                    Debug.Assert(et != 0);
                    return(et);
                });

                Console.WriteLine("Cells:" + grd.NumberOfCells);

                return(grd);
            };


            // Mesh refinement
            // =============================
            C.AdaptiveMeshRefinement = true;
            C.RefinementLevel        = 2;
            C.maxCurvature           = 2;


            // Boundary conditions
            // =============================
            C.AddBoundaryValue("Pressure_Outlet_left");  //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Pressure_Outlet_right"); //, "VelocityX", X => 0.0);
            C.AddBoundaryValue("Wall_lower");
            C.AddBoundaryValue("Wall_upper");


            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 1;   //pg/(mum^3)
            C.PhysicalParameters.mu_A     = muA; //pg(mum*s)
            C.PhysicalParameters.Material = true;


            // Particle Properties
            // =============================
            // Defining particles
            int numOfParticles = 1;

            for (int d = 0; d < numOfParticles; d++)
            {
                C.Particles.Add(new Particle_Ellipsoid(new double[] { 5.0, 0.0 }, startAngl: 10)
                {
                    particleDensity          = 0,
                    ActiveParticle           = true,
                    ActiveStress             = stressM,
                    thickness_P              = 0.6 * BaseSize,
                    length_P                 = 1.5 * BaseSize,
                    AddaptiveUnderrelaxation = true, // set true if you want to define a constant underrelaxation (not recommended)
                    underrelaxation_factor   = 0.5,  // underrelaxation with [factor * 10^exponent]
                    ClearSmallValues         = true,
                    neglectAddedDamping      = false
                });
            }
            //Define level-set
            double phiComplete(double[] X, double t)
            {
                //Generating the correct sign
                int    exp = C.Particles.Count - 1;
                double ret = Math.Pow(-1, exp);

                //Level-set function depending on # of particles
                for (int i = 0; i < C.Particles.Count; i++)
                {
                    ret *= C.Particles[i].Phi_P(X);
                }
                return(ret);
            }

            // Quadrature rules
            // =============================
            C.CutCellQuadratureType = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;


            //Initial Values
            // =============================
            C.InitialValues_Evaluators.Add("Phi", X => phiComplete(X, 0));
            C.InitialValues_Evaluators.Add("VelocityX", X => 0);
            C.InitialValues_Evaluators.Add("VelocityY", X => 0);


            // For restart
            // =============================
            //C.RestartInfo = new Tuple<Guid, TimestepNumber>(new Guid("42c82f3c-bdf1-4531-8472-b65feb713326"), 400);
            //C.GridGuid = new Guid("f1659eb6 -b249-47dc-9384-7ee9452d05df");


            // Physical Parameters
            // =============================
            C.PhysicalParameters.IncludeConvection = false;


            // misc. solver options
            // =============================
            C.AdvancedDiscretizationOptions.PenaltySafety = 4;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = cellAgg;
            C.LevelSetSmoothing = false;
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.ForceAndTorque_ConvergenceCriterion = 10;
            C.LSunderrelax = 1.0;


            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LSunderrelax = 1;
            C.max_iterations_fully_coupled = 10000;


            // Timestepping
            // =============================
            C.instationarySolver = true;
            C.Timestepper_Scheme = FSI_Solver.FSI_Control.TimesteppingScheme.BDF2;
            double dt = timestepX;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1000000;
            C.NoOfTimesteps = 10000;

            // haben fertig...
            // ===============

            return(C);
        }