|
Python reference: OrcaFlexVesselObject |
The class OrcaFlexVesselObject is the Python interface representation of an OrcaFlex vessel. This class subclasses OrcaFlexObject so offers the same attributes and methods, with the addition of vessel specific methods described here.
A new OrcaFlexVesselObject is created from a Model object like this:
model = OrcFxAPI.Model()
vessel = model.CreateObject(OrcFxAPI.ObjectType.Vessel, "vessel2") # Create a new vessel object called "vessel2"
Or, where the OrcaFlex vessel already exists, like this:
vessel = model["vessel2"]
vessel.SaveDisplacementRAOsSpreadsheet(filename)
vessel.SaveSpectralResponseSpreadsheet(filename)
Saves displacement RAO or spectral response reports to filename. The file can be an Excel spreadsheet (.xlsx or .xls), a tab delimited file (.txt) or a comma separated file (.csv). The decision is taken based on the file extension that you specify. This method is implemented by calling C_SaveSpreadsheet.
vessel.SaveDisplacementRAOsSpreadsheetMem(spreadsheetFileType=SpreadsheetFileType.Xlsx)
vessel.SaveSpectralResponseSpreadsheetMem(spreadsheetFileType=SpreadsheetFileType.Xlsx)
Saves displacement RAO or spectral response reports, returning them as a bytearray object. The spreadsheetFileType parameter can be either SpreadsheetFileType.Csv, SpreadsheetFileType.Tab or SpreadsheetFileType.Xlsx to specify the spreadsheet format. This method is implemented by calling C_SaveSpreadsheetMem.
vessel.SaveSupportGeometryTable(filename)
Saves the support geometry report to filename. The file can be an Excel spreadsheet (.xlsx or .xls), a tab delimited file (.txt) or a comma separated file (.csv). The decision is taken based on the file extension that you specify. This method is implemented by calling C_SaveSpreadsheet.
vessel.SaveSupportGeometryTableMem(spreadsheetFileType=SpreadsheetFileType.Xlsx)
Saves the support geometry report, returning it as a bytearray object. The spreadsheetFileType parameter can be either SpreadsheetFileType.Csv, SpreadsheetFileType.Tab or SpreadsheetFileType.Xlsx to specify the spreadsheet format. This method is implemented by calling C_SaveSpreadsheetMem.
vessel.SaveAirGapReport(filename, period=None)
Saves the air gap report spreadsheet for the specified period to filename. If period is set to None or omitted then the whole simulation period is used. The file can be an Excel spreadsheet (.xlsx or .xls), a tab delimited file (.txt) or a comma separated file (.csv). The decision is taken based on the file extension that you specify. This method is implemented by calling C_SaveSpreadsheet.
vessel.SaveAirGapReportMem(spreadsheetFileType=SpreadsheetFileType.Xlsx, period=None)
Saves the air gap report spreadsheet for the specified period, returning it as a bytearray object. If period is set to None or omitted then the whole simulation period is used. The spreadsheetFileType parameter can be either SpreadsheetFileType.Csv, SpreadsheetFileType.Tab or SpreadsheetFileType.Xlsx to specify the spreadsheet format. This method is implemented by calling C_SaveSpreadsheetMem.
vessel.AirGapPointsSpecifications
Returns an iterable of time history specifications corresponding to the user-defined air gap reporting point data for the vessel. These specifications can be passed to GetMultipleTimeHistories
PanelPressureTimeHistory(diffraction, resultPanels, period=None, parameters=None)
Calculates time domain panel pressure results for this vessel. This method is implemented by calling C_GetPanelPressureTimeHistory.
The vessel must belong to a time domain OrcaFlex model. The OrcaFlex simulation must be complete – you can call RunSimulation to perform the simulation or call LoadSimulation to open an existing results file.
diffraction is a Diffraction object of an OrcaWave model that includes the same vessel. The diffraction object must represent a completed calculation – you can call the Calculate method to perform the calculation or call LoadResults to open an existing results file. The diffraction object must include the output option for intermediate results.
resultPanels is an iterable of 0-based indices specifying the panels for which pressure time history is to be calculated:
period is a Period object that specifies the period of the simulation over which results are to be calculated. If period is omitted then the default value is Period(PeriodNum.WholeSimulation).
parameters is a PanelPressureParameters object that specifies the components of water pressure to be included in the panel pressure calculation. If parameters is omitted then the default value is PanelPressureParameters(True, True, True).
If you include the diffraction component of panel pressure, the following requirement applies:
If you include the radiation component of panel pressure, the following requirements apply:
Tip: | Calculating the radiation component is particularly expensive. Use the threadCount property to set the number of processing threads, in order to calculate pressure results in parallel for different panels. Use the progressHandler property to set up a handler for progress notifications. |
This method returns a numpy array with shape [Nt, Nrp], where Nt is the number of samples in the specified period and Nrp is the number of resultPanels.