public static void Test_HydrodynamicForces() { using (FSI_SolverMain p = new FSI_SolverMain()) { var ctrl = HardcodedTestExamples.Test_HydrodynamicForces(); p.Init(ctrl); p.RunSolverMode(); double ForcesSoll = 5.53747893542498; double Forces = p.GetParticles()[0].Motion.GetHydrodynamicForces(0)[0]; double DiffForces = Math.Abs(ForcesSoll - Forces); Assert.LessOrEqual(DiffForces, 1e-3); } }
public static void Test_HydrodynamicForces() { using (FSI_SolverMain p = new FSI_SolverMain()) { var ctrl = HardcodedTestExamples.Test_HydrodynamicForces(); p.Init(ctrl); p.RunSolverMode(); double ForcesSoll = 12.471222692466; double Forces = p.Particles[0].HydrodynamicForces[0][0]; double DiffForces = Math.Abs(ForcesSoll - Forces); Assert.LessOrEqual(DiffForces, 1e-3); } }
public static void Test_ActiveForce() { using (FSI_SolverMain p = new FSI_SolverMain()) { var ctrl = HardcodedTestExamples.Test_ActiveForce(); p.Init(ctrl); p.RunSolverMode(); double ForcesSoll = 11129.7411681657; double Forces = p.Particles[0].HydrodynamicForces[0][0]; double DiffForces = Math.Abs(ForcesSoll - Forces); Assert.LessOrEqual(DiffForces, 20); } }
public static void TestParticleInShearFlow() { using (FSI_SolverMain p = new FSI_SolverMain()) { var ctrl = HardcodedTestExamples.TestParticleInShearFlow(k: 2); p.Init(ctrl); p.RunSolverMode(); double angularVelocitySol = -0.00732081626486242; double angularVelocityIs = p.Particles[0].Motion.GetRotationalVelocity(0); double diff_Velocity = Math.Abs(angularVelocityIs - angularVelocitySol); Console.WriteLine(" angular velocity is " + angularVelocityIs); Console.WriteLine(" should be " + angularVelocitySol); Console.WriteLine(" difference is " + diff_Velocity); Assert.LessOrEqual(diff_Velocity, 0.00025, "Error in expected angular velocity is to high"); } }
public static void PeriodicTest() { using (FSI_SolverMain p = new FSI_SolverMain()) { var ctrl = HardcodedTestExamples.TestPeriodicBoundaries(); p.Init(ctrl); p.RunSolverMode(); Vector[] expectedPosition = new Vector[4]; expectedPosition[0] = new Vector(0.8, -0.8); expectedPosition[1] = new Vector(-1.2, -0.8); expectedPosition[2] = new Vector(-1.2, 1.2); expectedPosition[3] = new Vector(0.8, 1.2); double distanceL2 = 0; for (int i = 0; i < 4; i++) { distanceL2 += (expectedPosition[i] - p.Particles[i].Motion.GetPosition(0)).L2Norm(); } Assert.Less(distanceL2, 0.1, "Particle to far from expected position."); } }