Python 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 Python external function examples, with each example contained in the appropriately named sub-folder.

In this example we present a linear line type bending stiffness, implemented by external function. Inside the sub-folder there is only OrcaFlex data file linearEI.dat, the external function code is embedded in the data file.

This example has a lot of common features with the line type axial stiffness example. You should read the documentation page for that example, while referring to either the axial or the bend stiffness example data file, before continuing to read here.

One difference between this bend stiffness and the axial stiffness example is that the nominal bend stiffness value returned by our function is used in the OrcaFlex calculation of Euler buckling limit for your line segments. This is an important consideration when you are deciding what value to return to the program, so we mention this usage explicitly.

Code details

Our comments in this section that go beyond the documentation for the axial stiffness script are all relevant to the Calculate method in our linearEI class. In Calculate, we assign a moment to info.Value, by multiplying the EI from our script by curvature values provided by OrcaFlex.

OrcaFlex reports results for line curvature and bend moment at line ends and mid-segment points. However, the line bending calculations during simulation require bend moments at line nodes. For an overview of the OrcaFlex line model, and the details of precisely where within OrcaFlex your bend stiffness external function is applied, see the line type stiffnesses section.

In the line model documentation, we note that each mid-node should calculate four components of bend moment. Those four bend moment components correspond to the keys of dictionary curvComponent. We hope that the OrcFxAPI attribute names, such as vdnXBendMomentIn, make it clear which of the node moment components is required at each evaluation. The info.DataName attribute contains this request from OrcaFlex, and in our example script is used to index into the dictionary curvComponent.