CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Implementing fourth order tensor?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2020, 04:50
Default Implementing fourth order tensor?
  #1
New Member
 
Matias Haapalehto
Join Date: Jun 2020
Posts: 3
Rep Power: 5
haapalm is on a distinguished road
Hi,

I need to implement the following equation (attached) which involves a fourth order tensor. As far as I know these are not readily available in OpenFOAM.

What would be the best way to go about implementing a fourth order tensor and the corresponding operations in OpenFOAM?

I have looked into this: https://math.stackexchange.com/a/3026704
would that mean that I would implement it as a 9-by-9 Foam::vector of Foam::vectors?

Thank you for your help!
Matias
Attached Images
File Type: jpg fourth_order.jpg (82.1 KB, 23 views)
haapalm is offline   Reply With Quote

Old   June 21, 2020, 05:12
Default
  #2
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
That would be a bad idea. You just need to create a struct: follow the definition of the Tensor class
Santiago is offline   Reply With Quote

Old   June 21, 2020, 05:44
Default
  #3
New Member
 
Matias Haapalehto
Join Date: Jun 2020
Posts: 3
Rep Power: 5
haapalm is on a distinguished road
Thank you for your answer. I am not sure what the struct would look like, would it simply contain 81 scalars?

As far as I see the tensor class inherits from the MatrixSpace class, would I need to do the same only with a 9-by-9 matrix?

Matias
haapalm is offline   Reply With Quote

Old   June 21, 2020, 12:41
Default
  #4
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
Quote:
Originally Posted by haapalm View Post
Thank you for your answer. I am not sure what the struct would look like, would it simply contain 81 scalars?

As far as I see the tensor class inherits from the MatrixSpace class, would I need to do the same only with a 9-by-9 matrix?

Matias
you can extend the VectorSpace class, in the same way Tensor does:

Code:
(...)
/* TENSOR 2nd rank*/
  template<class Cmpt>
  class Tensor
  :
      public VectorSpace<Tensor<Cmpt>, Cmpt, 9>
  {
(...)
Then implement all basic operations like transpose, inner-(outer) products, duals, etc....
Santiago is offline   Reply With Quote

Old   June 21, 2020, 16:58
Default
  #5
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

- I know arbitrary-order tensors and matrices are different in terms of their mathematical properties. But, is there any chance for you to designate your problem as a set of matrix operations, rather than tensor?
- If you can use matrices for your problem, I would use the class template: Matrix<Type> in OF.
HPE is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solving a fourth order PDE debanik1 Main CFD Forum 4 November 9, 2016 17:39
Help for fourth order accurate convective schemes Z.C.Wang Main CFD Forum 0 January 15, 2009 06:53
Fourth order surface normal gradient interpolation adona058 OpenFOAM Running, Solving & CFD 8 September 24, 2007 15:12
Divergence of third order tensor maka OpenFOAM Post-Processing 0 April 28, 2006 12:46
2nd order Tensor Divergence Mistake in Programmerbs Guide vvqf OpenFOAM 3 December 2, 2005 04:53


All times are GMT -4. The time now is 00:37.