Skip to content

Differentiable boundary element simulations for design and optimization of offshore structures

License

Notifications You must be signed in to change notification settings

symbiotic-engineering/MarineHydro.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test Status GitHub

Fully Differentiable Boundary Element Solver for Hydrodynamic Sensitivity Analysis of Wave-Structure Interactions

Authors

Kapil Khanala,b, Carlos A. Michelén Ströferb, Matthieu Ancellinc, Maha Hajia

Affiliations

  • aCornell University
    Ithaca, NY 14850, USA
  • bSandia National Laboratories
    Albuquerque, NM 87123, USA
  • cEurobios Mews Labs
    Paris, France

🌟 Research Highlights

  • 📚 Derivation and discussion of the discrete adjoint method for the boundary integral equations.
  • 💻 Review and implementation of a differentiable boundary element solver for marine hydrodynamics in Julia.
  • 🌊 Exact gradient calculation for a pair of floating hemispheres with respect to their dimensions, separation distance, and wave environment.
  • Mechanical power optimization for a pair of wave energy converters using exact gradients.

Fully-differentiable boundary element solver for marine hydrodynamics. This new solver implements both direct and indirect boundary element formulations and uses two green's function expression, Wu et al, and Delhommeau's varying in their accuracy and speed. image

⚠️ Note: This package is work in progress 🚧 and a separate public release of the package will be done in the future. This current state of the package contains necessary code to replicate the paper 📄. It will go through a significant change in its API for users in future iterations.

Repository: MarineHydro.jl

📂 Folder Structure

  • 📁 .github/workflows
    Contains workflow files for automated tasks, such as continuous integration (CI).

  • 📊 paper
    Includes plots and data generated for the paper.

  • 📜 src
    Source code files for the BEM.jl package, including the main functionality.

  • 🧪 test
    Contains test files and resources to verify the functionality of the source code.


🚀 How to Run the Code

  1. Install Julia
    Ensure you have Julia installed on your system. You can download it from the JuliaLang website.

  2. Clone the Repository
    Open a terminal and run:

    git clone https://github.com/symbiotic-engineering/MarineHydro.jl.git
    cd MarineHydro.jl
    
    
  3. Install Dependencies
    Start Julia from the terminal in the project directory and run the following:

    using Pkg
    Pkg.activate(".")
    Pkg.instantiate()

    You may need to configure PyCall. Note: Running tests/ automatically install capytaine and uses it.

  4. Configure PyCall

    ENV["PYTHON"] = "/path/to/capytaine_env/bin/python" # run 'which python' in your terminal for this
    
  5. Using the BEM Module
    Load the module in your Julia session:

using BEM
using PyCall
# import your capytaine mesh
cpt = pyimport("capytaine")
radius = 1.0 #fixed
resolution = (10, 10)
cptmesh = cpt.mesh_sphere(name="sphere", radius=radius, center=(0, 0, 0), resolution=resolution) 
cptmesh.keep_immersed_part(inplace=true)

# declare it Julia mesh
mesh = Mesh(cptmesh)  
ω = 1.03
ζ = [0,0,1] # HEAVE: will be more verbose in future iteration. define it again even if defined in Capytaine.
F = DiffractionForce(mesh,ω,ζ)
A,B = calculate_radiation_forces(mesh,ζ,ω)
  1. Differentiability : For differentiability with respect to mesh dimension, use paper/MeshGradients_singlebody.jl Differentiability needs an AD engine: use Zygote
using Zygote
A_w_grad, = Zygote.gradient(w -> calculate_radiation_forces(mesh,ζ,w)[1],ω)

About

Differentiable boundary element simulations for design and optimization of offshore structures

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages