-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wind #50
Wind #50
Conversation
Addition of wind force term.
Addition of wind force terms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good code!! Thank you for your contributes.
In the viewpoint of minimum required functional modeling of MMG simulation, please modify your code as my review.
- Use
Mmg3DofWindForceMomentParams
instead ofMmg3DofStructureParams
and organize where params are placed.
# Arguments | ||
- `A_OD::T` | ||
- `A_F::T` | ||
- `A_L::T` | ||
- `H_BR::T` | ||
- `H_C::T` | ||
- `C::T` | ||
""" | ||
@with_kw mutable struct Mmg3DofStructureParams{T} | ||
A_OD::T | ||
A_F::T | ||
A_L::T | ||
H_BR::T | ||
H_C::T | ||
C::T | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various parameters need to be divided into the parameters needed for the simulation and the information to define them.
From your PR, I think that the following struct should be defined as essential information for MMG simulation.
@with_kw mutable struct Mmg3DofWindForceMomentParams{T}
A_F::T
A_L::T
C_X_wind::T
C_Y_wind::T
C_N_wind::T
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comments!
It seems difficult to change Mmg3DofStructureParams
toMmg3DofWindForceMomentParams
, because C_X_wind
,C_Y_wind
,C_N_wind
are calculated sequentially using Mmg3DofStructureParams
in mag_3dof_model!
.
We need to have a discussion about this.
OK. I will show the example implementation of using |
@hinata235 Following command shows the example for running test code. julia > ] # package mode
(@v1.9) pkg> activate .
(ShipMMG) test |
@taiga4112 Julia> versioninfo() |
I am not interested in your PC's execution environment. Anyhow, I cannot find the mmg.jl KVLCC2_L7 turning: Error During Test at /home/mitsuyuki/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/test/test_mmg.jl:3
Got exception outside of a @test
MethodError: no method matching mmg_3dof_simulate(::Mmg3DofBasicParams{Float64}, ::Mmg3DofManeuveringParams{Float64}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, ::Vector{Float64}, ::Vector{Float64}, ::Vector{Float64}, ::Float64; u0::Float64, v0::Float64, r0::Float64)
Closest candidates are:
mmg_3dof_simulate(::Mmg3DofBasicParams, ::Mmg3DofManeuveringParams, ::Mmg3DofStructureParams, ::Any, ::Any, ::Any, ::Any, ::Any; u0, v0, r0, x0, y0, ψ0, ρ, algorithm, reltol, abstol)
@ ShipMMG ~/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/src/mmg.jl:543
Stacktrace:
[1] macro expansion
@ ~/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/test/test_mmg.jl:16 [inlined]
[2] macro expansion
@ /opt/julias/julia-1.9.2/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[3] top-level scope
@ ~/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/test/test_mmg.jl:5
[4] include(fname::String)
@ Base.MainInclude ./client.jl:478
[5] macro expansion
@ ~/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/test/runtests.jl:9 [inlined]
[6] macro expansion
@ /opt/julias/julia-1.9.2/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[7] top-level scope
@ ~/Dropbox/workspace/dev-ShipMMG/ShipMMG.jl/test/runtests.jl:7
[8] include(fname::String)
@ Base.MainInclude ./client.jl:478
[9] top-level scope
@ none:6
[10] eval
@ ./boot.jl:370 [inlined]
[11] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:280
[12] _start()
@ Base ./client.jl:522 Why can your test code run without error? It's quite strange for me... |
@taiga4112 |
@hinata235 Following command is to run the test code of this repository. |
@hinata235 Please check it. |
@hinata235 The point of this PR is to separate between the definition of core parameters for calculating wind force & moment and the estimation method of this core parameters. |
MMG model is changed to take wind force into account.
data.jl
get_structure_params
mmg.jl
wind_force_and_moment_ coefficients
to calculate wind force and moments coefficients based on Fujiwara's formula (https://www.jstage.jst.go.jp/article/jjasnaoe/2/0/2_0_243/_article/-char/ja/).u_wind_list
,ψ_wind_list
to the arguments of existing functions.ShipMMG.jl
test_mmg.jl
Other changes