Python reference: OrcaFlexTurbineObject

The class OrcaFlexTurbineObject is the Python interface representation of an OrcaFlex turbine. This class subclasses OrcaFlexObject so offers the same attributes and methods, with the addition of turbine specific methods described here.

Construction

A new OrcaFlexTurbineObject is created from a Model object like this:

model = Model()

turbine = model.CreateObject(ObjectType.Turbine, "turbine2") # Create a new turbine object called "turbine2"

Or, where the OrcaFlex turbine already exists, like this:

turbine = model["turbine2"]

Attributes and methods

NearestBladeNodeArclength

NearestBladeNodeArclength(targetArclength)

Returns the arc length of the nearest node to targetArclength.

BladeNodeArclengths

BladeNodeArclengths

Returns an array containing the arc length of each node in a turbine blade.

RangeGraphXaxis

RangeGraphXaxis(varName, arclengthRange=None, period=None)

Returns an array of the RangeGraph X values only. See the RangeGraph method below. The arclengthRange parameter can be omitted or set to None if values for the entire turbine blade are required. The period parameter is not used.

RangeGraph

RangeGraph(varName, period=None, objectExtra=None, arclengthRange=None, stormDurationHours=None)

The varName parameter is the name of the result variable required.

period is a Period object, if omitted or None then the default value depends on the model state, see Python interface: Results.

objectExtra is an ObjectExtra object used to specify the blade index, and optionally the clearance line for line clearance results.

arclengthRange is an ArclengthRange object that is used to specfiy a sub-section of the blade. If the parameter is omitted then the range graph for the entire blade is returned.

stormDurationHours is not used.

For static state, time domain dynamics or frequency domain dynamics for specified period, this method returns an object with the following attributes: X, Min, Max, Mean, StdDev, Upper, Lower. These are accessed like this:

rangegraph = turbine.RangeGraph("Bend moment", objectExtra=OrcFxAPI.oeTurbine(1))

rangegraph_MaxValues = rangegraph.Max

For frequency domain dynamics of a specified period, the output is based on synthesised time histories.

If a progressHandler has been set, it will be called during this operation.

RangeGraphCollated

RangeGraphCollated(varName, period=None, objectExtra=None, arclengthRange=None, restartModels=None)

Returns a range graph for the specified period, collated for the specified restart models.

The varName parameter is the name of the result variable required.

If period is omitted then all sample times are returned. For a specified period, a value of OrcinaDefaultReal() for FromTime or ToTime means the first sample of the first model or the last sample of the last model, respectively.

objectExtra is an ObjectExtra object used to specify the blade index, and optionally the clearance line for line clearance results.

arclengthRange is an ArclengthRange object that is used to specfiy a sub-section of the blade. If the parameter is omitted then the range graph for the entire blade is returned.

The restartModels argument is an iterable of integer indices specifying which models are to be included. You can use restartFileNames to obtain the file names of the models in the restart chain, and also the length of the restart chain. If restartModels is omitted, then all models in the restart chain are included.

If a progressHandler has been set, it will be called during this operation.

The return value is the same as for RangeGraph.