Skip to main content

OTEX - Ocean Thermal Energy eXchange: OTEC plant design, simulation, and analysis

Project description

OTEX Logo

OTEX - Ocean Thermal Energy eXchange

A Python library for OTEC plant design, simulation, and techno-economic analysis

CI codecov Documentation DOI

PyPI Python Downloads License Ruff

FeaturesInstallationQuick StartDocumentationCitation


Overview

OTEX (Ocean Thermal Energy eXchange) is a Python library for designing, simulating, and analyzing Ocean Thermal Energy Conversion (OTEC) power plants. It integrates with global oceanographic databases to enable site-specific techno-economic assessments anywhere in the tropical oceans.

OTEX enables researchers and engineers to:

  • Design OTEC plants with multiple thermodynamic cycles and working fluids
  • Analyze regional and global potential using CMEMS or HYCOM oceanographic data
  • Perform uncertainty analysis with Monte Carlo simulations and sensitivity studies
  • Compare scenarios across different locations, plant sizes, and configurations

Features

Thermodynamic Cycles

Cycle Description Status
Rankine Closed Ammonia/organic fluid closed loop ✅ Stable
Rankine Open Flash evaporation of seawater ✅ Stable
Rankine Hybrid Combined closed/open cycle ✅ Stable
Kalina Ammonia-water mixture ✅ Stable
Uehara Advanced ammonia-water cycle ✅ Stable

Working Fluids

  • Ammonia (NH₃) - Default, polynomial or CoolProp
  • R134a - Requires CoolProp
  • R245fa - Requires CoolProp
  • Propane - Requires CoolProp
  • Isobutane - Requires CoolProp

Data Sources

Source Resolution Depth Levels Period Authentication
CMEMS 0.083° 50 1993–present Required (free account)
HYCOM 0.08° 40 1994–2015, 2019–2024 Not required

Analysis Capabilities

  • Regional Analysis: Site-specific LCOE maps and power profiles
  • Site Screening: Optional exclusion of protected areas (WDPA) and busy shipping lanes (World Bank vessel density), plus seismic and cyclone risk-based cost multipliers (GEM PGA, NOAA IBTrACS)
  • Uncertainty Analysis: Monte Carlo with Latin Hypercube Sampling
  • Sensitivity Analysis: Sobol indices and Tornado diagrams
  • Off-design Performance: Time-resolved power output profiles

Installation

Basic Installation

pip install otex

With Optional Dependencies

# High-accuracy fluid properties
pip install otex[coolprop]

# Uncertainty analysis (Sobol indices)
pip install otex[uncertainty]

# Siting layers (protected areas, shipping lanes, seismic and cyclone hazards)
pip install otex[siting]

# All optional dependencies
pip install otex[all]

Development Installation

git clone https://github.com/msotocalvo/OTEX.git
cd OTEX
pip install -e ".[dev]"

Oceanographic Data Access

HYCOM (no credentials needed):

from otex.regional import run_regional_analysis

otec_plants, sites = run_regional_analysis(
    studied_region='Jamaica',
    data_source='HYCOM',
    year=2020,
)

CMEMS (requires free account):

  1. Create account at Copernicus Marine
  2. Configure credentials:
    copernicusmarine login
    

See Installation Guide for detailed instructions.

Quick Start

Basic Plant Configuration

from otex.config import parameters_and_constants

# Configure a 100 MW OTEC plant
inputs = parameters_and_constants(
    p_gross=-100000,           # 100 MW (negative = power output)
    cost_level='low_cost',
    cycle_type='rankine_closed',
    fluid_type='ammonia',
    year=2020
)

print(f"Cycle: {inputs['cycle_type']}")
print(f"Discount rate: {inputs['discount_rate']:.1%}")
print(f"Plant lifetime: {inputs['lifetime']} years")

Regional Analysis

# Analyze Cuba for 2020 with a 50 MW plant (CMEMS, default)
otex-regional Cuba --year 2020 --power -50000

# Using HYCOM data (no credentials needed)
otex-regional Philippines --year 2020 --data-source HYCOM

# Analyze with Kalina cycle
otex-regional Philippines --cycle kalina --year 2021

Uncertainty Analysis

from otex.analysis import (
    MonteCarloAnalysis,
    UncertaintyConfig,
    TornadoAnalysis,
    plot_histogram,
    plot_tornado
)

# Monte Carlo analysis
config = UncertaintyConfig(n_samples=1000, seed=42)
mc = MonteCarloAnalysis(T_WW=28.0, T_CW=5.0, config=config)
results = mc.run()

# Get statistics
stats = results.compute_statistics()
print(f"LCOE: {stats['lcoe']['lcoe_mean']:.2f} ± {stats['lcoe']['lcoe_std']:.2f} ct/kWh")
print(f"90% CI: [{stats['lcoe']['lcoe_p5']:.2f}, {stats['lcoe']['lcoe_p95']:.2f}]")

# Tornado diagram
tornado = TornadoAnalysis(T_WW=28.0, T_CW=5.0)
tornado_results = tornado.run()
plot_tornado(tornado_results)

Command Line Interface

# Tornado analysis
python scripts/uncertainty_analysis.py --T_WW 28 --T_CW 5 --method tornado

# Monte Carlo with 500 samples
python scripts/uncertainty_analysis.py --T_WW 28 --T_CW 5 --method monte-carlo --samples 500

# Full analysis with plots
python scripts/uncertainty_analysis.py --T_WW 28 --T_CW 5 --method all --samples 200 --save-plots

Documentation

Document Description
Installation Guide Detailed setup instructions
Quick Start Tutorial Get started in 10 minutes
Regional Analysis Analyze specific regions
Uncertainty Analysis Monte Carlo and sensitivity
API Reference Complete API documentation
01 - Quick Start Basic plant sizing and cost analysis
02 - Regional Analysis Analyze OTEC potential for a region
03 - Uncertainty Analysis Monte Carlo, Tornado, Sobol

Project Structure

OTEX/
├── otex/                    # Main package
│   ├── core/               # Thermodynamic cycles and fluids
│   ├── plant/              # Plant sizing and operation
│   ├── economics/          # Cost models and LCOE
│   ├── analysis/           # Uncertainty and sensitivity
│   ├── data/               # Data loading (CMEMS, HYCOM, NetCDF)
│   └── config.py           # Configuration management
├── scripts/                 # CLI scripts
│   ├── regional_analysis.py
│   ├── global_analysis.py
│   └── uncertainty_analysis.py
├── tests/                   # Test suite
├── docs/                    # Documentation
└── data/                    # Reference data files

Configuration Options

Parameter Options Default
cycle_type rankine_closed, rankine_open, rankine_hybrid, kalina, uehara rankine_closed
fluid_type ammonia, r134a, r245fa, propane, isobutane ammonia
cost_level 'low_cost', 'high_cost', or a CostScheme object 'low_cost'
p_gross Any negative value (kW) -136000
data_source 'CMEMS', 'HYCOM' 'CMEMS'
year 1993–present (CMEMS), 1994–2015 / 2019–2024 (HYCOM) 2020

Custom Cost Schemes

Beyond the two built-in scenarios you can define your own cost parameters with CostScheme and Python's standard dataclasses.replace():

from otex.economics import CostScheme, LOW_COST
from dataclasses import replace

# Modify specific parameters of an existing scheme
my_scheme = replace(LOW_COST, turbine_coeff=400, opex_fraction=0.04)

# Use it everywhere cost_level is accepted
inputs = parameters_and_constants(p_gross=-100000, cost_level=my_scheme)
costs, capex, opex, lcoe = capex_opex_lcoe(plant, inputs, my_scheme)

All existing code that uses cost_level='low_cost' or cost_level='high_cost' continues to work unchanged.

Requirements

  • Python >= 3.9
  • NumPy, Pandas, SciPy, Matplotlib
  • xarray, netCDF4 (oceanographic data)
  • tqdm (progress bars)

Optional:

  • CoolProp (additional working fluids)
  • SALib (Sobol sensitivity analysis)

Acknowledgments

OTEX builds upon pyOTEC by Langer et al. For the original methodology, see:

Langer, J., Blok, K. The global techno-economic potential of floating, closed-cycle ocean thermal energy conversion. J. Ocean Eng. Mar. Energy (2023). https://doi.org/10.1007/s40722-023-00301-1

Citation

If you use OTEX in your research, please cite:

  • Soto Calvo M, and Lee HS., 2025. Ocean Thermal Energy Conversion (OTEC) Potential in Central American and Caribbean Regions: A Multicriteria Analysis for Optimal Sites. Applied Energy. 394: 126182. https://doi.org/10.1016/j.apenergy.2025.126182

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otex-0.1.4.tar.gz (124.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otex-0.1.4-py3-none-any.whl (114.5 kB view details)

Uploaded Python 3

File details

Details for the file otex-0.1.4.tar.gz.

File metadata

  • Download URL: otex-0.1.4.tar.gz
  • Upload date:
  • Size: 124.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for otex-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cead3b180b7acaab5250f5126e04aa525abd1158260ec67e34c2dd3ca2cf5bb2
MD5 97463a551727b22306373dde3d007ddd
BLAKE2b-256 ce2b023c93220c5de877b66be064285afa00ada8392448846b30f65134cfcce5

See more details on using hashes here.

File details

Details for the file otex-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: otex-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 114.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for otex-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 26687765ce0ee22dd1b5ec807e0c73eae98e0230c373dde0ee5cf79b9748f67c
MD5 78dc773ef2245edc36c9233667277525
BLAKE2b-256 60525b8ff37c828b940e1b1112aa0c0fe9281f7211b384c269cdd5311ebc4ba7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page