| name | orcaflex-specialist-1-model-organization |
| description | Sub-skill of orcaflex-specialist: 1. Model Organization (+2). |
| version | 1.0.0 |
| category | engineering |
| type | reference |
| scripts_exempt | true |
1. Model Organization (+2)
1. Model Organization
NAMING_CONVENTIONS = {
'vessels': 'VesselName',
'lines': 'Mooring_N' or 'Riser_N',
'buoys': 'Buoy_N' or 'Subsurface_Buoy_N',
'6d_buoys': '6DBuoy_N',
'winches': 'Winch_N',
'line_types': 'Descriptive_Name',
}
MODEL_STRUCTURE = {
'stages': [
'Build-up',
'Main simulation',
'Optional: Transient event'
],
'time_steps': {
'inner': 0.01,
'log_sample': 0.1
}
}
2. Simulation Settings
SIMULATION_SETTINGS = {
'implicit': {
'use_variable_timestep': 'Yes',
'target_log_sample_interval': 0.1,
'inner_timestep': 0.01,
'max_iterations': 20,
'tolerance': 1e-6
},
'explicit': {
'timestep': 0.001,
'log_sample_interval': 0.1
}
}
3. Error Handling
def safe_simulation_run(
model: OrcFxAPI.Model,
max_retries: int = 3
) -> bool:
"""
Run simulation with error handling and retries.
Args:
model: OrcaFlex model
max_retries: Maximum number of retry attempts
Returns:
True if successful, False otherwise
"""
for attempt in range(max_retries):
try:
model.RunSimulation()
return True
except OrcFxAPI.DynamicsError as e:
print(f"Dynamics error (attempt {attempt+1}): {e}")
current_dt = model.general.InnerTimeStep
model.general.InnerTimeStep = current_dt * 0.5
print(f"Reducing time step to {model.general.InnerTimeStep}")
except Exception as e:
print(f"Unexpected error: {e}")
return False
return False