Difference between revisions of "Parameter Definitions - dynamicMotionSolverFvMesh"

From OpenFOAMWiki
(Aceleration Relaxation and Damping)
Line 153: Line 153:
 
     solver
 
     solver
 
     {
 
     {
        type           CrankNicolson;
+
        type CrankNicolson;       //options:  Newmark, CrankNicolson, symplectic
 
     }
 
     }
 +
 +
This specifies the solver for the 6DoF body motions.  There are three solvers you can select.
 +
 +
# Newmark solver  is a second order implicit solver.  You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Newmark-beta_method).  More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a01619.html).
 +
# CrankNicolson is a second order implicit solver.  You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Crank%E2%80%93Nicolson_method).  More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a00432.html).  If you use the default values for solver coefficients, the CrankNicolson scheme is equivalent to the Newmark scheme.
 +
# symplectic is a second order explicit solver.  You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Symplectic_integrator).  More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a02630.html).
 +
 +
=== Newmark Solver ===
 +
 +
Example specification in dynamicMeshDict:
 +
 +
  solver
 +
  {
 +
      type    Newmark;
 +
      gamma  0.5;    // Velocity integration coefficient
 +
      beta    0.25;  // Position integration coefficient
 +
  }
 +
 +
 +
 +
 +
=== Crank Nicolson Solver ===
 +
 +
Example specification in dynamicMeshDict:
 +
 +
  solver
 +
  {
 +
      type    CrankNicolson;
 +
      aoc    0.5;    // Acceleration off-centering coefficient
 +
      voc    0.5;    // Velocity off-centering coefficient
 +
  }
 +
 +
 +
 +
=== Symplectic Solver ===
 +
 +
Example specification in dynamicMeshDict:
 +
 +
  solver
 +
  {
 +
      type    symplectic;
 +
  }
 +
  
  
Line 176: Line 219:
 
     centreOfMass    ( 16.81 -1087.4 -1063.3 );     
 
     centreOfMass    ( 16.81 -1087.4 -1063.3 );     
 
     momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );
 
     momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );
 +
   
 +
This defines the mass properties of the 6DoF Body.  The mass applies to the entire Body.  The centreOfMass defines the centroid of the Body, in the world coordinate system.  This is the centroid at initial position.  The momentOfInertia defines the moment of the inertia of the Body.  This is not the radius of gyration.  It is the direct moment of inertia in the three principal axes (XX, YY, ZZ).  The cross products of inertia are not defined.  CentreOfMass and momentOfInertia are both entered as vector lists.
 
      
 
      
 
== Initial Conditions ==  
 
== Initial Conditions ==  
  
 
     velocity        ( 0 -0.5 -0.25 );
 
     velocity        ( 0 -0.5 -0.25 );
         
+
   
 +
This defines the initial velocity for the Body.  The initial velocity affects Body initial momentum.  Velocity is entered as a vector list.  A zero velocity is also possible.
  
  

Revision as of 12:26, 2 August 2016

This starts to get into the realm of fluid structure interaction (FSI). This solver morphs the mesh around a specified set of boundaries. The meshing motion is calculated based on the pressures on those boundaries. In turn, the dynamicMotionSolverFvMesh provides feedback to the fluid simulation. It alters the velocity boundary conditions (U field) on the included boundaries to specify the local velocity of the defined body. This local velocity includes coupled translation and rotational motions, if permitted. This mesh control is almost exclusively used to solve problems involving rigid body motion. There are many options and controls built into this one dict ions. This section of the dynamicMeshDict is where you define the following items.

  1. Mesh morphing control
  2. Physical parameters of the rigid body
  3. Parameters to control how the 6DoF solver will actually solve the body motions
  4. Forces and motion constraints on the body, in addition to fluid forces.


1 Example Dictionary File

 dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" );
 
 solver          sixDoFRigidBodyMotion;
 
 diffusivity     quadratic inverseDistance 1 ( Body );
 
 sixDoFRigidBodyMotionCoeffs
 {
     patches         ( Body );
     innerDistance   25;
     outerDistance   275;
     centreOfMass    ( 16.81 -1087.4 -1063.3 );
     mass            4.1453e+06;
     g               ( 0 0 -9.8065 );
     momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );
     velocity        ( 0 -0.5 -0.25 );
     rhoName         rhoInf;
     rhoInf          1024.81;
     accelerationRelaxation 0.9;
     accelerationDamping 0.95;
     report          on;
     reportToFile    on;
     solver
     {
         type            CrankNicolson;
     }
     constraints
     {
     }
     restraints
     {
         Bouyancy
         {
             sixDoFRigidBodyMotionRestraint constantForce;
             refAttachmentPt ( 16.8 -1087.4 -1062 );
             constantForce   ( 0 0 4.0994e+07 );
         }
     }
 }

2 Main Controls

There are two main entries to specify outside of the coefficients subdictionary. These are required entries. You specify the motion solver and import the library for the motion solver. This must be included in any code definition for the dynamicMotionSolverFvMesh dictionary.

 motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" );
 
 solver          sixDoFRigidBodyMotion;
 

2.1 Diffusivity Parameter

In addition to the required parameters, you also have the option of specifying a diffusivity parameter. This is optional. OpenFOAM will supply default values if you do not include this.

 diffusivity     quadratic inverseDistance 5.0 ( Body );
 

The diffusivity parameter controls how the mesh motion is distributed through the mesh. The basic scenario assumes that you have a moving boundary and another set of static boundaries. The mesh motion solver must find some way to diffuse the motion of your boundary into the domain. There are several approaches available. If you are unsure of what to do, remove this entry completely. OpenFOAM will supply default values. The list of possible diffusivity options include:

  1. inverseDistance
  2. inverseFaceDistance
  3. inversePointDistance
  4. inverseVolume
  5. uniform

2.1.1 inverseDistance

 diffusivity     quadratic inverseDistance 5.0 ( Body );

Specify the inverseDistance to reduce mesh morphing inverse to distance from a series of patches. The farther away from the specified patches, the less mesh morphing. This applies in all directions from the Body. This command can be divided into several parts.

2.1.1.1 Diffusivity Model

 inverseDistance

The keyword inverseDistance specifies the diffusivity model.

2.1.1.2 Distance Type

You can specify how quickly the mesh morphing reduces with distance.

 diffusivity     quadratic inverseDistance 

The quadratic parameter drops off with quadratic of the inverse distance. This is more aggressive than the linear parameter. You do not need to specify this parameter. Do not include this modifier, and OpenFOAM will supply a default value.

 diffusivity     linear inverseDistance  

The linear parameter drops off with linear variation of the inverse distance. You do not need to specify this parameter. Do not include this modifier, and OpenFOAM will supply a default value.

2.1.1.3 Distance Specification

 5.0

This specifies the physical distance from your specified patch. The distance parameter applies to all directions when used in the inverseDistance diffusivity model.

2.1.1.4 Patch Specification

 ( Body Patch1 Patch2);

Finally, you specify the patches that the diffusivity should apply to. This is a list of named mesh patches. The list is specified by mesh patch name, not boundary name.


3 sixDoFRigidBodyMotionCoeffs

Everything else can be found int he sixDoFRigidBodyMotionCoeffs. These parameters can be somewhat confusing because they combine to define several items relating to the body motion. The parameters can be applied in any order. To clarify the application of each parameter, they were divided into the following main categories.

  1. Mesh Morphing Control
  2. 6DoF Solver Control
  3. Body Definition
  4. Forces Definitions
  5. Motion Definitions
  6. Output Control

All documentation from this point on assumes that any information is applied within the sixDoFRigidBodyMotionCoeffs subdictionary.

 sixDoFRigidBodyMotionCoeffs
 {
   //Parameters - Mesh Morphing Control
   //Parameters - 6DoF Solver Control
   //Parameters - Body Definition
   //Parameters - Force Definitions
   //Parameters - Motion Definitions
   //Parameters - Output Control
 }


4 Parameters - Morphing Control

4.1 Inner and Outer Distance

    innerDistance   25;
    outerDistance   275;
    

The solver also allows you to specify an innerDistance and outerDistance parameter. These control how the sixDof solver morphs the mesh.

  1. Anything within the innerDistance directly moves the mesh nodes as a rigid body.
  2. Between the innerDistance and outerDistance, the mesh nodes are morphed.
  3. Outside the outerDistance, no morphing occurs.

But be careful. The outerDistance parameter must always be larger than the innerDistance parameter. If you try to specify outerDistance as smaller than innerDistance, the solver will override your inputs with default values.


5 Parameters - 6DoF Solver Control

5.1 Solver Type

    solver
    {
       type CrankNicolson;       //options:  Newmark, CrankNicolson, symplectic
    }

This specifies the solver for the 6DoF body motions. There are three solvers you can select.

  1. Newmark solver is a second order implicit solver. You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Newmark-beta_method). More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a01619.html).
  2. CrankNicolson is a second order implicit solver. You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Crank%E2%80%93Nicolson_method). More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a00432.html). If you use the default values for solver coefficients, the CrankNicolson scheme is equivalent to the Newmark scheme.
  3. symplectic is a second order explicit solver. You can find a general wiki entry on it [here](https://en.wikipedia.org/wiki/Symplectic_integrator). More information is available on the OpenFOAM source [documents](http://cpp.openfoam.org/v4/a02630.html).

5.1.1 Newmark Solver

Example specification in dynamicMeshDict:

 solver
 {
     type    Newmark;
     gamma   0.5;    // Velocity integration coefficient
     beta    0.25;   // Position integration coefficient
 }



5.1.2 Crank Nicolson Solver

Example specification in dynamicMeshDict:

 solver
 {
     type    CrankNicolson;
     aoc     0.5;    // Acceleration off-centering coefficient
     voc     0.5;    // Velocity off-centering coefficient
 }


5.1.3 Symplectic Solver

Example specification in dynamicMeshDict:

 solver
 {
     type    symplectic;
 }



5.2 Acceleration Relaxation and Damping

    accelerationRelaxation 0.9;
    accelerationDamping 0.95;
    

These two parameters help maintain stability of the 6DoF solver. Under certain conditions, the 6DoF solver can become unstable. This mainly occurs in situations of high acceleration. The high acceleration feeds into the fluid domain as high velocities on the boundary conditions. This in turn creates high fluid forces from the reaction, resulting in rapid deceleration. This type of scenario will lead to the 6DoF solver diverging. Instead, OpenFOAM provides two parameters to avoid this scenario.

AccelerationDamping is the main tool to eliminate divergence from sudden acceleration. The accelerationDamping reduces the calculated acceleration on the body, but it does this in proportion to the magnitude of the acceleration, similar to a damping coefficient. Thus, sudden accelerations recieve large amounts of relaxation. Whereas normal accelerations that are typical for the result of the time history receive relatively little acceleration. The parameter can range from 0.0 to 1.0. Recommended values are in the range of 0.90 - 1.0.

AccelerationRelaxation is a direct reduction on the acceleration. If the 6DoF solver calculates an acceleration of 10 m/s^2 for a given timestep, with an acclerationRelaxation of 0.90, the actual applied acceleration will be 0.90 * 10 = 9 m/s^2. This will then apply to the newly derived boundary conditions and Body velocity. Be careful with this accelerationRelaxation. Too low of a value will mean that the Body does not respond to the fluid forces correctly. Too much of a discrepancy between calculated fluid forces and resulting motion will also lead to divergence The parameter can range from 0.0 to 1.0. Recommended values are in the range of 0.90 - 1.0.

6 Parameters - Body Definition

6.1 Mass Properties

    mass            4.1453e+06;
    centreOfMass    ( 16.81 -1087.4 -1063.3 );     
    momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );
    

This defines the mass properties of the 6DoF Body. The mass applies to the entire Body. The centreOfMass defines the centroid of the Body, in the world coordinate system. This is the centroid at initial position. The momentOfInertia defines the moment of the inertia of the Body. This is not the radius of gyration. It is the direct moment of inertia in the three principal axes (XX, YY, ZZ). The cross products of inertia are not defined. CentreOfMass and momentOfInertia are both entered as vector lists.

6.2 Initial Conditions

    velocity        ( 0 -0.5 -0.25 );
    

This defines the initial velocity for the Body. The initial velocity affects Body initial momentum. Velocity is entered as a vector list. A zero velocity is also possible.


7 Parameters - Force Definitions

7.1 Patches

    patches         ( Body );
    

This specifies the mesh patches that are considered part of the 6DoF rigid body. This has several implications.

  1. Mesh morphing is centered around this patch
  2. The 6DoF Body velocities can be used as boundary conditions for the main fluid solver
  3. Specifying a patch automatically tells OpenFOAM to integrate pressures along this patch and calculate fluids forces.

The patch is specified as a list of patch names. These are patche names from the mesh definition, not the boundary conditions.

7.2 Restraints

    restraints
    {
        //Restraint Forces
        
        //Typical Restriant Force Definition
        NameofForce-AnyNameYouWantNoSpaces
        {
            sixDoFRigidBodyMotionRestraint ForceType;         
            //More Parameters depending on ForceType
        }
    }
    

List of Force Type keywords

  1. constantForce
  2. linearDamper
  3. sphericalAngularDamper
  4. linearSpring
  5. linearAxialAngularSpring



8 Parameters - Motion Definitions

    constraints
    {
       //Motion Constraints
       
        //Typical Motion Constraint Definition
        NameofConstraint-AnyNameYouWantNoSpaces
        {
            sixDoFRigidBodyMotionConstraint MotionType;         
            //More Parameters depending on MotionType
        }        
    }
    

List of MotionType keywords

  1. axis
  2. line
  3. plane
  4. point
  5. orientation



9 Parameters - Output Control

    report          on;
    reportToFile    on;
    

These two parameters control the output from the 6DoF Solver.

The "report" parameter writes the 6DoF body state to the time files. If you look under a time folder (not the 0 time folder), you will see an additional folder named uniform. In this is a file named sixDoFRigidBodyMotionState. This reports the state of the 6DoF body. The file format looks like this:

 /*--------------------------------*- C++ -*----------------------------------*\
 |       o          |                                                          |
 |    o     o       | OpenFOAM (Engys Edition):                                |
 |   o   O   o      | Version: 2.2_engysEdition-beta                           |
 |    o     o       | Web:     http://www.engys.com                            |
 |       o          |                                                          |
 \*---------------------------------------------------------------------------*/
 FoamFile
 {
     version     2.0;
     format      binary;
     class       dictionary;
     location    "1.92/uniform";
     object      sixDoFRigidBodyMotionState;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 centreOfRotation ( 16.7975 -1088.76 -1063.78 );
 
 orientation     ( 1 0 0 0 1 0 0 0 1 );
 
 velocity        ( -0.00260292 -0.713923 -0.245859 );
 
 acceleration    ( -0.00135749 0.00674935 -0.01104 );
 
 angularMomentum ( 0 0 0 );
 
 torque          ( 116594 281950 -91413 );
 
 
 // ************************************************************************* //
 
 

The other parameter also writes output on the 6DoF state. The reportToFile writes the 6DoF body state for all timesteps into a single file. That output file looks like this:

 Time centreOfRotation_x centreOfRotation_y centreOfRotation_z centreOfMass_x centreOfMass_y centreOfMass_z orientation_xx orientation_xy orientation_xz orientation_yx orientation_yy orientation_yz orientation_zx orientation_zy orientation_zz Ux Uy Uz omega_x omega_y omega_z 
 0.48 16.7998 -1087.73 -1063.42 16.7998 -1087.73 -1063.42 1 0 0 0 1 0 0 0 1 -0.000679523 -0.73788 -0.253318 0 0 0 
 0.96 16.7994 -1088.08 -1063.54 16.7994 -1088.08 -1063.54 1 0 0 0 1 0 0 0 1 -0.00135747 -0.719188 -0.25145 0 0 0
 ...
 1.44 16.7986 -1088.42 -1063.66 16.7986 -1088.42 -1063.66 1 0 0 0 1 0 0 0 1 -0.00198185 -0.716625 -0.248611 0 0 0 
 
 

This file format is very useful to import into spreadsheet programs or tables. Note that the orientation of the body is written as a tensor. You will need to create your own utility to convert this to Euler Angles. Or check the internet. There are several useful utilities for this.

This report file is constantly updated as OpenFOAM runs. An incomplete run will still generate this report file for all the currently completed timesteps. You can also grab the file while OpenFOAM runs to monitor the motions of your 6DoF body for an active run.


10 Physics - Boundary Condition Setup

The boundary conditions must be set with specific keywords to use the information from the 6DoF solver. This provides the feedback. The surface velocities from the 6DoF Body are supplied as boundary conditions to the fluid solver. The example below shows a single boundary named "Body" that represents the 6DoF Body.

 Body
 {
     U
     {
         type movingWallVelocity;
         value uniform (0 0 0);
     }
     
     pointDisplacement
     {
         type calculated;
         value uniform (0 0 0);
     }
     
     p
     {
         type    zeroGradient;
     }                                            
 }
 

The velocity condition is specified as a movingWallVelocity. The uniform value of zero only applies to the initialization. The boundary will be overwritten with calculated velocity values from the 6DoF solver on the next timestep and going forward.

The pointDisplacement is necessary for the mesh morphing. This must be set to type of "calculated". This will tell the mesh morpher to look at the 6DoF solver results to perform the morphing. Specifically, the library writes a field file called pointDisplacement and another field called pointMotionU. These are used to perform the mesh morphing. They can also be viewed as an output.

The pressure field is specified as a zeroGradient. This is typical for normal wall boundaries.

11 User Notes

If you are using the sixDoFRigidBodyMotion, you must import the additional motion solver library.

motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" );

The solver also allows you to specify an innerDistance and outerDistance parameter. These control how the sixDof solver morphs the mesh.

  1. Anything within the innerDistance directly moves the mesh nodes as a rigid body.
  2. Between the innerDistance and outerDistance, the mesh nodes are morphed.
  3. Outside the outerDistance, no morphing occurs.

But be careful. The outerDistance parameter must always be larger than the innerDistance parameter. If you try to specify outerDistance as smaller than innerDistance, the solver will override your inputs with default values.