Skip to content

How to run dynamic analisys? #99

@junjihan

Description

@junjihan

Dear RAFT developers and lovers:
I write a code accroding to https://openraft.readthedocs.io/en/latest/starting.html Getting Started→Example
as followed:
import raft
import yaml
import matplotlib.pyplot as plt
plt.switch_backend('TkAgg')
with open('VolturnUS-S_example.yaml', 'r', encoding='utf-8') as file:
design = yaml.load(file, Loader=yaml.FullLoader)
model = raft.Model(design)
model.analyzeUnloaded()
model.solveEigen()
model.analyzeCases(display=1)
model.plotResponses()
model.plot()

plt.show()

code results:
C:\Users\EENA\PycharmProjects\DNN.venv\Scripts\python.exe D:\RAFT-main\examples\test.py
Making FOWT
Mesh characteristic lengths: min=1.0, max=3.0
Found mean offets of FOWT 1 with surge = 0.40 m, sway = -0.00, and heave = 0.04 m
roll = -0.00 deg, pitch = -1.36 deg, and yaw = -0.00 deg

--------------------- Running Case 1 ----------------------
[0, 0, 0, 'operating', 0, 'JONSWAP', 12, 6, 0]
New Equilibrium Position [ 4.00415107e-01 8.53297243e-11 3.89282531e-02 1.59894899e-14
-2.37208348e-02 9.64766117e-15]
Remaining Forces on the Model (N) [-6.30504624e+02 -6.62798993e-06 -9.58191940e+02 6.21391579e-05
-8.87036059e+03 -6.32277429e-06]
Found mean offets of FOWT 1 with surge = 0.40 m, sway = 0.00, and heave = 0.04 m
roll = 0.00 deg, pitch = -1.36 deg, and yaw = 0.00 deg
Solving for system response to wave excitation in primary wave direction
-------------------- FOWT 1 Case 1 Statistics --------------------
Response channel Average RMS Maximum Minimum
surge (m) 4.00e-01 6.55e-01 2.37e+00 -1.57e+00
sway (m) 8.53e-11 2.11e-14 8.54e-11 8.53e-11
heave (m) 3.89e-02 5.75e-01 1.76e+00 -1.69e+00
roll (deg) 9.16e-13 8.67e-15 9.42e-13 8.90e-13
pitch (deg) -1.36e+00 2.38e-01 -6.46e-01 -2.07e+00
yaw (deg) 5.53e-13 2.98e-14 6.42e-13 4.63e-13
nacelle acc. (m/s) 2.33e-01 2.87e-01 1.09e+00 -6.29e-01
tower bending (Nm) -4.31e+07 5.28e+07 1.15e+08 -2.01e+08

DeprecationWarning: C:\Users\EENA\PycharmProjects\DNN.venv\Lib\site-packages\matplotlib\backends_backend_tk.py:778
'mode' parameter is deprecated and will be removed in Pillow 13 (2026-10-15)
进程已结束,退出代码为 0
However,when I try to run dynamic analysis according to runRAFT.py:

--- Create and run the model ---

model = raft.Model(design, w=w, depth=depth)  # set up model

model.setEnv(Hs=8, Tp=12, V=10, Fthrust=float(design['turbine']['Fthrust']))  # set basic wave and wind info

model.calcSystemProps()          # get all the setup calculations done within the model

model.solveEigen()

model.calcMooringAndOffsets()    # calculate the offsets for the given loading

model.solveDynamics()            # put everything together and iteratively solve the dynamic response

model.plot()

plt.show()

return model 

and I copy
'model.solveDynamics()
model.calcMooringAndOffsets()'to my code:
import raft
import yaml
import matplotlib.pyplot as plt
plt.switch_backend('TkAgg')
with open('VolturnUS-S_example.yaml', 'r', encoding='utf-8') as file:
design = yaml.load(file, Loader=yaml.FullLoader)
model = raft.Model(design)
model.analyzeUnloaded()
model.solveEigen()
model.solveDynamics()
model.calcMooringAndOffsets()
model.analyzeCases(display=1)
model.plotResponses()
model.plot()

plt.show()
it failed:
C:\Users\EENA\PycharmProjects\DNN.venv\Scripts\python.exe D:\RAFT-main\examples\test.py
Making FOWT
Mesh characteristic lengths: min=1.0, max=3.0
Traceback (most recent call last):
File "D:\RAFT-main\examples\test.py", line 10, in
model.solveDynamics()
TypeError: Model.solveDynamics() missing 1 required positional argument: 'case'
Found mean offets of FOWT 1 with surge = 0.40 m, sway = -0.00, and heave = 0.04 m
roll = -0.00 deg, pitch = -1.36 deg, and yaw = -0.00 deg
Could you please tell my how to run dynamic analysis?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions