View Revisions: Issue #3494

Summary 0003494: Wrong displacement accumulation in motionSolverList
Revision 2020-05-12 17:45 by henry
Additional Information The problem was found to be in the first Member Function of the code motionSovlerList.C (located in src/dynamicFvMesh/motionSolvers/motionSolverList), more precisely at lines 73 to 80, as shown below:

        pointField disp(motionSolvers_[0].curPoints() - mesh().points());

        for (label i = 1; i < motionSolvers_.size(); i++)
        {
            disp += motionSolvers_[i].curPoints() - mesh().points();
        }

        return mesh().points() + disp;

For every motion solver, the code extract the difference between its result and the current mesh, sum all the results and add that value of displacement to the current mesh points, returning then the new mesh position. The problem is that every motion solver moves the mesh independently of other solver and its result is the respective displacement in relation to the initial time instant. Thus subtracting its result from the current mesh (which is a combination of the movement of all solvers) produce an incorrect mesh displacement. A possible correction would be adding a pointField type variable (hereby named initialMesh) to which the mesh point coordinates of the initial time instant of the simulation is atributed. The new code would be:

        pointField disp(motionSolvers_[0].curPoints() - initialMesh);

        for (label i = 1; i < motionSolvers_.size(); i++)
        {
            disp += motionSolvers_[i].curPoints() - initialMesh;
        }

        return initialMesh + disp;
Revision 2020-05-12 03:16 by rmoreira
Additional Information The problem was found to be in the first Member Function of the code motionSovlerList.C (located in src/dynamicFvMesh/motionSolvers/motionSolverList), more precisely at lines 73 to 80, as shown below:

        pointField disp(motionSolvers_[0].curPoints() - mesh().points());

        for (label i = 1; i < motionSolvers_.size(); i++)
        {
            disp += motionSolvers_[i].curPoints() - mesh().points();
        }

        return mesh().points() + disp;

For every motion solver, the code extract the difference between its result and the current mesh, sum all the results and add that value of displacement to the current mesh points, returning then the new mesh position. The problem is that every motion solver moves the mesh independently of other solver and its result is the respective displacement in relation to the initial time instant. Thus subtracting its result from the current mesh (which is a combination of the movement of all solvers) produce an incorrect mesh displacement. A possible correction would be adding a pointField type variable (hereby named initialMesh) to which the mesh point coordinates of the initial time instant of the simulation is atributed. The new code would be:

        pointField disp(motionSolvers_[0].curPoints() - initialMesh);

        for (label i = 1; i < motionSolvers_.size(); i++)
        {
            disp += motionSolvers_[i].curPoints() - initialMesh;
        }

        return initialMesh + disp;