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

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs (sixDoFRigidBodyMotion);

motionSolver    sixDoFRigidBodyMotion;

// Not necessarily useful here, but can have different motion updates types
updateControl   timeStep;
updateInterval  1;


patches         (wing);
innerDistance   0.3;
outerDistance   1;

mass            22.9;
//centreOfMass    (0.4974612746 -0.01671895744 0.125);
centreOfMass    (0.25 0.007 0.125);
momentOfInertia (1.958864357 3.920839234 2.057121362);
orientation
(
    0.9953705935 0.09611129781 0
    -0.09611129781 0.9953705935 0
    0 0 1
);
velocity        (0 2.5 0);
acceleration    (0 0 0);
angularMomentum (0 0 0);
g               (0 0 0);
rho             rhoInf;
rhoInf          1e-10;//1.225;
report          on;

/*solver
{
    type symplectic;
}*/

solver
{
    //type symplectic; //2nd order explicit
    type     Newmark; //2nd order implicit with outer correction
    gamma    0.5; //Velocity integration coefficient
    beta     0.25; //Position integration coefficient
    /*type     CrankNicolson; //2nd order implicit with outer correction
    aoc      0.5; //Acceleration off-centering coefficient
    voc      0.25; //Velocity off-centering coeffcieient*/

}

constraints
{
    /*yLine
    {
        sixDoFRigidBodyMotionConstraint line;
        centreOfRotation    (0.25 0.007 0.125);
        direction           (0 1 0);
    }

    zAxis
    {
        sixDoFRigidBodyMotionConstraint axis;
        axis                (0 0 1);
    }*/
    
    fixedLine1
    {
        sixDoFRigidBodyMotionConstraint line;
        direction     (0 1 0);
    }

    fixedAxis1
    {
        sixDoFRigidBodyMotionConstraint orientation;//fixedAxis;
        tolerance       1e-06;
        relaxationFactor 0.7;
        /*fixedAxisCoeffs
        {
            axis            ( 0 0 1 );
        }*/
        fixedOrientationCoeffs {}
    }
}

restraints
{
    
    verticalSpring
    {
        sixDoFRigidBodyMotionRestraint nonLinearSpring;

        anchor          (0.25 0.007 0.125);
        refAttachmentPt (0.25 0.007 0.125);
        restLength      0;
        modelType       Duffing;
        A               4000;
        B               200000.0;
        dampingModelType Mann;
        c1              0.0;
        c2              0.0;
        
    }
}


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