|
[Sponsors] |
February 19, 2020, 02:55 |
Eigenvectors of a volFieldTensor
|
#1 |
New Member
Nazario Mastroianni
Join Date: Feb 2020
Posts: 3
Rep Power: 6 |
Hello FOAMers,
I am new to OpenFOAM and not very experienced with C++ so my questions might be very trivial for many/most of you. However, I have not been able to find an exhaustive answer, so... I need to compute the eigenvectors of a volTensorField E. eigenVectors(E) returns a volTensorField, but how can I get each individual eigenvector? From what I have read, they should be defined in the internalField, as lines, but I haven't been able to get them. From what I understand, there is no direct way of extracting a vector from a tensor, so I thought I could compute the eigenvalues first and then the corresponding eigenvector for each eigenvalue. However, I'm facing the same issue when I use eigenValues(E) (a volVectorField): for some reason, I am not able to extract each individual eigenvalue. Can anyone explain to me how to do? Thanks in advance, N. |
|
February 19, 2020, 17:22 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
You can access a tensor within volTensorField by using square brackets, e.g.
const auto eVecs = eigenVectors(E); const auto eVec = eVecs[0]; // first element within the list. Hope didnt misunderstand your question.
__________________
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 |
|
February 19, 2020, 18:10 |
|
#3 | |
New Member
Nazario Mastroianni
Join Date: Feb 2020
Posts: 3
Rep Power: 6 |
Quote:
I have come up with a workaround, calculating the eigenvalues first and then the corresponding eigenvector for each eigenvalue. However I can only obtain the values in the internalField in this way (because I use forAll cellI). I would need my eigenvectors to be defined over the entire domain, boundary included. Do you have any other solution? |
||
February 19, 2020, 22:00 |
|
#4 |
New Member
Nazario Mastroianni
Join Date: Feb 2020
Posts: 3
Rep Power: 6 |
Update:
It is sufficient to multiply eigenVectors(T) by a vector vx(1,0,0) to extract the first eigenvector (first row of eigenVectors(T)), and similarly for the other two. Last edited by NazarioM; February 20, 2020 at 06:10. |
|
February 20, 2020, 11:39 |
|
#5 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
Could you please share a bit of code, otherwise difficult to follow what needs to be done?
__________________
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 |
Normalization of eigenvectors of the Euler equations | bubble45 | Main CFD Forum | 9 | March 16, 2015 17:09 |
Eigenvalues and eigenvectors? | Vino | Main CFD Forum | 2 | August 16, 2014 22:18 |
Texts for eigenvalues, eigenvectors & pde's | diaw (Des Aubery) | Main CFD Forum | 24 | April 24, 2006 11:32 |
Eigenvalues and Eigenvectors for 3-D TVD Finite Volume Solver | Axel Rohde | Main CFD Forum | 3 | April 2, 2000 17:42 |
Eigenvalues & Eigenvectors in General Geometries for 3-D TVD Solver | Axel Rohde | Main CFD Forum | 3 | October 6, 1999 14:48 |