Skip to content

Commit

Permalink
add test to check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TAJD committed Feb 14, 2024
1 parent 4305def commit 8984d53
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from src.SailMod import Jib, Kite, Main
from src.YachtMod import Keel, Rudder, Yacht

def return_YD41_particulars():

YD41 = Yacht(
Name="YD41",
Lwl=11.90,
Vol=6.05,
Bwl=3.18,
Tc=0.4,
WSA=28.20,
Tmax=2.30,
Amax=1.051,
Mass=6500,
Ff=1.5,
Fa=1.5,
Boa=4.2,
Loa=12.5,
App=[Keel(Cu=1.00, Cl=0.78, Span=1.90), Rudder(Cu=0.48, Cl=0.22, Span=1.15)],
Sails=[
Main("MN1", P=16.60, E=5.60, Roach=0.1, BAD=1.0),
Jib("J1", I=16.20, J=5.10, LPG=5.40, HBI=1.8),
Kite("A2", area=150.0, vce=9.55),
Kite("A5", area=75.0, vce=2.75),
],
)
return YD41
26 changes: 26 additions & 0 deletions tests/test_vpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

import numpy as np

from tests.test_utils import return_YD41_particulars
from src.VPPMod import VPP
from src.SailMod import Jib, Main

def test_single_sail_set():
YD41 = return_YD41_particulars()

YD41_no_kite = YD41
YD41_no_kite.sails = [
Main("MN1", P=16.60, E=5.60, Roach=0.1, BAD=1.0),
Jib("J1", I=16.20, J=5.10, LPG=5.40, HBI=1.8)
]

vpp = VPP(Yacht=YD41)

vpp.set_analysis(
tws_range=np.arange(4.0, 6.0, 1.0), twa_range=np.linspace(30.0, 180.0, 3)
)

vpp.run(verbose=False)
vpp.write("results")
vpp.polar(3, False)
vpp.SailChart(False)

0 comments on commit 8984d53

Please sign in to comment.