Skip to content

The moorings and foundations module for the DTOcean tools

License

Notifications You must be signed in to change notification settings

DTOcean/dtocean-moorings

Repository files navigation

appveyor codecov Codacy Badge release

DTOcean Mooring and Foundations Module

This package provides the Mooring and Foundations design module for the DTOcean tools. It can design the required station keeping for array of fixed or floating wave or tidal ocean energy converters (constrained by the environment and device design), and calculate the cost. It optimises the design for minimum cost given a specified safety factor.

See dtocean-app or dtocean-core to use this package within the DTOcean ecosystem.

* For python 2.7 only.

Installation

Installation and development of dtocean-moorings uses the Anaconda Distribution (Python 2.7)

Conda Package

To install:

$ conda install -c dataonlygreater dtocean-moorings

Source Code

Conda can be used to install dependencies into a dedicated environment from the source code root directory:

$ conda create -n _dtocean_moor python=2.7 pip

Activate the environment, then copy the .condrc file to store installation
channels:

$ conda activate _dtocean_moor
$ copy .condarc %CONDA_PREFIX%

OR, if you're using Powershell:

$ conda activate _dtocean_moor
$ copy .condarc $env:CONDA_PREFIX

Install polite into the environment. For example, if installing it from source:

$ cd \\path\\to\\polite
$ conda install --file requirements-conda-dev.txt
$ pip install -e .

Finally, install dtocean-moorings and its dependencies using conda and pip:

$ cd \\path\\to\\dtocean-moorings
$ conda install --file requirements-conda-dev.txt
$ pip install -e .

To deactivate the conda environment:

$ conda deactivate

Tests

A test suite is provided with the source code that uses pytest.

If not already active, activate the conda environment set up in the Source Code section:

$ conda activate _dtocean_moor

Install packages required for testing to the environment (one time only):

$ conda install -y mock pytest pytest-cov=2.5.1 pytest-mock

Run the tests:

$ pytest tests

Uninstall

To uninstall the conda package:

$ conda remove dtocean-moorings

To uninstall the source code and its conda environment:

$ conda remove --name _dtocean_moor --all

Usage

Example scripts are available in the "examples" folder of the source code.

$ cd examples
$ python fairhead.py

Component database keys and values

The keys of the compdict argument to the Variables class have the following meanings:

  • item1: Mooring or foundation system
  • item2: Name
  • item3: Subname
  • item4: [Material, Grade, Colour]
  • item5: Strength and mechanical properties. For piles [yield stress, Young's modulus]. For ropes [minimum break load, [load, axial stiffness]]. For cables [minimum break load, minimum bend radius]. All other components: [minimum break load, axial stiffness]
  • item6: Size. For piles/suction caissons [diameter, thickness]. For anchors [width, depth, height, connecting size]. For chains, forerunner
    assemblies, shackles and swivels [diameter, connecting length]. For ropes and cables [outer diameter]
  • item7: Mass. For piles/suction caissons, chains, ropes, cables and forerunner assemblies [dry mass per unit length, wet mass per unit length]. For anchors, shackles and swivels [dry unit mass, wet unit mass]
  • item8: Environmental impact
  • item9: Anchor coefficients
  • item10: Failure rates
  • item11: Cost

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

See this blog post for information regarding development of the DTOcean ecosystem.

Please make sure to update tests as appropriate.

Credits

This package was initially created as part of the EU DTOcean project by:

It is now maintained by Mathew Topper at Data Only Greater.

License

GPL-3.0