Native external function examples: Line type bend stiffness

This topic is intended to be read in conjunction with the main external function documentation, and the example source code.

This ZIP file contains all of the native external function examples, with each example contained in the appropriately named sub-folder.

OrcaFlex line types allow the bend stiffness data to be externally calculated. This example is intended to be one of the simplest implementations of external bend stiffness that can be achieved.

The external function use by OrcaFlex for a line type stiffness is more complicated than for other external functions. For more information on that topic, see this page. Here we restrict ourselves to commentary of the example code, and it is assumed that you have already read about externally calculated bend stiffness in general.

Initialise

Instances of an external function for bend stiffness may be associated with both line types and line nodes within an OrcaFlex model. The stiffness is a property of the line type, while the application of that stiffness to generate bend moment is the responsibility of the line nodes.

In our initialise action, we only want to set up the stiffness associated with the line type. The line type in the OrcaFlex model is required to provide a tag for the x-component of bend stiffness, and may optionally also provide a tag to specify a stiffness for the y-component of bending.

Note that the code that reads the object tags uses info.DataObjectHandle instead of info.ObjectHandle. When we are initialising an instance of this function for a line node, info.ObjectHandle represents the line object. However, the object tags that we want to use are defined in the line type data. The info.DataObjectHandle field refers to the line type and so gives us access to the required tags.

Nominal bend stiffness

The OrcaFlex calculation needs to know a nominal value of bend stiffness for various auxiliary requirements. The principal of these is for calculation of the Euler buckling limit which is defined as $\pi^2 EI / l_0^2$, where $EI$ is the bending stiffness of the segment and $l_0$ the unstretched segment length.

To be conservative, the nominal value of bend stiffness is taken to be the minimum of $EI_x$ and $EI_y$. The value is returned to OrcaFlex in the info.Value field, just as for the calculate action.

The action eaCalculateNominalValue is called once for each line type that has externally calculated bend stiffness. In this example it is called only once, as there is only one line using a single line type. Although there are two components, x and y, nominal value calculation is only called for the x component so lpDataName will always be vdnXBendStiffness. OrcaFlex assumes the line is isotropic for the nominal bend stiffness calculations. In fact, vdnYBendStiffness is not defined.

Bend moment calculation

The eaCalculate action is more complicated and will be called four times for each node, once for each of the components of bend moment required (vdnXbendMomentIn, vdnYbendMomentIn, vdnXbendMomentOut or vdnYbendMomentOut). Within the eaCalculate action, we determine which bend stiffness is required by checking info.lpDataName.

For each component of bend moment, we must know the associated component of node curvature. The in/out curvatures at nodes are not OrcaFlex result variables. Other external functions sometimes call TimeHistory to get instantaneous values of results, but only overall curvature is available via this route. Instead you use the info.lpInstantaneousCalculationData. As we know that the eaCalculate action is for a node, we can safely cast lpInstantaneousCalculationData to a TNodeInstantaneousCalculationData. The TNodeInstantaneousCalculationData structure contains the in and out values of curvature at this node.

Finally the bend moment is calculated by multiplying the bend stiffness value by the correct in or out curvature value and is returned to OrcaFlex in the info.Value field.

It should be noted that eaCalculateNominalValue requires a bend stiffness value to be returned, but eaCalculate requires a bend moment.

Line ends

For an end node the eaCalculate action is only called twice (for the two components X and Y), as an end A node has no in bend moment and an end B node has no out bend moment.

OrcaFlex Statics Calculation

Bend stiffness external functions are required to update their values during statics.

Externally calculated bend stiffness allows you to potentially implement hysteretic bend moment / curvature relationships, including features like plasticity, layer slippage etc. For such relationships you would typically disable the hysteretic effects during statics. To achieve this you can call wrapper functions OrcaFlexModel::getState or OrcaFlexObject::getModelState which will return msCalculatingStatics if the model is calculating statics.