Can OpenFOAM handle Third-Rank Tensor
Hi Foamers,
In the documentation for OpenFOAM the rank-3 tensor is mention. But I can't find a corresponding class in the OpenFOAM code. And there seems rare information on this forum. Anyone have an idea where to find it? Or there is no class like that in the OF. Thanks in advance. Jinbiao |
What do you have to do? Solve a transport equation for a 3x3 matrix as unknown? Manipulate tensors?
OpenFOAM can do that with fvTensorMatrix and volTensorField / surfaceTensorField. If you provide some more detail, we can answer better ;-) Best, |
Alberto, thanks for your reply.
I am implementing a second moment closure for reynolds stress. Here I have to solve equations for a symmetric third rank tensor, u_i*u_j*u_k. The highest rank of tensor involved is rank 4. For a better understanding, I provide the major equations below rms = root mean square Code:
D(u_i*u_j*u_k)/Dt = P_i,j,k + phi_i,j,k + d_i,j,k + eps_i,j,k Jinbiao |
A transport equation for a symmetric tensor can be solved using fvSymmTensorMatrix, while for asymmetric tensors you have to use fvTensorMatrix.
If you have higher rank matrices, you have to deal with them independently (you can either use scalar equations for each component (easier and faster to do), or extend fvMatrix (more complicated)). P.S. You can take a look at the implementation of Reynolds stress models too. Best, |
Alberto, thank you so much for the encouraging message.
Actually I am solving a matrix for symmetric rank 3 tensor. I am trapped at the beginning because I can not find a class for rank 3 tensor. Do you know where to find it or I have to write this into OpenFOAM by myself? Thanks again. Regards. Jinbiao |
For symmetric tensors (not field):
http://foam.sourceforge.net/doc/Doxy...ymmTensor.html For symmetric tensor fields: http://foam.sourceforge.net/doc/Doxy...nsorField.html Best, |
Sorry, I am still confused about this.
These two classes are for rank 2 tensors. The components and operators of rank 3 tensor is different from provided by them. How can I relate them together? Thanks again. Jinbiao |
27 components... Hmm.. That doesn't exist as yet, but I don't see why not. You'd have to write your own rank-3 tensor class, but although the extension process is straightforward, writing all that code is not. Taking its gradient, for instance, would be quite a laborious process indeed.
I guess you would still have to solve such a system in the conventional segregated sense (one component at a time). Hopefully, there's some way in which you can manipulate your equations to reduce the rank. |
Sorry for the confusion. I should stop answering late... ;-)
As Sandeep said, there is no implementation of rank > 2 tensors in OpenFOAM. Simply use scalar transport equations, maybe collected in a list to have a cleaner code. Best, |
Some additional hints that might help you to carry your 27 equations without writing too much spaghetti code :D
You can collect equations in a PtrList defined as Code:
PtrList<fvScalarMatrix> myScalarEquations(nScalars); To set your equations you can loop for i = 0 to i < nScalars, adding each scalar equation to the PtrList as follows: Code:
for (int i = 0; i < nScalars; i++) Code:
for (int i = 0; i < nScalars; i++) Code:
for (int i = 0; i < nScalars; i++) I hope this helps (and it doesn't confuse you more than what I did before :(). Best, |
Alberto and Sandeep, Thanks a lot.
Now I have the direction to solve my problem. I will post it here, if I have further questions. Many thanks again. By the way, spaghetti tastes very good. :p |
All times are GMT -4. The time now is 13:59. |