|
[Sponsors] |
June 21, 2020, 05:50 |
Implementing fourth order tensor?
|
#1 |
New Member
Matias Haapalehto
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
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 |
|
June 21, 2020, 06:12 |
|
#2 |
Senior Member
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16 |
That would be a bad idea. You just need to create a struct: follow the definition of the Tensor class
|
|
June 21, 2020, 06:44 |
|
#3 |
New Member
Matias Haapalehto
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
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 |
|
June 21, 2020, 13:41 |
|
#4 | |
Senior Member
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16 |
Quote:
Code:
(...) /* TENSOR 2nd rank*/ template<class Cmpt> class Tensor : public VectorSpace<Tensor<Cmpt>, Cmpt, 9> { (...) |
||
June 21, 2020, 17:58 |
|
#5 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
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.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Divergence of third order tensor | maka | OpenFOAM Post-Processing | 1 | July 4, 2024 15:30 |
Solving a fourth order PDE | debanik1 | Main CFD Forum | 4 | November 9, 2016 18:39 |
Help for fourth order accurate convective schemes | Z.C.Wang | Main CFD Forum | 0 | January 15, 2009 07:53 |
Fourth order surface normal gradient interpolation | adona058 | OpenFOAM Running, Solving & CFD | 8 | September 24, 2007 16:12 |
2nd order Tensor Divergence Mistake in Programmerbs Guide | vvqf | OpenFOAM | 3 | December 2, 2005 05:53 |