orcaflex-model-generator
Generate OrcaFlex models from templates using component assembly with
npxskills add majiayu000/claude-skill-registry--skill orcaflex-model-generatorLoading…
Generate OrcaFlex models from templates using component assembly with
npxskills add majiayu000/claude-skill-registry--skill orcaflex-model-generatorLoading…
ABOUTME: Generate complete OrcaFlex models using component assembly approach - build models from pre-validated components (vessels, lines, materials, environments) via lookup tables instead of manually editing template files.
version: 1.0.0
python_min_version: '3.10'
dependencies:
orcaflex-file-conversion: '>=1.0.0,<2.0.0'
orcaflex_version: '>=11.0'
compatibility:
tested_python:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
os:
- Windows
- Linux
- macOS
Added:
Changed:
This skill provides template-based OrcaFlex model generation using a component assembly approach. Instead of manually editing model files, you configure models by selecting pre-validated components from lookup tables.
Use this skill when you need to:
from digitalmodel.modules.orcaflex.model_generator import OrcaFlexModelGenerator
generator = OrcaFlexModelGenerator()
# List vessels
vessels = generator.list_components("vessels")
print(f"Available vessels: {vessels}")
# Output: ['FPSO_P50', 'FPSO_P70', 'Drillship_DP3', ...]
# List risers
risers = generator.list_components("lines/risers")
print(f"Available risers: {risers}")
# Output: ['SCR_10inch_X65', 'SCR_12inch_X65', 'LWR_12inch', ...]
# List environments
envs = generator.list_components("environment")
print(f"Available environments: {envs}")
# Output: ['GoM_100yr', 'GoM_10yr', 'NorthSea_100yr', ...]
# Get vessel specifications
vessel_spec = generator.get_component("vessels", "FPSO_P50")
print(f"FPSO P50 Length: {vessel_spec['LOA']}m")
print(f"Displacement: {vessel_spec['Displacement']}t")
# Get riser specifications
riser_spec = generator.get_component("lines/risers", "SCR_10inch_X65")
print(f"OD: {riser_spec['OD']}m")
print(f"Wall Thickness: {riser_spec['WallThickness']}m")
print(f"Material: {riser_spec['Material']}")
# my_scr_config.yml
model:
type: "scr_catenary"
name: "GoM_SCR_Analysis_001"
vessel:
lookup: "FPSO_P50" # From component library
position: {x: 0, y: 0, z: 0}
riser:
lookup: "SCR_10inch_X65" # From component library
length: 1500
segments: 150
environment:
lookup: "GoM_100yr" # From component library
water_depth: 1200
analysis:
type: "dynamic"
duration: 10800
time_step: 0.1
# Generate model
model = generator.generate_from_template(
template="risers/scr_catenary",
config="my_scr_config.yml",
output="my_scr_model.yml"
)
# Validate
validation = generator.validate(model)
if validation['is_valid']:
print("✅ Model is valid")
else:
print("❌ Validation errors:", validation['errors'])
| Template | Description | Status |
|---|---|---|
risers/scr_catenary | Steel Catenary Riser | ✅ Ready |
risers/ttr_top_tensioned | Top-Tensioned Riser | 📋 Planned |
risers/lazy_wave | Lazy Wave Riser | 📋 Planned |
risers/pliant_wave | Pliant Wave Riser | 📋 Planned |
risers/hybrid_riser | Hybrid Riser System | 📋 Planned |
| Template | Description | Status |
|---|---|---|
pipeline_installation/s_lay | S-Lay Method | 📋 Planned |
pipeline_installation/j_lay | J-Lay Method | 📋 Planned |
pipeline_installation/reel_lay | Reel-Lay Method | 📋 Planned |
pipeline_installation/tow_installation | Pipeline Tow & Pull-in | 📋 Planned |
| Template | Description | Status |
|---|---|---|
umbilical_installation/static_installation | Static Umbilical | 📋 Planned |
umbilical_installation/dynamic_umbilical | Dynamic Umbilical | 📋 Planned |
umbilical_installation/bundle_installation | Umbilical Bundle | 📋 Planned |
Location: docs/modules/orcaflex/templates/components/vessels/
| Component ID | Type | LOA (m) | Displacement (t) | Description |
|---|---|---|---|---|
| FPSO_P50 | FPSO | 300 | 200,000 | Standard FPSO deepwater |
| FPSO_P70 | FPSO | 320 | 250,000 | Large FPSO ultra-deepwater |
| FPSO_P30 | FPSO | 270 | 150,000 | Compact FPSO shallow water |
| DS_DP3_7GEN | Drillship | 228 | 90,000 | 7th gen DP3 drillship |
| PLV_SLAY_LARGE | Pipelay | 185 | 45,000 | Large S-lay vessel |
Location: docs/modules/orcaflex/templates/components/lines/risers.csv
| Component ID | OD (m) | Material | Max Tension (kN) | Description |
|---|---|---|---|---|
| SCR_10inch_X65 | 0.2731 | X65_STEEL | 2,500 | Standard 10-inch SCR |
| SCR_12inch_X65 | 0.3239 | X65_STEEL | 3,500 | 12-inch SCR |
| SCR_10inch_X70 | 0.2731 | X70_STEEL | 2,700 | High strength X70 |
| LWR_12inch | 0.3239 | X65_STEEL | 3,500 | Lazy wave riser |
Location: docs/modules/orcaflex/templates/components/materials/
| Component ID | Grade | Yield (MPa) | UTS (MPa) | Density (kg/m³) |
|---|---|---|---|---|
| X65_STEEL | X65 | 448 | 531 | 7850 |
| X70_STEEL | X70 | 483 | 565 | 7850 |
| X80_STEEL | X80 | 552 | 621 | 7850 |
| TITANIUM_GR5 | Ti-6Al-4V | 880 | 950 | 4430 |
Location: docs/modules/orcaflex/templates/components/environment/
| Component ID | Hs (m) | Tp (s) | Current (m/s) | Return Period |
|---|---|---|---|---|
| GoM_100yr | 14.5 | 15.0 | 1.5 | 100-year |
| GoM_10yr | 10.2 | 12.5 | 1.2 | 10-year |
| NorthSea_100yr | 16.8 | 16.5 | 1.8 | 100-year |
| Brazil_100yr | 13.2 | 14.8 | 1.4 | 100-year |
from digitalmodel.modules.orcaflex.model_generator import generate_model
# Simple one-liner
model = generate_model(
template="risers/scr_catenary",
config={
'model': {'name': 'Basic_SCR'},
'vessel': {'lookup': 'FPSO_P50'},
'riser': {'lookup': 'SCR_10inch_X65', 'length': 1200},
'environment': {'lookup': 'GoM_1yr', 'water_depth': 1000},
'analysis': {'type': 'static'}
},
output="basic_scr.yml"
)
from digitalmodel.modules.orcaflex.model_generator import OrcaFlexModelGenerator
generator = OrcaFlexModelGenerator()
# Generate 10 models with varying water depth
for depth in range(800, 1800, 100):
config = {
'model': {'name': f'SCR_Depth_{depth}m'},
'vessel': {'lookup': 'FPSO_P50'},
'riser': {'lookup': 'SCR_10inch_X65', 'length': depth + 300},
'environment': {'lookup': 'GoM_10yr', 'water_depth': depth},
'analysis': {'type': 'static'}
}
generator.generate_from_template(
template="risers/scr_catenary",
config=config,
output=f"models/scr_depth_{depth}.yml"
)
print("Generated 10 parametric models")
config = {
'model': {'name': 'Custom_SCR'},
'vessel': {
'lookup': 'FPSO_P50',
# Override displacement for loaded condition
'Displacement': 220000
},
'riser': {
'lookup': 'SCR_10inch_X65',
'length': 1500,
# Override for thicker wall
'WallThickness': 0.016
},
'environment': {
'lookup': 'GoM_100yr',
'water_depth': 1400,
# Override for more severe current
'SurfaceCurrent': 1.8
},
'analysis': {'type': 'dynamic', 'duration': 10800}
}
model = generate_model("risers/scr_catenary", config, "custom_scr.yml")
from digitalmodel.modules.orcaflex.model_generator import OrcaFlexModelGenerator
generator = OrcaFlexModelGenerator()
# Add custom vessel to library
generator.add_component(
category="vessels",
component_id="My_Custom_FPSO",
properties={
"VesselID": "My_Custom_FPSO",
"VesselName": "Project X FPSO",
"LOA": 315.0,
"Breadth": 63.0,
"Depth": 31.0,
"Draught": 19.0,
"Displacement": 225000.0,
"LCG": 0.0,
"VCG": 10.5,
"WindArea": 8500.0,
"CurrentArea": 6500.0,
"OilCapacity": 1900000.0,
"Description": "Custom FPSO for Project X"
}
)
# Use in model
config = {
'vessel': {'lookup': 'My_Custom_FPSO'},
# ... rest of config
}
from digitalmodel.modules.orcaflex.model_generator import generate_model
from digitalmodel.modules.orcaflex.orcaflex_converter_enhanced import OrcaFlexConverterEnhanced
from digitalmodel.modules.orcaflex.universal import UniversalOrcaFlexRunner
# 1. Generate model from template
model_yml = generate_model(
template="risers/scr_catenary",
config="my_config.yml",
output="my_scr_model.yml"
)
# 2. Convert to .dat format
converter = OrcaFlexConverterEnhanced(output_format='dat')
success, dat_file, error = converter.convert_file("my_scr_model.yml")
# 3. Run OrcaFlex analysis
runner = UniversalOrcaFlexRunner()
sim_file = runner.run_single(dat_file)
# 4. Post-process results
from digitalmodel.modules.orcaflex.opp import OPP
opp = OPP()
results = opp.process_single_file(sim_file)
print(f"Analysis complete! Results: {results}")
import pandas as pd
from digitalmodel.modules.orcaflex.model_generator import OrcaFlexModelGenerator
generator = OrcaFlexModelGenerator()
# Read parametric study configurations from CSV
study_params = pd.read_csv("parametric_study.csv")
# Generate model for each row
for idx, row in study_params.iterrows():
config = {
'model': {'name': row['ModelName']},
'vessel': {'lookup': row['VesselID']},
'riser': {
'lookup': row['RiserID'],
'length': row['RiserLength']
},
'environment': {
'lookup': row['EnvironmentID'],
'water_depth': row['WaterDepth']
},
'analysis': {'type': row['AnalysisType']}
}
generator.generate_from_template(
template="risers/scr_catenary",
config=config,
output=f"models/{row['ModelName']}.yml"
)
print(f"Generated {len(study_params)} models from CSV")
# Use /orcaflex-file-conversion skill to convert generated models
# 1. Generate model
model = generate_model("risers/scr_catenary", "config.yml", "model.yml")
# 2. Convert to .dat using skill
# Skill will handle conversion with proper validation
# Use /orcaflex-modeling skill to run generated models
# 1. Generate model
model = generate_model("risers/scr_catenary", "config.yml", "model.yml")
# 2. Run using universal runner (via skill)
# Skill provides full analysis capabilities
# Complete workflow: generate → run → post-process
# 1. Generate
model = generate_model("risers/scr_catenary", "config.yml", "model.yml")
# 2. Run (via /orcaflex-modeling skill)
# Produces .sim file
# 3. Post-process (via /orcaflex-post-processing skill)
# Extracts statistics, plots, reports
All generated models are validated for:
class OrcaFlexModelGenerator:
"""Generate OrcaFlex models from components and templates."""
def __init__(self,
components_dir: Optional[Path] = None,
templates_dir: Optional[Path] = None):
"""Initialize generator with component and template directories."""
def list_components(self, category: str) -> List[str]:
"""List available components in category."""
def get_component(self, category: str, component_id: str) -> Dict[str, Any]:
"""Get component properties from lookup table."""
def generate_from_template(self,
template: str,
config: Union[str, Path, Dict[str, Any]],
output: Optional[Union[str, Path]] = None) -> Dict[str, Any]:
"""Generate model from template and configuration."""
def validate(self, model: Dict[str, Any]) -> Dict[str, Any]:
"""Validate generated model."""
def add_component(self,
category: str,
component_id: str,
properties: Dict[str, Any]) -> None:
"""Add custom component to library."""
def generate_model(template: str,
config: Union[str, Path, Dict[str, Any]],
output: Optional[Union[str, Path]] = None) -> Dict[str, Any]:
"""
Convenience function for one-line model generation.
Example:
>>> model = generate_model("risers/scr_catenary", "config.yml", "model.yml")
"""
model:
type: string # Template type (required)
name: string # Model name (required)
description: string # Optional description
vessel:
lookup: string # Component ID (required)
position: # Position override (optional)
x: float
y: float
z: float
heading: float # Heading override (optional)
# ... any vessel property can be overridden
riser:
lookup: string # Component ID (required)
length: float # Total length (required)
segments: int # Number of segments (required)
top_tension: float # Top tension (optional)
# ... any riser property can be overridden
environment:
lookup: string # Component ID (required)
water_depth: float # Water depth (required)
# ... any environment property can be overridden
analysis:
type: "static" | "dynamic" # Analysis type (required)
duration: float # Duration for dynamic (required if dynamic)
time_step: float # Time step (required if dynamic)
target_log_sample_interval: float # Logging interval (optional)
Generate standard models in minutes for initial project assessments.
Systematically vary parameters to optimize design:
Quickly test multiple 100-year scenarios across different basins (GoM, North Sea, West Africa, Brazil).
Ensure all models meet engineering standards with validated components.
Help engineers learn OrcaFlex modeling with proven templates and configurations.
Start new projects with proven, validated configurations instead of from scratch.
Automated model generation ensures consistent documentation and traceability.
# Error: ComponentNotFoundError: Component 'FPSO_XYZ' not found
# Solution: List available components
generator = OrcaFlexModelGenerator()
print(generator.list_components("vessels"))
Validation warnings indicate non-critical issues:
Models can still be generated with warnings, but review is recommended.
Add your own components to expand the library:
generator.add_component(
category="vessels",
component_id="ProjectX_FPSO",
properties={...} # All required properties
)
/orcaflex-file-conversion: Convert generated models between formats (.yml ⟷ .dat)/orcaflex-modeling: Run OrcaFlex simulations with universal runner/orcaflex-post-processing: Extract results and generate reportsdocs/modules/orcaflex/templates/README.mddocs/modules/orcaflex/templates/components/src/digitalmodel/modules/orcaflex/model_generator/docs/modules/orcaflex/templates/risers/scr_catenary/README.mdCurrent Library:
Growth Plan:
Skill Version: 1.0.0 Last Updated: 2026-01-03 Status: ✅ Production Ready
License: Repository license applies Support: File issues at repository issue tracker
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.