Skip to content
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

New data model for dofs #215

Open
mancellin opened this issue Sep 27, 2022 · 5 comments
Open

New data model for dofs #215

mancellin opened this issue Sep 27, 2022 · 5 comments

Comments

@mancellin
Copy link
Collaborator

Currently, degrees of freedom are stored as an array of shape (nb_faces, 3) that stores the displacement at each center of panel.

This issue is about the addition of a proper Dof class to Capytaine.
In its simplest form, it would just wrap the array of displacements:

body.dofs["my_roll"] = cpt.Dof([[0, z, -y] for (x, y, z) in body.mesh.faces_centers])

Optionnally, it could also store the gradient of that displacement field, as a (nb_faces, 3, 3) array.

body.dofs["my_roll"] = cpt.Dof(
    [[0, z, -y] for (x, y, z) in body.mesh.faces_centers],
    gradient=[[[0, 0, 0], [0, 0, 1], [0, -1, 0]] for _ in body.mesh.faces]
)

This gradient would be useful (at least) for hydrostatics and forward speed.

Finally, special subclasses could be created for rigid body dofs.

body.dofs["my_roll"] = cpt.RollDof(rotation_center=(0.0, 1.0, 0.0))

I'm still not sure if it would really be necessary.
Maybe just encoding rigid body dofs as regular dofs with a known gradient would be sufficient.
For instance, the inaccuracy of the generic formula for hydrostatic stiffness (issue #188) would be solved for rigid body dofs only with the definition of the gradient of the dof.

@mancellin
Copy link
Collaborator Author

For instance, the inaccuracy of the generic formula for hydrostatic stiffness (issue #188) would be solved for rigid body dofs only with the definition of the gradient of the dof.

Actually I'm not sure about this statement anymore.
For rotation dofs, such as roll $(0, z, -y)$ in the example above, the divergence would be zero, so we would not recover the exact rigid body hydrostatic stiffness.
@ckesanapalli Do you remember from your research what would be required to recover the exact rigid body hydrostatic stiffness from the generic formula?

@ckesanapalli
Copy link
Contributor

ckesanapalli commented Nov 8, 2022

@ckesanapalli Do you remember from your research what would be required to recover the exact rigid body hydrostatic stiffness from the generic formula?

For my research, I used a single body with 6 rigid DOFs and 8 elastic DOFs.
For hydrostatic stiffness, I referred the WAMIT MANUAL.
For the rigid DOFs, I used the formulae given in WAMIT MANUAL. pg. 3-3.
For the elastic DOFs, I used the formulae given in WAMIT MANUAL. pg. 9-9.
In my case, I have no divergence for all DOFs.

@mancellin
Copy link
Collaborator Author

I've read the paper [Riggs 2009] and I now more clearly understand the issue.
So there are several generic expressions for hydrostatic stiffness:

  • the simplest one, the only one that can be automatically computed with the current dof data model:
    $$K_{ij} = - \rho g \int_S u^i_3 (u^j \cdot n) dS $$

  • the one from [Newman 1994] and WAMIT manual, that could be enabled with the data model proposed above in this thread:
    $$K_{ij} = - \rho g \int_S \left( u^i_3 + x_3 \mathrm{div}u^i \right) (u^j \cdot n) dS $$

Both are incomplete, in the sense that they do not recover the known exact values for rigid body dofs. Riggs gives examples of formula that are complete, such as:

$$ K_{ij} = - \rho g \int_S \left( u^i_3 + x_3 \mathrm{div}u^i \right) (u^j \cdot n) dS + \rho g \int_S x_3 \left( u^i \cdot \frac{\partial u^j}{\partial n} \right) dS + \int_\Omega \mathrm{tr} \left( \left(\frac{\partial u^i}{\partial x}\right)^T \sigma \frac{\partial u^j}{\partial x} \right) d\Omega $$

where $\sigma$ is the structural stress at equilibrium. While the first two terms could be computed by Capytaine, the volumic integral in the last term is problematic. Computing a volumic integral would require a discretization of the volume of the interior of the body and a definition of the motion/deformation field on this discretization.

The Graal would be a generic formula that (a) involves only surfacic integrals and (b) degenerate to the exact value for rigid body dofs. Until we find one, I guess it is simpler to keep special case expressions for rigid body dofs.

@ckesanapalli
Copy link
Contributor

I did tried to find a general equation for all DOFs. But the alternative equations are either complicated or have conditional assignment.

@mancellin
Copy link
Collaborator Author

Removing the v1.5 milestone as it won't be ready on time for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants