
[Sponsors] 
May 7, 2010, 04:12 
Can OpenFOAM handle ThirdRank Tensor

#1 
Member

Sponsored Links
In the documentation for OpenFOAM the rank3 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 

Sponsored Links 
May 7, 2010, 21:00 

#2 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
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 Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

May 9, 2010, 01:06 

#3 
Member

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 d_i,j,k = d( rms(u_i*u_j) * rms(u_k*u_l) + rms(u_k*u_j) * rms(u_i*u_l) + rms(u_i*u_k) * rms(u_j*u_l) ) / dt Jinbiao 

May 9, 2010, 01:20 

#4 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
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 Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; May 9, 2010 at 12:27. 

May 9, 2010, 02:28 

#5 
Member

Alberto, tｈａｎｋ 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 

May 9, 2010, 02:36 

#6 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
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,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

May 9, 2010, 02:41 

#7 
Member

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 

May 9, 2010, 09:03 

#8 
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 392
Rep Power: 17 
27 components... Hmm.. That doesn't exist as yet, but I don't see why not. You'd have to write your own rank3 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. 

May 9, 2010, 12:27 

#9 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
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,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

May 9, 2010, 20:47 

#10 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28 
Some additional hints that might help you to carry your 27 equations without writing too much spaghetti code
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++) { myScalarEquations.set ( i, new fvScalarMatrix ( // Put the terms of your equation here, as usual ) ); } Code:
for (int i = 0; i < nScalars; i++) { myScalarEquations[i].relax(); // you can put a label inside relax to use always the same URF } Code:
for (int i = 0; i < nScalars; i++) { myScalarEquations[i].solve(); // you can put a label inside solve to specify the linear solver only once in fvSolution (see pimpleFoam to see how this is done). } I hope this helps (and it doesn't confuse you more than what I did before ). Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; May 9, 2010 at 20:50. Reason: Added explanation 

May 9, 2010, 21:31 

#11 
Member

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. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
tensor rank 3  OFU  OpenFOAM  0  November 18, 2009 05:10 
Modified OpenFOAM Forum Structure and New MailingList  pete  Site News & Announcements  0  June 29, 2009 05:56 
64bitrhel5 OF installation instructions  mirko  OpenFOAM Installation  2  August 12, 2008 18:07 
Adventure of fisrst openfoam installation on Ubuntu 710  jussi  OpenFOAM Installation  0  April 24, 2008 14:25 
Tensor Rank  Oliver  Main CFD Forum  3  August 12, 1998 14:48 
Sponsored Links 