/*--------------------------------*- 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.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.65 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; //2nd order explicit
    type     Newmark; //2nd order implicit with outer correction
    gamma    0.5; //Velocity integration coefficient
    beta     0.25; //Position integration coefficient

}

constraints
{
    
    fixedLine1
    {
        sixDoFRigidBodyMotionConstraint line;
        direction     (0 1 0);
    }

    fixedAxis1
    {
        sixDoFRigidBodyMotionConstraint orientation;//fixedAxis;
        tolerance       1e-06;
        relaxationFactor 0.7;
        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;
        dampingModelType Mann;
        c1              6;
        c2              5000;
        
    }

}


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