wawi 0.0.5__py3-none-any.whl → 0.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wawi might be problematic. Click here for more details.
- wawi/__init__.py +1 -1
- wawi/modal.py +1 -1
- wawi/wind.py +12 -19
- {wawi-0.0.5.dist-info → wawi-0.0.7.dist-info}/METADATA +61 -2
- {wawi-0.0.5.dist-info → wawi-0.0.7.dist-info}/RECORD +8 -8
- {wawi-0.0.5.dist-info → wawi-0.0.7.dist-info}/LICENSE +0 -0
- {wawi-0.0.5.dist-info → wawi-0.0.7.dist-info}/WHEEL +0 -0
- {wawi-0.0.5.dist-info → wawi-0.0.7.dist-info}/top_level.txt +0 -0
wawi/__init__.py
CHANGED
wawi/modal.py
CHANGED
@@ -17,7 +17,7 @@ def maxreal(phi):
|
|
17
17
|
complex-valued modal transformation matrix, with vectors rotated to have maximum real parts
|
18
18
|
"""
|
19
19
|
|
20
|
-
angles = np.expand_dims(np.arange(0,np.pi
|
20
|
+
angles = np.expand_dims(np.arange(0,np.pi, 0.01), axis=0)
|
21
21
|
phi_max_real = np.zeros(np.shape(phi)).astype('complex')
|
22
22
|
for mode in range(0,np.shape(phi)[1]):
|
23
23
|
rot_mode = np.dot(np.expand_dims(phi[:, mode], axis=1), np.exp(angles*1j))
|
wawi/wind.py
CHANGED
@@ -526,7 +526,7 @@ def kaimal_auto(omega, Lx, A, sigma, V):
|
|
526
526
|
|
527
527
|
return S/(2*np.pi)
|
528
528
|
|
529
|
-
def
|
529
|
+
def von_karman_auto(omega, Lx, sigma, V):
|
530
530
|
|
531
531
|
A1 = [
|
532
532
|
0.0,
|
@@ -552,7 +552,7 @@ def von_Karman_auto(omega, Lx, sigma, V):
|
|
552
552
|
|
553
553
|
return S/(2*np.pi)
|
554
554
|
|
555
|
-
def generic_kaimal_matrix(omega, nodes, T_wind, A, sigma, C, Lx, U,
|
555
|
+
def generic_kaimal_matrix(omega, nodes, T_wind, A, sigma, C, Lx, U, spectrum_type='kaimal'):
|
556
556
|
# Adopted from MATLAB version. `nodes` is list with beef-nodes.
|
557
557
|
V = np.zeros(len(nodes)) # Initialize vector with mean wind in all nodes
|
558
558
|
Su = np.zeros([len(nodes), len(nodes)]) # One-point spectra for u component in all nodes
|
@@ -560,22 +560,16 @@ def generic_kaimal_matrix(omega, nodes, T_wind, A, sigma, C, Lx, U, options=None
|
|
560
560
|
Sw = np.zeros([len(nodes), len(nodes)]) # One-point spectra for w component in all nodes
|
561
561
|
xyz = np.zeros([len(nodes), 3]) # Nodes in wind coordinate system
|
562
562
|
|
563
|
-
if options is None:
|
564
|
-
options = {
|
565
|
-
'spectra_type': 'Kaimal'
|
566
|
-
}
|
567
|
-
|
568
563
|
for node_ix, node in enumerate(nodes):
|
569
564
|
xyz[node_ix,:] = (T_wind @ node.coordinates).T #Transform node coordinates to the wind coordinate system
|
570
565
|
V[node_ix] = U(node.coordinates) # Mean wind velocity in the nodes
|
571
566
|
|
572
|
-
if '
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
Su[node_ix,:], Sv[node_ix,:], Sw[node_ix,:] = kaimal_auto(omega, Lx, A, sigma, V[node_ix])
|
567
|
+
if 'karman' in spectrum_type.lower():
|
568
|
+
Su[node_ix,:], Sv[node_ix,:], Sw[node_ix,:] = von_karman_auto(omega, Lx, sigma, V[node_ix])
|
569
|
+
elif spectrum_type.lower() == 'kaimal':
|
570
|
+
Su[node_ix,:], Sv[node_ix,:], Sw[node_ix,:] = kaimal_auto(omega, Lx, A, sigma, V[node_ix]) # One point spectra for u component in all nodes
|
571
|
+
else:
|
572
|
+
raise ValueError('spectrum_type must either be defined as "vonKarman"/"Karman" or "Kaimal"')
|
579
573
|
|
580
574
|
x = xyz[:, 0]
|
581
575
|
y = xyz[:, 1]
|
@@ -822,7 +816,7 @@ def windaction_static(load_coefficients, elements, T_wind,
|
|
822
816
|
mean_wind = U(el.get_cog())
|
823
817
|
Vn = normal_wind(T_wind, el.T0)*mean_wind # Find the normal wind
|
824
818
|
BqBq = loadmatrix_fe_static(Vn, lc_fun(el), rho, B_fun(el), D_fun(el))
|
825
|
-
R1, R2 = loadvector(el.T0, BqBq, T_wind, el.L, static
|
819
|
+
R1, R2 = loadvector(el.T0, BqBq, T_wind, el.L, static=True) # Obtain the load vector for each element
|
826
820
|
|
827
821
|
RG[node1_dofs] = RG[node1_dofs] + R1[:,0] # Add the contribution from the element (end 1) to the system
|
828
822
|
RG[node2_dofs] = RG[node2_dofs] + R2[:,0] # Add the contribution from the element (end 2) to the system
|
@@ -833,12 +827,11 @@ def windaction_static(load_coefficients, elements, T_wind,
|
|
833
827
|
for node in nodes:
|
834
828
|
ix = node.index
|
835
829
|
n = np.r_[6*ix:6*ix+6]
|
836
|
-
RG_block[np.ix_(n)] = RG[n]
|
830
|
+
RG_block[np.ix_(n)] = RG[n]
|
837
831
|
|
838
|
-
|
839
|
-
genSqSq = phi.T @ RG_block
|
832
|
+
genF = phi.T @ RG_block
|
840
833
|
|
841
|
-
return
|
834
|
+
return genF
|
842
835
|
|
843
836
|
def K_from_ad(ad, V, w, B, rho):
|
844
837
|
if w==0:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: wawi
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.7
|
4
4
|
Summary: WAve and WInd response prediction
|
5
5
|
Author-email: "Knut A. Kvåle" <knut.a.kvale@ntnu.no>, Ole Øiseth <ole.oiseth@ntnu.no>, Aksel Fenerci <aksel.fenerci@ntnu.no>, Øivind Wiig Petersen <oyvind.w.petersen@ntnu.no>
|
6
6
|
License: MIT License
|
@@ -69,6 +69,65 @@ pip install git+https://www.github.com/knutankv/wawi.git@main
|
|
69
69
|
|
70
70
|
Quick start
|
71
71
|
=======================
|
72
|
+
Assuming a premade WAWI-model is created and saved as `MyModel.wwi´, it can be imported as follows:
|
73
|
+
|
74
|
+
```python
|
75
|
+
from wawi.model import Model, Windstate, Seastate
|
76
|
+
|
77
|
+
model = Model.load('MyModel.wwi')
|
78
|
+
model.n_modes = 50 # number of dry modes to use for computation
|
79
|
+
omega = np.arange(0.001, 2, 0.01) # frequency axis to use for FRF
|
80
|
+
```
|
81
|
+
|
82
|
+
A windstate (U=20 m/s with origin 90 degrees and other required properties) and a seastate (Hs=2.1m, Tp=8.3s, gamma=8, s=12, heading 90 deg) is created and assigned to the model:
|
83
|
+
|
84
|
+
```python
|
85
|
+
# Wind state
|
86
|
+
U0 = 20.0
|
87
|
+
direction = 90.0
|
88
|
+
windstate = Windstate(U0, direction, Iu=0.136, Iw=0.072,
|
89
|
+
Au=6.8, Aw=9.4, Cuy=10.0, Cwy=6.5,
|
90
|
+
Lux=115, Lwx=9.58, spectrum_type='kaimal')
|
91
|
+
model.assign_windstate(windstate)
|
92
|
+
|
93
|
+
# Sea state
|
94
|
+
Hs = 2.1
|
95
|
+
Tp = 8.3
|
96
|
+
gamma = 8
|
97
|
+
s = 12
|
98
|
+
theta0 = 90.0
|
99
|
+
seastate = Seastate(Tp, Hs, gamma, theta0, s)
|
100
|
+
model.assign_seastate(seastate)
|
101
|
+
```
|
102
|
+
|
103
|
+
The model is plotted by envoking this command:
|
104
|
+
|
105
|
+
```python
|
106
|
+
model.plot()
|
107
|
+
```
|
108
|
+
|
109
|
+
which gives this plot of the model and the wind and wave states:
|
110
|
+

|
111
|
+
|
112
|
+
Then, response predictions can be run by the `run_freqsim` method or iterative modal analysis (combined system) conducted by `run_eig`:
|
113
|
+
|
114
|
+
```python
|
115
|
+
model.run_eig(include=['hydro', 'aero'])
|
116
|
+
model.run_freqsim(omega)
|
117
|
+
```
|
118
|
+
|
119
|
+
The results are stored in `model.results`, and consists of modal representation of the response (easily converted to relevant physical counterparts using built-in methods) or modal parameters of the combined system (natural frequencies, damping ratio, mode shapes).
|
120
|
+
|
121
|
+
The resulting first mode shape is plotted as follows:
|
122
|
+
|
123
|
+
```python
|
124
|
+
model.plot_mode(0)
|
125
|
+
```
|
126
|
+
|
127
|
+
This results in this plot:
|
128
|
+

|
129
|
+
|
130
|
+
For more details and recommendations regarding the analysis setup, it is referred to the examples provided and the code reference.
|
72
131
|
|
73
132
|
Examples
|
74
133
|
=======================
|
@@ -79,7 +138,7 @@ References
|
|
79
138
|
|
80
139
|
Citation
|
81
140
|
=======================
|
82
|
-
Zenodo research entry:
|
141
|
+
Zenodo research entry: [](https://doi.org/10.5281/zenodo.14895014)
|
83
142
|
|
84
143
|
Support
|
85
144
|
=======================
|
@@ -1,9 +1,9 @@
|
|
1
|
-
wawi/__init__.py,sha256=
|
1
|
+
wawi/__init__.py,sha256=ZGsScT_c7WfnnnPCIKTMq2u95I502YsW9e2AXSVKAaY,158
|
2
2
|
wawi/fe.py,sha256=22QKI1GlfsG7o_TpFXaKJfzmbO2_2zdIMaoJmaIZdmY,4001
|
3
3
|
wawi/general.py,sha256=xHRoDkcchrL6Y7pTUqGsjBHh8YBLvX9dYcNXXCjQap8,13787
|
4
4
|
wawi/identification.py,sha256=bVB6EVRR6J39OO9ckuzNJ6f0FwIo4cLqfYgrsIN89TE,1748
|
5
5
|
wawi/io.py,sha256=5p3q_lQStQR85yo5hZ1Syl25RS2C__zIyV6e_2qRRw4,25308
|
6
|
-
wawi/modal.py,sha256=
|
6
|
+
wawi/modal.py,sha256=WjNGFsk0C3tYRy18Q9WNRCatmGJtq1JSv0WrkGV02Eo,20247
|
7
7
|
wawi/plot.py,sha256=XVaQjkjXv26Kt-G8xtAULa4KbWcCIErTQfB6euPACLg,19750
|
8
8
|
wawi/prob.py,sha256=0nCdKdwkNf4M6sHyCZuYlt06gD0NmqRNfl4KesgySWA,215
|
9
9
|
wawi/random.py,sha256=MHPpyTlRJSJFkCmeTAmw4Q5K1BPoFVb0Nxg0jDhkuIM,871
|
@@ -12,10 +12,10 @@ wawi/structural.py,sha256=t25ohH4uBbzUJ7Hqn_kUfYhxcikZkRp8da-9dn7aEbw,8341
|
|
12
12
|
wawi/time_domain.py,sha256=Oe-jviwDtBgpSmA7ZVmKEqQ5tdvsekXwOakYO1qUsN4,3841
|
13
13
|
wawi/tools.py,sha256=-hFBvf0qK4AMn2MQRhrOitDMMMKm2QuRkVfbPBefEkQ,332
|
14
14
|
wawi/wave.py,sha256=hhKg3KhKMBhOoCI7g8PFOGUbYgVhDyGmnYdBEdJ8mkY,16064
|
15
|
-
wawi/wind.py,sha256=
|
15
|
+
wawi/wind.py,sha256=1rUqiEdMaUrhprs87TBdX24l1uDCOINaYkBChMLYWso,38208
|
16
16
|
wawi/wind_code.py,sha256=8OKLPpqc84obNNKBoYb2NunKjcn6a3i_pAWpIFEwg4Q,223
|
17
|
-
wawi-0.0.
|
18
|
-
wawi-0.0.
|
19
|
-
wawi-0.0.
|
20
|
-
wawi-0.0.
|
21
|
-
wawi-0.0.
|
17
|
+
wawi-0.0.7.dist-info/LICENSE,sha256=bH1aWhrNbbPLrYnVFRaoYYzcUr-figHjry-kGB7Tc54,1076
|
18
|
+
wawi-0.0.7.dist-info/METADATA,sha256=8rKv08-csO88ctlULuHEvJ0CPGLeIPmwh-5LiWi71SE,5197
|
19
|
+
wawi-0.0.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
20
|
+
wawi-0.0.7.dist-info/top_level.txt,sha256=sE2NH_xVXnDKTGeIYzeX5IyU_j5vYDLl32v5uLiOMT4,5
|
21
|
+
wawi-0.0.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|