Exemple #1
0
 /// <summary>
 /// Constructor for the underrelaxation.
 /// </summary>
 /// <param name="parameter">
 /// <see cref="ParticleUnderrelaxationParam"/>
 /// </param>
 /// <param name="averageForce">
 /// A mean value for the forces used to reduce the impact of computation errors.
 /// </param>
 internal ParticleUnderrelaxation(ParticleUnderrelaxationParam parameter, double averageForce)
 {
     m_ConvergenceLimit           = parameter.m_ConvergenceLimit;
     m_RelaxationFactor           = parameter.m_UnderrelaxationFactor;
     m_UseAdaptiveUnderrelaxation = parameter.m_UseAdaptiveUnderrelaxation;
     m_AverageForce = averageForce;
 }
 /// <summary>
 /// The initialization of the particle motion. Depending on the given parameters the correct model is chosen.
 /// </summary>
 /// <param name="gravity">
 /// The gravity (volume forces) acting on the particle.
 /// </param>
 /// <param name="particleDensity">
 /// The density of the particle.
 /// </param>
 /// <param name="isDry">
 /// Set true if no hydrodynamics should be included.
 /// </param>
 /// <param name="noRotation"></param>
 /// <param name="noTranslation"></param>
 /// <param name="underrelaxationParam">
 /// The underrelaxation parameters (convergence limit, prefactor and a bool whether to use addaptive underrelaxation) defined in <see cref="ParticleUnderrelaxationParam"/>.
 /// </param>
 /// <param name="addedDampingCoefficient">
 /// The added damping coefficient is a scaling factor for the model. If the value is smaller than zero no added damping is applied. Otherwise it should be between 0.5 and 1.5, for reference: Banks et.al. 2017.
 /// </param>
 public ParticleMotionInit(double[] gravity = null, double particleDensity = 0, bool isDry = false, bool noRotation = false, bool noTranslation = false,
                           ParticleUnderrelaxationParam underrelaxationParam = null, double addedDampingCoefficient = 0)
 {
     m_Gravity                 = gravity.IsNullOrEmpty() ? (new double[] { 0, 9.81 }) : gravity;
     m_Density                 = particleDensity == 0 ? 1 : particleDensity;
     m_IsDry                   = isDry;
     m_NoRotation              = noRotation;
     m_NoTranslation           = noTranslation;
     m_UnderrelaxationParam    = underrelaxationParam;
     m_AddedDampingCoefficient = addedDampingCoefficient;
 }
Exemple #3
0
 /// <summary>
 /// The dry description of motion including hydrodynamics without rotation.
 /// </summary>
 /// <param name="gravity">
 /// The gravity (volume forces) acting on the particle.
 /// </param>
 /// <param name="density">
 /// The density of the particle.
 /// </param>
 /// /// <param name="underrelaxationParam">
 /// The underrelaxation parameters (convergence limit, prefactor and a bool whether to use addaptive underrelaxation) defined in <see cref="ParticleUnderrelaxationParam"/>.
 /// </param>
 public Motion_Wet_NoRotation(double[] gravity, double density, ParticleUnderrelaxationParam underrelaxationParam = null) : base(gravity, density, underrelaxationParam)
 {
     IncludeRotation = false;
 }
Exemple #4
0
 /// <summary>
 /// The added damping description of motion including hydrodynamics, for reference: Banks et.al. 2017.
 /// </summary>
 /// <param name="gravity">
 /// The gravity (volume forces) acting on the particle.
 /// </param>
 /// <param name="density">
 /// The density of the particle.
 /// </param>
 /// <param name="underrelaxationParam">
 /// The underrelaxation parameters (convergence limit, prefactor and a bool whether to use addaptive underrelaxation) defined in <see cref="ParticleUnderrelaxationParam"/>.
 /// </param>
 /// <param name="addedDampingCoefficient">
 /// The added damping coefficient is a scaling factor for the model. Should be between 0.5 and 1.5, for reference: Banks et.al. 2017.
 /// </param>
 public Motion_AddedDamping(double[] gravity, double density, ParticleUnderrelaxationParam underrelaxationParam, double addedDampingCoefficient = 1) : base(gravity, density, underrelaxationParam)
 {
     m_StartingAngle           = GetAngle(0);
     m_AddedDampingCoefficient = addedDampingCoefficient;
     UseAddedDamping           = true;
 }
        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);
        }