コード例 #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);
        }
コード例 #2
0
        public static FSI_Control Main(double angle = 100, double distance = 5, int amr = 0)
        {
            FSI_Control C = new FSI_Control(2, "2particleInteractions", "active Particles");
            //C.SetSaveOptions(dataBasePath: @"D:\BoSSS_databases\2particleInteractions", savePeriod: 1);
            //C.SetSaveOptions(@"/work/scratch/ij83requ/default_bosss_db", 1);
            //C.AlternateDbPaths = new[] { new ValueTuple<string, string>(@"/work/scratch/ij83requ/default_bosss_db", ""), new ValueTuple<string, string>(@"U:\default_bosss_db", "") };
            // Domain
            // =============================
            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 20, lengthY: 20, cellsPerUnitLength: 100, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amr);

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LevelSetSmoothing            = false;
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.hydrodynamicsConvergenceCriterion = 1e-6;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;
            C.IsStationary = true;
            double particleDensity = 1;

            // Particle Properties
            // =============================
            C.fixPosition = true;
            InitializeMotion motion         = new InitializeMotion(C.gravity, particleDensity, false, false, false, 1.5, true);
            double           particleRadius = 0.5;
            double           aspectRatio    = 2;

            C.Particles = new List <Particle> {
                new Particle_Ellipsoid(motion, aspectRatio * particleRadius, particleRadius, new double[] { -distance / 2, 0.0 }, angle, 1),
                new Particle_Ellipsoid(motion, aspectRatio * particleRadius, particleRadius, new double[] { distance / 2, 0.0 }, 180 - angle, 1)
            };

            // misc. solver options
            // =============================
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LinearSolver.SolverCode             = LinearSolverCode.classic_pardiso;

            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-1, noOfTimesteps: 20);

            return(C);
        }
コード例 #3
0
        public static FSI_Control TwoParticleCollision(int k = 2, int amrLevel = 2)
        {
            FSI_Control C = new FSI_Control(k, "activeRod_noBackroundFlow", "active Particles");
            //C.SetSaveOptions(dataBasePath: @"/home/ij83requ/default_bosss_db", savePeriod: 1);

            // Domain
            // =============================
            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 3, lengthY: 3, cellsPerUnitLength: 5, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel);

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LevelSetSmoothing            = false;
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.hydrodynamicsConvergenceCriterion = 1e-4;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;
            double particleDensity = 100;

            C.pureDryCollisions = true;

            // Particle Properties
            // =============================
            InitializeMotion motion         = new InitializeMotion(C.gravity, particleDensity, true, false, false);
            double           particleRadius = 0.1;

            C.Particles = new List <Particle> {
                new Particle_Ellipsoid(motion, particleRadius, particleRadius, new double[] { 0, 0.25 }, 0, 0, new double[] { 0, -0.1 }),
                new Particle_Ellipsoid(motion, particleRadius, particleRadius, new double[] { 0, 0 }, 0, 0, new double[] { 0, 0.1 })
            };

            // misc. solver options
            // =============================
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LinearSolver.SolverCode             = LinearSolverCode.classic_pardiso;
            C.LevelSetSmoothing = false;


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-2, noOfTimesteps: 100);

            return(C);
        }
コード例 #4
0
        public static FSI_Control FixedParticle(int k = 2, int amrLevel = 7, double aspectRatio = 0.2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "2_active_Rods");

            //C.SetSaveOptions(@"/home/ij83requ/default_bosss_db", 1);
            C.SetSaveOptions(dataBasePath: @"D:\BoSSS_databases\Channel", savePeriod: 1);

            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 200, lengthY: 200, cellsPerUnitLength: 1, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel: amrLevel);
            C.hydrodynamicsConvergenceCriterion = 1e-4;
            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 10;
            C.PhysicalParameters.IncludeConvection = false;
            C.CoefficientOfRestitution             = 1;

            // Particle Properties
            // =============================
            double           particleDensity = 1;
            InitializeMotion motion          = new InitializeMotion(C.gravity, particleDensity, false, false, false, 1);

            C.Particles.Add(new Particle_Ellipsoid(motion, 1, 1 * aspectRatio, new double[] { 0, 0 }, startAngl: 0, activeStress: 1));

            // misc. solver options
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1000;
            C.NoOfTimesteps = 100;
            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;
            C.LinearSolver.SolverCode = LinearSolverCode.classic_pardiso;

            // Coupling Properties
            // =============================
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;


            return(C);
        }
コード例 #5
0
        /// <summary>
        /// Testing of particle/wall interactions using a single particle
        /// </summary>
        public static FSI_Control TestSingleDryParticleAgainstWall(bool meshRefine = false)
        {
            FSI_Control C = new FSI_Control(degree: 2, projectName: "DryParticleWallCollision");

            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 2, lengthY: 2, cellsPerUnitLength: 10, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(meshRefine ? 1 : 0);
            C.Timestepper_LevelSetHandling         = LevelSetHandling.Coupled_Once;
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.1;
            C.pureDryCollisions                    = true;
            C.PhysicalParameters.IncludeConvection = true;
            // Particle Properties
            // =============================
            double           particleDensity = 1;
            InitializeMotion motion          = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions);

            C.fixPosition = true;
            C.Particles.Add(new Particle_Sphere(motion, 0.1, new double[] { -0.5, -0.5 }, startAngl: 90.0, activeStress: 0, startTransVelocity: new double[] { 1, -1 }));

            double V = 0;

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

            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = (1 / (14 * V)) * (meshRefine ? 0.5 * 0.5 * 0.5 * 0.2 : 0.1);

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 5;
            C.NoOfTimesteps = 500;
            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;
            C.LinearSolver.SolverCode   = LinearSolverCode.classic_pardiso;
            C.CutCellQuadratureType     = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.LSunderrelax              = 1;
            C.maxIterationsFullyCoupled = 100;

            return(C);
        }
コード例 #6
0
        public static FSI_Control TwoSpheres(int k = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "TwoSpheres");

            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 4, lengthY: 4, cellsPerUnitLength: 20, periodicX: false, periodicY: false);

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;
            C.pureDryCollisions = true;
            C.gravity           = new Vector(0, -9.81);

            // Particle Properties
            // =============================
            double           particleDensity = 1;
            InitializeMotion motion1         = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, false, false);
            InitializeMotion motion2         = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, true, true);

            C.Particles.Add(new Particle_Ellipsoid(motion1, 0.25, 0.1, new double[] { 0, 0.5 }, startAngl: 45, activeStress: 0));
            C.Particles.Add(new Particle_Ellipsoid(motion2, 0.25, 0.1, new double[] { 0, 0 }, startAngl: 0, activeStress: 0));

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

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1000000;
            C.NoOfTimesteps = 100;
            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.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;

            return(C);
        }
コード例 #7
0
ファイル: DryParticles.cs プロジェクト: rohitvuppala/BoSSS
        public static FSI_Control PeriodicTest(int k = 2, double aspectRatio = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "2_active_Rods");

            C.SetGrid(lengthX: 2, lengthY: 2, cellsPerUnitLength: 16, periodicX: true, periodicY: true);
            //C.SetAddaptiveMeshRefinement(amrLevel: amrLevel);

            // Fluid Properties
            // =============================
            C.CoefficientOfRestitution = 1;
            C.pureDryCollisions        = true;

            // Particle Properties
            // =============================
            double           particleDensity = 1;
            InitializeMotion motion          = new InitializeMotion(C.gravity, particleDensity, true, false, false, 1);

            C.Particles.Add(new Particle_Ellipsoid(motion, 0.2, 0.2 * aspectRatio, new double[] { 0, 0 }, startAngl: -45, activeStress: 0, startTransVelocity: new double[] { 1, -1 }));

            // misc. solver options
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = 1e-2;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 100000000;
            C.NoOfTimesteps = 300;
            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;
            C.LinearSolver.SolverCode = LinearSolverCode.classic_pardiso;

            // Coupling Properties
            // =============================
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;


            return(C);
        }
コード例 #8
0
        public static FSI_Control WetParticleWallCollision(double DensityFactor = 400)
        {
            FSI_Control C = new FSI_Control(degree: 3, projectName: "wetParticleWallCollision");

            C.SetSaveOptions(@"D:\BoSSS_databases\wetParticleCollision", 1);
            //C.SetSaveOptions(@"\\hpccluster\hpccluster-scratch\deussen\cluster_db\WetParticleCollision", 1);
            //C.SetSaveOptions(@"/work/scratch/ij83requ/default_bosss_db", 1);

            List <string> boundaryValues = new List <string> {
                "Wall_left",
                "Wall_right",
                "Wall_lower",
                "Pressure_Outlet_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetAddaptiveMeshRefinement(4);
            C.SetGrid(lengthX: 5, lengthY: 1, cellsPerUnitLength: 6, periodicX: false, periodicY: false);
            C.hydrodynamicsConvergenceCriterion = 1e-3;
            C.pureDryCollisions = false;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 1;
            C.PhysicalParameters.mu_A     = 1;
            C.PhysicalParameters.Material = true;
            C.gravity = new Vector(0, -10);
            double particleDensity = 1 * DensityFactor;

            // Particle Properties
            // =============================
            // Defining particles
            C.Particles = new List <Particle>();
            InitializeMotion motion = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, false, false, 0);

            C.Particles.Add(new Particle_Sphere(motion, 0.125, new double[] { 0.0, -0.0002 }, 0, 0, new double[] { 0, 0 }));

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

            // 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.LSunderrelax            = 1.0;
            C.LinearSolver.SolverCode = LinearSolverCode.classic_pardiso;


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


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(1e-3, 500, false);

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

            return(C);
        }
コード例 #9
0
ファイル: ParticleStokesFlow.cs プロジェクト: rieckmann/BoSSS
        public static FSI_Control WetParticleWallCollision(int k = 3, double DensityFactor = 2500, int amrLevel = 4)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "wetParticleWallCollision");

            C.SetSaveOptions(@"D:\BoSSS_databases\wetParticleCollision", 1);

            List <string> boundaryValues = new List <string> {
                "Pressure_Outlet_left",
                "Pressure_Outlet_right",
                "Wall_lower",
                "Pressure_Outlet_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 2, lengthY: 2, cellsPerUnitLength: 1, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel);
            C.hydrodynamicsConvergenceCriterion = 1e-6;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 1;
            C.PhysicalParameters.mu_A     = 1;
            C.PhysicalParameters.Material = true;
            C.gravity = new double[] { 0, -5 };
            double particleDensity = 1 * DensityFactor;

            // Particle Properties
            // =============================
            // Defining particles
            C.Particles            = new List <Particle>();
            C.underrelaxationParam = new ParticleUnderrelaxationParam(convergenceLimit: C.hydrodynamicsConvergenceCriterion, relaxationFactor: 1.0, useAddaptiveUnderrelaxation: true);
            ParticleMotionInit motion = new ParticleMotionInit(C.gravity, particleDensity, false, false, false, C.underrelaxationParam, 1);

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

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

            // 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.LSunderrelax = 1.0;


            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 2000;


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-3, noOfTimesteps: 2500);

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

            return(C);
        }
コード例 #10
0
        public static FSI_Control TestParticleParameter(int k = 2)
        {
            FSI_Control C = new FSI_Control(k, "ParticleParameterTest");

            List <string> boundaryValues = new List <string> {
                "Pressure_Outlet"
            };

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


            // 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;
            InitializeMotion motion1          = new InitializeMotion(C.gravity, particleDensity1, C.pureDryCollisions);
            double           particleDensity2 = 1;
            InitializeMotion motion2          = new InitializeMotion(C.gravity, particleDensity2, C.pureDryCollisions);

            C.Particles.Add(new Particle_Sphere(motion1, 1, new double[] { -2.0, 0.0 }));
            C.Particles.Add(new Particle_Ellipsoid(motion2, 1, 1, new double[] { 2.0, 0.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);
        }
コード例 #11
0
        public static FSI_Control StokesFlow(int k = 2, int amrLevel = 1)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "wetParticleWallCollision");

            C.SetSaveOptions(@"D:\BoSSS_databases\wetParticleCollision", 1);

            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 2, lengthY: 2, cellsPerUnitLength: 12, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel, true);
            C.hydrodynamicsConvergenceCriterion = 1e-2;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A    = 1;
            C.PhysicalParameters.mu_A     = 1e-2;
            C.PhysicalParameters.Material = true;
            C.gravity = new Vector(0, -0.01);
            // Particle Properties
            // =============================
            double particleDensity = 2;

            C.Particles = new List <Particle>();
            InitializeMotion motion = new InitializeMotion(C.gravity, particleDensity, false, false, false, 0);

            C.Particles.Add(new Particle_Sphere(motion, 0.25, new double[] { 0.0, 0.0 }, -90, 0, new double[] { 0, 0 }));

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

            // 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.LSunderrelax = 1.0;


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


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-3, noOfTimesteps: int.MaxValue);

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

            return(C);
        }
コード例 #12
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);
        }
コード例 #13
0
        public static FSI_Control PackedParticles(int k = 2, double particleLength = 0.095, double aspectRatio = 0.5)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "2_active_Rods");

            //C.SetSaveOptions(@"/work/scratch/ij83requ/default_bosss_db", 1);
            C.SetSaveOptions(dataBasePath: @"D:\BoSSS_databases\Channel", savePeriod: 1);
            string ID = "ad6c038b-8fb8-4d4d-8bb0-e214856d3061";

            C.RestartInfo = new Tuple <Guid, BoSSS.Foundation.IO.TimestepNumber>(new Guid(ID), -1);
            C.IsRestart   = true;
            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;

            // Particle Properties
            // =============================
            double particleDensity = 10;
            double activeStress    = 10;
            double domainLength    = 2.5;

            C.SetGrid(lengthX: domainLength, lengthY: domainLength, cellsPerUnitLength: 35, periodicX: true, periodicY: true);
            C.SetAddaptiveMeshRefinement(0);
            C.hydrodynamicsConvergenceCriterion = 1e-2;
            C.minDistanceThreshold     = 0.015;
            C.CoefficientOfRestitution = 0.5;

            InitializeMotion motion               = new InitializeMotion(C.gravity, particleDensity, false, false, false, 1.5);
            double           leftCorner           = -1.1;
            double           nextParticleDistance = 0.20;
            Random           angle          = new Random();
            Random           insertParticle = new Random();
            int j = 0;

            while (leftCorner + j * nextParticleDistance < domainLength / 2)
            {
                int i = 0;
                while (leftCorner + i * nextParticleDistance < domainLength / 2)
                {
                    double temp_insertParticle = insertParticle.Next(0, 3);
                    temp_insertParticle = temp_insertParticle.MPIBroadcast(0);
                    if (temp_insertParticle != 0)
                    {
                        double temp_angle = angle.Next(0, 360);
                        temp_angle = temp_angle.MPIBroadcast(0);
                        C.Particles.Add(new Particle_Ellipsoid(motion, particleLength, particleLength * aspectRatio, new double[] { leftCorner + i * nextParticleDistance, leftCorner + j * nextParticleDistance }, temp_angle, activeStress, new double[] { 0.05 * Math.Cos(temp_angle * Math.PI / 180), 0.05 * Math.Sin(temp_angle * Math.PI / 180) }));
                    }
                    i += 1;
                }
                j += 1;
            }


            // misc. solver options
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(1e-3, int.MaxValue, true);
            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;
            C.LinearSolver.SolverCode = LinearSolverCode.classic_pardiso;

            // Coupling Properties
            // =============================
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 100;


            return(C);
        }
コード例 #14
0
        /// <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);
        }
コード例 #15
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);
        }
コード例 #16
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);
        }
コード例 #17
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);
        }
コード例 #18
0
        public static FSI_Control RectangleTest(int k = 3)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "9_active_Rods");
            //C.SetSaveOptions(@"D:\BoSSS_databases\multipleActiveParticles", 1);

            List <string> boundaryValues = new List <string> {
                "Wall_left",
                "Wall_right",
                "Wall_lower",
                "Wall_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 3, lengthY: 3, cellsPerUnitLength: 30, periodicX: false, periodicY: false);
            //C.SetAddaptiveMeshRefinement(amrLevel: 2);
            C.hydrodynamicsConvergenceCriterion = 1e-2;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = true;
            C.pureDryCollisions = true;
            C.gravity           = new double[] { 0, -9.81 };

            // Particle Properties
            // =============================
            double             particleDensity = 20;
            ParticleMotionInit motion1         = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions, false, false);
            ParticleMotionInit motion2         = new ParticleMotionInit(C.gravity, particleDensity, C.pureDryCollisions, true, true);

            C.Particles.Add(new Particle_Shell(motion2, 1, 0.5, 0.2, new double[] { 0, 0 }, startAngl: 0));
            C.Particles.Add(new Particle_Sphere(motion1, 0.1, new double[] { 0, 1 }, startAngl: 0));

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

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 1000000;
            C.NoOfTimesteps = 1000000;
            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.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;

            return(C);
        }
コード例 #19
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);
        }
コード例 #20
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);
        }
コード例 #21
0
        public static FSI_Control Main(int k = 2, int amrLevel = 2, double aspectRatio = 2, double relaxationFactor = 0.3, bool addaptiveUnderrelaxation = true, double conv = 1e-6)
        {
            FSI_Control C = new FSI_Control(k, "activeRod_noBackroundFlow", "active Particles");

            C.SetSaveOptions(dataBasePath: @"D:\BoSSS_databases\Channel", savePeriod: 1);

            // Domain
            // =============================
            List <string> boundaryValues = new List <string> {
                "Pressure_Outlet_left",
                "Pressure_Outlet_right",
                "Pressure_Outlet_lower",
                "Pressure_Outlet_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 10, lengthY: 10, cellsPerUnitLength: 1, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel);

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LevelSetSmoothing            = false;
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.hydrodynamicsConvergenceCriterion = conv;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;
            double particleDensity = 1;

            C.gravity = new double[] { 0, 0 };

            // Particle Properties
            // =============================
            C.underrelaxationParam = new ParticleUnderrelaxationParam(C.hydrodynamicsConvergenceCriterion, ParticleUnderrelaxationParam.UnderrelaxationMethod.ProcentualRelaxation, relaxationFactor, addaptiveUnderrelaxation);
            ParticleMotionInit motion         = new ParticleMotionInit(C.gravity, particleDensity, false, false, false, C.underrelaxationParam, 1.5);
            double             particleRadius = 0.5;

            C.Particles = new List <Particle> {
                new Particle_Ellipsoid(motion, aspectRatio * particleRadius, particleRadius, new double[] { 0.0, 0.0 }, 0, 1)
            };

            // misc. solver options
            // =============================
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-3, noOfTimesteps: 250000);

            return(C);
        }
コード例 #22
0
        public static FSI_Control ActiveRod_noWalls(int k = 3)
        {
            FSI_Control C = new FSI_Control(k, "activeRod_noBackroundFlow", "active Particles");

            C.SetSaveOptions(dataBasePath: @"\\hpccluster\hpccluster-scratch\deussen\cluster_db\Channel", savePeriod: 1);

            // Domain
            // =============================
            List <string> boundaryValues = new List <string> {
                "Pressure_Outlet"
            };

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

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling      = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.maxIterationsFullyCoupled         = 100000;
            C.hydrodynamicsConvergenceCriterion = 1e-1;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = true;
            C.gravity = new double[] { 0, 0 };
            double particleDensity = 1;

            // Particle Properties
            // =============================
            C.underrelaxationParam = new ParticleUnderrelaxationParam(C.hydrodynamicsConvergenceCriterion, ParticleUnderrelaxationParam.UnderrelaxationMethod.ProcentualRelaxation, relaxationFactor: 3.0, useAddaptiveUnderrelaxation: true);
            ParticleMotionInit motion = new ParticleMotionInit(C.gravity, particleDensity, false, false, false, C.underrelaxationParam, 1);

            C.Particles = new List <Particle> {
                new Particle_Ellipsoid(motion, 0.5, 0.05, new double[] { 0.0, 0.0 }, startAngl: 0, activeStress: 1)
            };

            // 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");

            // misc. solver options
            // =============================
            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;

            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-3, noOfTimesteps: 1000000000);

            return(C);
        }
コード例 #23
0
        public static FSI_Control ThreeParticleCollision(int k = 2, int amrLevel = 0)
        {
            FSI_Control C = new FSI_Control(k, "activeRod_noBackroundFlow", "active Particles");

            //C.SetSaveOptions(dataBasePath: @"/home/ij83requ/default_bosss_db", savePeriod: 1);
            C.SetSaveOptions(@"D:\BoSSS_databases\wetParticleCollision", 1);
            // Domain
            // =============================
            C.SetGrid(lengthX: 1, lengthY: 1, cellsPerUnitLength: 40, periodicX: true, periodicY: true);
            C.SetAddaptiveMeshRefinement(amrLevel);

            // Coupling Properties
            // =============================
            C.Timestepper_LevelSetHandling = LevelSetHandling.LieSplitting;
            C.LevelSetSmoothing            = false;
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.AdvancedDiscretizationOptions.CellAgglomerationThreshold = 0.2;
            C.hydrodynamicsConvergenceCriterion = 1e-4;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1e-3;
            C.PhysicalParameters.IncludeConvection = false;
            double particleDensity = 1;

            C.pureDryCollisions = true;

            // Particle Properties
            // =============================
            InitializeMotion motion1        = new InitializeMotion(C.gravity, particleDensity, C.pureDryCollisions, false, false);
            double           particleRadius = 0.1;

            C.Particles = new List <Particle>();
            //for (int i = 0; i < 9; i++) {
            //    for (int j = 0; j < 9; j++) {
            //        C.Particles.Add(new Particle_Sphere(motion1, particleRadius, new double[] { -2 + i * 0.5+0.1*Math.Pow(-1,j), 2 - j * 0.5 }, 0, 0, new double[] { 0.1 * Math.Pow(-1, i), -0.1 * Math.Pow(-1, j) }));
            //    }
            //}
            C.Particles.Add(new Particle_Sphere(motion1, particleRadius, new double[] { 0, 0 }, 0, 0));
            C.Particles.Add(new Particle_Sphere(motion1, particleRadius, new double[] { -0.36, 0 }, 0, 0, new double[] { 1, 0 }));
            //C.Particles.Add(new Particle_Sphere(motion1, particleRadius, new double[] { 0.36, 0 }, 180, 1));

            // misc. solver options
            // =============================
            C.NonLinearSolver.MaxSolverIterations = 1000;
            C.NonLinearSolver.MinSolverIterations = 1;
            C.LinearSolver.NoOfMultigridLevels    = 1;
            C.LinearSolver.MaxSolverIterations    = 1000;
            C.LinearSolver.MinSolverIterations    = 1;
            C.LinearSolver.SolverCode             = LinearSolverCode.classic_pardiso;
            C.LevelSetSmoothing = false;


            // Timestepping
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            C.SetTimesteps(dt: 1e-2, noOfTimesteps: 5000);

            return(C);
        }
コード例 #24
0
        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);
        }
コード例 #25
0
        public static FSI_Control ActiveRods_noBackroundFlow(int k = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "9_active_Rods");

            C.SetSaveOptions(@"\\hpccluster\hpccluster-scratch\deussen\cluster_db\25_particles", 1);

            List <string> boundaryValues = new List <string> {
                "Wall"
            };
            int sqrtPart = 2;

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: sqrtPart + 1, lengthY: sqrtPart + 1, cellsPerUnitLength: 4, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel: 1);
            C.hydrodynamicsConvergenceCriterion = 1e-3;

            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 0.01;
            C.PhysicalParameters.IncludeConvection = false;

            // Particle Properties
            // =============================
            double particleDensity = 2;

            C.underrelaxationParam = new ParticleUnderrelaxationParam(C.hydrodynamicsConvergenceCriterion, ParticleUnderrelaxationParam.UnderrelaxationMethod.ProcentualRelaxation, relaxationFactor: 3.0, useAddaptiveUnderrelaxation: true);
            ParticleMotionInit motion = new ParticleMotionInit(C.gravity, particleDensity, false, false, false, C.underrelaxationParam, 1);

            for (int x = 0; x < sqrtPart; x++)
            {
                for (int y = 0; y < sqrtPart; y++)
                {
                    C.Particles.Add(new Particle_Ellipsoid(motion, 0.25, 0.1, new double[] { -0.5 + 1 * x, 0.5 - 1 * y }, startAngl: 180 - 30 - 90 * (x - y) + 180 * (1 - x * y), activeStress: 50));
                }
            }

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

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 100000000;
            C.NoOfTimesteps = 1000000;
            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.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;

            return(C);
        }
コード例 #26
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);
        }
コード例 #27
0
        public static FSI_Control ActiveRods_noBackroundFlow(int k = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "41_active_Rods");
            //C.SetSaveOptions(@"/work/scratch/ij83requ/default_bosss_db", 1);
            //C.SetSaveOptions(dataBasePath: @"D:\BoSSS_databases\Channel", savePeriod: 1);
            List <string> boundaryValues = new List <string> {
                "Wall"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 8, lengthY: 8, cellsPerUnitLength: 8, periodicX: false, periodicY: false);
            C.SetAddaptiveMeshRefinement(amrLevel: 2);
            C.hydrodynamicsConvergenceCriterion = 1e-2;
            // Fluid Properties
            // =============================
            C.PhysicalParameters.rho_A             = 1;
            C.PhysicalParameters.mu_A              = 1;
            C.PhysicalParameters.IncludeConvection = false;
            C.CoefficientOfRestitution             = 1;

            // Particle Properties
            // =============================
            double           particleDensity = 2;
            InitializeMotion motion          = new InitializeMotion(C.gravity, particleDensity, false, false, false, 1);

            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -1, 0 }, startAngl: 12, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1, 0 }, startAngl: 39, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2, 2 }, startAngl: -1, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 2.5, 2 }, startAngl: 192, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2, -1.5 }, startAngl: 20, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 2.5, -1.5 }, startAngl: 42, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0, 1 }, startAngl: 51, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -3, -3 }, startAngl: 180, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0, -1 }, startAngl: -33, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -0.5, -3 }, startAngl: -48, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1, -3 }, startAngl: -1, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2.5, 0 }, startAngl: 15, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 2.5, 0 }, startAngl: 115, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0, 3 }, startAngl: -15, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2.5, 3 }, startAngl: 5, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 2.5, 3 }, startAngl: 111, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 3, -3 }, startAngl: 187, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2, 1 }, startAngl: 1, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0.5, -2 }, startAngl: 8, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -3.5, -1.5 }, startAngl: 92, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -3.5, 1.5 }, startAngl: -90, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -1.8, -3 }, startAngl: 90, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1.8, 2 }, startAngl: -90, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 3, 1 }, startAngl: -180, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -0.7, 2.2 }, startAngl: -180, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -1, 3.1 }, startAngl: -90, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1.8, 3.1 }, startAngl: -96, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1.8, -1 }, startAngl: 45, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 3.5, 3.1 }, startAngl: -96, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0.6, 2 }, startAngl: 172, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -0.9, -2.0 }, startAngl: -162, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 1.5, 1 }, startAngl: 181, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -1, 1 }, startAngl: -91, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 3.2, -2 }, startAngl: -179, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -3.5, 3 }, startAngl: -72, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 0, 0 }, startAngl: 213, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -1.2, -1 }, startAngl: -43, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -2.4, -0.7 }, startAngl: -3, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { -3.2, 0.7 }, startAngl: 43, activeStress: 10));
            C.Particles.Add(new Particle_Ellipsoid(motion, 0.4, 0.2, new double[] { 2, -3.4 }, startAngl: 91, activeStress: 10));

            // misc. solver options
            // =============================
            C.Timestepper_Scheme = IBM_Solver.IBM_Control.TimesteppingScheme.BDF2;
            double dt = 1e-3;

            C.dtMax         = dt;
            C.dtMin         = dt;
            C.Endtime       = 100000000;
            C.NoOfTimesteps = int.MaxValue;
            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;
            C.LinearSolver.SolverCode = LinearSolverCode.classic_pardiso;

            // Coupling Properties
            // =============================
            C.CutCellQuadratureType        = Foundation.XDG.XQuadFactoryHelper.MomentFittingVariants.Saye;
            C.Timestepper_LevelSetHandling = LevelSetHandling.FSI_LieSplittingFullyCoupled;
            C.LSunderrelax = 1;
            C.maxIterationsFullyCoupled = 1000000;


            return(C);
        }
コード例 #28
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);
        }
コード例 #29
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);
        }
コード例 #30
0
        public static FSI_Control TestStickyTrap(int k = 2)
        {
            FSI_Control C = new FSI_Control(degree: k, projectName: "ParticleCollisionTest")
            {
                pureDryCollisions = true
            };
            // grid and boundary conditions
            // ============================
            List <string> boundaryValues = new List <string> {
                "Wall_left",
                "Wall_right",
                "Pressure_Outlet_lower",
                "Pressure_Outlet_upper"
            };

            C.SetBoundaries(boundaryValues);
            C.SetGrid(lengthX: 3, lengthY: 3, cellsPerUnitLength: 10, periodicX: false, periodicY: false);
            //C.SetAddaptiveMeshRefinement(amrLevel: 2);
            // 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;
            C.gravity = new Vector(0, -9.81);

            // Particle Properties
            //C.PhysicalParameters.mu_B = 0.1;
            //C.particleMass = 1;
            double           particleDensity1 = 4.0;
            InitializeMotion motion1          = new InitializeMotion(C.gravity, particleDensity1, C.pureDryCollisions, true);
            double           particleDensity2 = 1.0;
            InitializeMotion motion2          = new InitializeMotion(C.gravity, particleDensity2, C.pureDryCollisions, true, true);

            C.Particles.Add(new Particle_Sphere(motion1, 0.18, new double[] { 0.0, 0.6 }));
            C.Particles.Add(new Particle_superEllipsoid(motion2, 0.4, 0.2, 4, new double[] { 0.45, 0 }, startAngl: 45));
            C.Particles.Add(new Particle_superEllipsoid(motion2, 0.4, 0.2, 4, new double[] { -0.45, 0 }, startAngl: -45));

            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;
            C.hydrodynamicsConvergenceCriterion   = 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 = 35;

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

            return(C);
        }