CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Bug in the programmer's guide: divergence of a tensor field (http://www.cfd-online.com/Forums/openfoam-bugs/104867-bug-programmers-guide-divergence-tensor-field.html)

 sebastian July 17, 2012 11:01

Bug in the programmer's guide: divergence of a tensor field

Hi everybody!

I wonder if there is a bug in the programmer's guide of OpenFOAM.

In chapter 2.1.2 the divergence of a tensor field is given as

In my opinion this is wrong. After the convention in chapter 1.3.1 (inner product) it should be instead

Can anybody confirm that or do I make something wrong here?
How is the implementation, does anybody know?

Sebastian

 l_r_mcglashan July 17, 2012 14:54

It depends on if you multiply a row vector by a tensor or a tensor by a column vector. We want the tensor to act on the vector. What you've written should be:

 sebastian July 17, 2012 15:35

Dear Laurence, thanks for your post.

When I look up for the definition of the divergence of a tensor field, on wikipedia for instance this is

This does not agree with the programmer's guide. Why should it be different in OpenFOAM?

Sebastian

 l_r_mcglashan July 17, 2012 17:15

The programmer's guide is not maintained anymore.

 sebastian July 18, 2012 02:38

I am not talking about if it's a i, j or k.

The programmer's guide is obviously wrong.

 l_r_mcglashan July 18, 2012 05:53

Ah, sorry! Yes, the programmer's guide is incorrect.

 hhouston January 18, 2013 23:03

error in wikipedia

Hey, the following eq from wikipedia posted higher up in this thread has a typo:

"When I look up for the definition of the divergence of a tensor field, on wikipedia for instance this is
http://www.cfd-online.com/Forums/vbL...3f1e0b73-1.gif "
and further it is not consistent with the other parts of this thread - it should be Tik not Tki .

Also there are some typos in the matrices you put up, but they are not too hard to figure out. And the overall thrust of the thread is correct.

 hhouston January 18, 2013 23:05

 wyldckat September 7, 2013 06:09

FYI: I've consolidated this information here: http://openfoamwiki.net/index.php/Op...s_Guide_Errata

Feel free to add to this wiki page.

By the way, the issue reported on this thread has already been fixed on the Programmer's Guide since OpenFOAM 2.2.0, at least from what I could find.

 gustavorp June 9, 2016 14:21

2 Attachment(s)
I found several books and papers about tensors. Most of them are showing this:

Attachment 48139

and

Attachment 48140

I have implemented an algorithm in python to compute the tensor divergence to a 3d tensor field.

I am not sure if my implementation is correct. Does any one have some tensor field and its divergence to compare?

It could be a .txt, .mat, .py, etc.

Thank you

 All times are GMT -4. The time now is 16:21.