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

Tensor divergence seems to be wrong #289

Open
nicoguaro opened this issue Oct 25, 2021 · 0 comments
Open

Tensor divergence seems to be wrong #289

nicoguaro opened this issue Oct 25, 2021 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nicoguaro
Copy link
Owner

  • Continuum Mechanics version: 0.2.2
  • Python version: 3.7.10

Description

The divergence of the stress tensor is not 0 while the Navier-Cauchy operator is zero for the displacement vector.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

from sympy import *
from continuum_mechanics.vector import div_tensor
from continuum_mechanics.solids import navier_cauchy

r, theta, phi = symbols("r theta phi")
T, mu = symbols("T mu")

h = (1, r, r*sin(theta))
coords = (r, theta, phi)
disp = Matrix([[0], [0], [T*sin(theta)/(8*pi*mu*r**2)]])
stress = Matrix([[0, 0, -3*T*sin(theta)/(8*pi*r**3)], [0, 0, 0], [-3*T*sin(theta)/(8*pi*r**3), 0, 0]])

And

navier_cauchy(disp, [1, mu], coords, h)

gives Matrix([[0], [0], [0]]), while

div_tensor(stress, coords, h)

gives Matrix([[0], [0], [3*T*sin(theta)/(8*pi*r**4)]]).

@nicoguaro nicoguaro added the bug Something isn't working label Oct 25, 2021
@nicoguaro nicoguaro added this to the 0.2.3 milestone Oct 25, 2021
@nicoguaro nicoguaro self-assigned this Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant