Coupling DFBI Bodies

DFBI body couplings define body-to-body and body-to-environment coupling elements. There are 6 pre-defined and one user defined coupling types.

To define a DFBI coupling:
  1. Right-click DFBI > Body Couplings node and select New.
  2. Select one of the following coupling types and set the corresponding properties:


    Coupling Type 6-DOF Bodies' Dimension Body Motion Option
    Spring-Damper Coupling 2D or 3D All
    Catenary Coupling 2D or 3D All
    Contact Coupling 2D or 3D All
    Spherical Joint Coupling 3D Multi-Body Motion
    Revolute Joint Coupling 3D Multi-Body Motion
    Bracket Joint Coupling 3D Multi-Body Motion
    User-Defined Coupling 2D or 3D All
You can also set up a user-defined body coupling. This type lets you couple a body to another body or to the environment in a user-defined way. The user-defined coupling consists of two end points. The forces and moments acting at these end points are defined through field functions, tables, or user-code. You can use this functionality, for example, to couple your Simcenter STAR-CCM+ DFBI simulation to a third-party mooring dynamics API.
  1. Right-click the DFBI > 6-DOF Bodies > Body Couplings node and select New > User Defined.
    The following nodes are added to the simulation tree:
    • Body Couplings > User Defined 1
    • 6-DOF Bodies > [Body 1] > External Forces and Moments > User Defined Coupling Force [User Defined 1]
    • Point Sets > DFBI Point Set [User Defined Coupling 1]

    The user-defined coupling automatically creates a point set containing two points. These two points represent the end points of the coupling. You can use the point set to access data that is defined at the end points or to visualize the end points in a scene.

  2. Select the Body Couplings > User Defined 1 node and specify the objects to be coupled:
    1. Set Object 1 and Object 2 to either a previously defined rigid body or to the Environment.
    2. To specify the positions of the attachment points of the coupling, enter coordinates for Position 1 and Position 2.
    For a description of all properties, see User-Defined Coupling.
  3. To define the force acting at the end points of the coupling and optionally an additional moment acting about the body position, select the User Defined 1 > Force Profile node and set Method to one of the common options.
  4. To define the force profile through field functions or user coding, specific field functions for user defined coupling are available. See User-Defined Coupling Field Function. If you set Method to User Code:
    1. Create the source code for the user coding in C, C++, or Fortran.
      An example coding for the user-defined method is shown below. The first file uclib.c defines two functions for the calculation of forces and moments that are called from Simcenter STAR-CCM+:
      #include "uclib.h"
      
      void calculateForce(Real*, int, CoordReal*, unsigned int*, CoordReal*);
      void calculateMoment(Real*, int, CoordReal*, unsigned int*, CoordReal*);
      
      void
      USERFUNCTION_EXPORT uclib()
      {
        /* Register user functions here */
        ucfunc(calculateForce, "PointSetProfile", "Calculate Force");
        ucarg(calculateForce, "Point", "Coord", sizeof(CoordReal[3]));
        ucarg(calculateForce, "Point", "BodyId", sizeof(unsigned int));
        ucarg(calculateForce, "Point", "BodyPosition", sizeof(CoordReal[3]));
      
        ucfunc(calculateMoment, "PointSetProfile", "Calculate Moment");
        ucarg(calculateMoment, "Point", "Coord", sizeof(CoordReal[3]));
        ucarg(calculateMoment, "Point", "BodyId", sizeof(unsigned int));
        ucarg(calculateMoment, "Point", "BodyPosition", sizeof(CoordReal[3]));
      }

      The following user code models a spring acting between the end points of the coupling. One end point is attached to a body and the other end point is attached to the environment or another body.

      #include "uclib.h"
      
      void USERFUNCTION_EXPORT
      calculateForce(Real (*result)[3], int size, CoordReal (*position)[3], 
        unsigned int *bodyId, CoordReal (*bodyPosition)[3])
      {
        CoordReal delta[3];
        Real stiffness = 20.;     /* Spring stiffness */
        int i, j;
      
        if (size != 2)    /* If the number of end points is unequal 2, do not execute the following coding. */
                          /* This if-block is essential for parallel simulations. The DFBI point */
      		    /* set is filled with the two end points on the master node only. */
      
          return;
      
        for (j = 0; j < 3; ++j)   /* Compute force vectors at the end points */
        {
          delta[j] = position[1][j] - position[0][j];
          result[1][j] = -stiffness*delta[j]; /* Force at second end point */
          result[0][j] = -result[1][j];   /* Force at first end point */
        }
      }
      
      void USERFUNCTION_EXPORT
      calculateMoment(Real (*result)[3], int size, CoordReal (*position)[3], 
        unsigned int *bodyId, CoordReal (*bodyPosition)[3])
      {
        int i, j;
      
        for (i = 0; i < size; ++i)
          for (j = 0; j < 3; ++j)
            result[i][j] = 0.;    /* Calculate no additional moment. */
      }
    2. Create a new user library.
    3. Load the user library into Simcenter STAR-CCM+.
    4. Select the Force Profile node and set Function to [your user coding].
      For this example: Select the Force Profile node and set Function to Calculate Force.
    For more information, see also Force Profile Properties.
  5. (Optional) To define an additional moment, repeat the previous step, but edit the Moment Profile node instead.
    For more information, see also Moment Profile Properties.
  6. To visualize user-defined couplings in a scene, add Point Sets > DFBI Point Set [User Defined Coupling 1] to a displayer.
    In the scene, the coupling is represented by its end points only. Simcenter STAR-CCM+ is not aware of the actual coupling in between, which, by definition, is user-defined. You can access several specific field functions that are collected in the presenter group User Defined DFBI Couplings and apply them to scalar or vector displayers in a scene, and also to reports or expressions.