marinlauber / Python-VPP

3-DOF Velocity Prediction Program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-VPP

3-DOF Velocity Prediction Program based on the ORC aero and hydro dynamic models.

Please see the demo hosted at https://yacht-vpp.streamlit.app/ and go for a test sail!

Using the code

To use the code, first clone or download this repository then install the required dependencies (see below).

The main files that are used are runVPP.py and righting_moment.json. These have to be filled with the data of your boat. By default they are using the YD-41 (from Principle of Yacht Design).

The VPP is run with.

$ python runVPP.py

Once the code has run, it should generate the following figure (or a similar one)

YD-41 VPP results

See the documentation.

Input variables

Here is a list of the key variables used in the VPP.

  1. Appendages :
    • Cu : Root Chord / Upper Chord (m)
    • Cl : Tip Chord / Lower Chord (m)
    • Span : Span (m)
  2. Yacht :
    • Lwl : Length waterline (m)
    • Vol : Displ. volume of canoebody (m^3)
    • Bwl : Beam waterline (m)
    • Tc : Canoe body draft (m)
    • WSA : Wetted surface area (m^2)
    • Tmax : Draft max, i.e. Keel (m)
    • Amax : Max. section area (m^2)
    • Mass : Total mass of the yacht, including keel (kg)
    • Ff : Freeboard height fore (m)
    • Fa : Freeboard height aft (m)
    • Boa : Beam overall (m)
    • Loa : Length overall (m)
    • App : List of appendages
    • Sails : List of Sails
  3. Sails: Standard measurements, except Roach is defined as 1-A/(0.5PE) Kite only takes area and vce estimate (this is very rough)
  4. VPP.set_analysis()
    • TWA range : range of TWA to use
    • TWS range : range of TWS, must be between [2, 35]

Contributing

We are very keen to see contributions to code, documentation and feature development!

When you make a contribution please make sure that any new functionality is covered with additional tests.

Follow the steps below to contribute to this project.

Install dependencies

Install the required dependencies from the requirements.txt file.

If using pip then pip install requirements.txt.

If using conda then follow these steps to create an environment with the right dependencies:

conda create --name Python-VPP \
    && conda config --add channels conda-forge \
    && conda activate Python-VPP \
    && conda install -y --file requirements.txt

Run tests

Tests are implemented using pytest.

You can run tests with

pytest -vv

You can run a benchmark against the YD-41 results from WinVPP by running the benchmark.py script.

$ python benchmark/benchmark.py -g -o

Acknowledgements

License

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

About

3-DOF Velocity Prediction Program

License:MIT License


Languages

Language:Python 98.0%Language:Batchfile 1.1%Language:Makefile 0.9%Language:Procfile 0.1%