Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 426
    • Issues 426
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1790
Closed
Open
Issue created Jul 27, 2020 by Mike Worth@Mike.Worth

Position interpolation in tabulated6DoFMotion does not give expected result

Summary

When the position of a dynamic mesh is calculated using tabulated6DoFMotion, the result is neither intuitive nor smooth. I don't know enough about the purported method to know if it's a bug or just not a very suitable algorithm.

Steps to reproduce

With at least 4 defined steps, define a motion that moves, pauses and returns. Example below:

Example case

dynamicMeshDict:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh       dynamicOversetFvMesh;

dynamicOversetFvMeshCoeffs
{
//    layerRelax 0.3;
}

solver          multiSolidBodyMotionSolver;

multiSolidBodyMotionSolverCoeffs
{
    movingZone
    {
        solidBodyMotionFunction tabulated6DoFMotion;
       tabulated6DoFMotionCoeffs
       {
           CofG            (0.001 0.001 0.001);
           timeDataFileName    "constant/dipMotion.dat";
        }
    }

}

// ************************************************************************* //

Dipmotion.dat:

 //Position formatting is not important.  File is based on the character sequence only.
 //Vectors are not relative.  Each vector is total displacement and total rotation.
 (
 //(time_point ( (linear displacement vector)              (rotation vector) ) )
 //(seconds    ( (following unit system, usually meters)   (radians) ) )
 (0            ( (0 0 0)                                   (0 0 0) ) )
 (4.19042         ( (0 -0.159236 0)                             (0 0 0) ) )
 (5.19042         ( (0 -0.159236 0)                             (0 0 0) ) )
 (38.141         ( (0 0.05 0)                             (0 0 0) ) )
 )

What is the current bug behaviour?

Instead of pausing between the middle two times (as would be expected from linear interpolation), there is a rapid further movement. See below for a graph where I've re-implemented the interpolateSplineXY.C algorithm to investigate what it returns:

image

What is the expected correct behavior?

Interpolation should either be linear (which would potentially cause problems with derivative values being high/undefined), or should approximate to linear with rounded corners of some kind.

Relevant logs and/or images

Environment information

  • OpenFOAM version : 1912 & 2006
  • Operating system : Ubuntu 18.04
  • Hardware info :
  • Compiler :

Possible fixes

Either use a different interpolation method here, or adjust what values the existing one returns:

https://develop.openfoam.com/Development/openfoam/-/blob/master/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C#L93

Assignee
Assign to
Time tracking