CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

eigenVectors ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By fcollonv

Reply
 
LinkBack Thread Tools Display Modes
Old   March 21, 2011, 09:11
Post eigenVectors ?
  #1
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Hi Foamers,
what is the exact function in openFoam to get the eigenVectors of a volsymmTensorField A ? If it will return a tensor , then how are the vectors aligned, they will be as rows or as columns in the tensor?

thanks


T.D.
T.D. is offline   Reply With Quote

Old   March 21, 2011, 10:40
Default
  #2
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 8
fcollonv is on a distinguished road
Hello,

The function is really easy:
eigenVectors(A) should work
And it will return in your case a volTensorField T

For each cell i, the first eigen vector is T.internalField()[i].x(), the second T.internalField()[i].y() and the third T.internalField()[i].z()

But to answer directly they are store by line
so the first one is composed of xx, xy and xz.

In the code they use the constructor line 67 there:
http://foam.sourceforge.net/docs/cpp..._8H_source.php


Best regards,

Fred
Tushar@cfd likes this.
__________________
Frederic Collonval
Technische Universität München
Thermodynamics Dpt.
fcollonv is offline   Reply With Quote

Old   March 21, 2011, 11:06
Default
  #3
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Hi,
i am trying to get eigenVectors of the strain rate tensor E, so i tried

volTensorField Gr=fvc::grad(U);
volSymmTensorField E = symm(Gr);

volTensorField T=eigenVectors(E);

and it didn't work !!!! i get this error:

Quote:
talib@jml-port:~/Desktop/talib/applications/solvers/incompressible/TalibicoFoam2DframeInvariant$ wmake
Making dependency list for source file TalibicoFoam2DframeInvariant.C
SOURCE=TalibicoFoam2DframeInvariant.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/TalibicoFoam2DframeInvariant.o
TalibicoFoam2DframeInvariant.C: In function ‘int main(int, char**)’:
TalibicoFoam2DframeInvariant.C:65: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::SymmTensor<d ouble>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::volTensorField’ requested
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
In file included from /opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.H:87,
from /opt/openfoam171/src/OpenFOAM/lnInclude/GeometricFields.H:36,
from /opt/openfoam171/src/finiteVolume/lnInclude/volFields.H:37,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:30,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:235,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
from /opt/openfoam171/src/finiteVolume/lnInclude/fvc.H:39,
from /opt/openfoam171/src/finiteVolume/lnInclude/fvCFD.H:8,
from TalibicoFoam2DframeInvariant.C:32:
/opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C: In function ‘void Foam::eigenVectors(Foam::GeometricField<Foam::Symm Tensor<double>, PatchField, GeoMesh>&, const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’:
/opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C:53: instantiated from ‘Foam::tmp<Foam::GeometricField<Foam::SymmTensor<d ouble>, PatchField, GeoMesh> > Foam::eigenVectors(const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’
TalibicoFoam2DframeInvariant.C:65: instantiated from here
/opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C:53: error: no matching function for call to ‘eigenVectors(Foam::Field<Foam::SymmTensor<do uble> >&, const Foam::Field<Foam::SymmTensor<double> >&)’
/opt/openfoam171/src/OpenFOAM/lnInclude/tensor.H:55: note: candidates are: Foam::tensor Foam::eigenVectors(const Foam::tensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensor.H:59: note: Foam::tensor Foam::eigenVectors(const Foam::symmTensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: void Foam::eigenVectors(Foam::Field<Foam::Tensor<double > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: void Foam::eigenVectors(Foam::Field<Foam::Tensor<double > >&, const Foam::UList<Foam::SymmTensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::UList<Foam::SymmTensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::tmp<Foam::Field<Foam::SymmTensor<double> > >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/dimensionedTensor.H:65: note: Foam::dimensionedTensor Foam::eigenVectors(const Foam::dimensionedTensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/dimensionedTensor.H:68: note: Foam::dimensionedTensor Foam::eigenVectors(const Foam::dimensionedSymmTensor&)
In file included from /opt/openfoam171/src/OpenFOAM/lnInclude/tensorFieldField.H:86,
from /opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C:27,
from /opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.H:87,
from /opt/openfoam171/src/OpenFOAM/lnInclude/GeometricFields.H:36,
from /opt/openfoam171/src/finiteVolume/lnInclude/volFields.H:37,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:30,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:235,
from /opt/openfoam171/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
from /opt/openfoam171/src/finiteVolume/lnInclude/fvc.H:39,
from /opt/openfoam171/src/finiteVolume/lnInclude/fvCFD.H:8,
from TalibicoFoam2DframeInvariant.C:32:
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorFieldField.C: In function ‘void Foam::eigenVectors(Foam::FieldField<Field, Foam::SymmTensor<double> >&, const Foam::FieldField<Field, Foam::SymmTensor<double> >&) [with Field = Foam::fvPatchField]’:
/opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C:53: instantiated from ‘void Foam::eigenVectors(Foam::GeometricField<Foam::Symm Tensor<double>, PatchField, GeoMesh>&, const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’
/opt/openfoam171/src/OpenFOAM/lnInclude/GeometricTensorField.C:53: instantiated from ‘Foam::tmp<Foam::GeometricField<Foam::SymmTensor<d ouble>, PatchField, GeoMesh> > Foam::eigenVectors(const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’
TalibicoFoam2DframeInvariant.C:65: instantiated from here
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorFieldField.C:55: error: no matching function for call to ‘eigenVectors(Foam::fvPatchField<Foam::SymmTensor< double> >&, const Foam::fvPatchField<Foam::SymmTensor<double> >&)’
/opt/openfoam171/src/OpenFOAM/lnInclude/tensor.H:55: note: candidates are: Foam::tensor Foam::eigenVectors(const Foam::tensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensor.H:59: note: Foam::tensor Foam::eigenVectors(const Foam::symmTensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: void Foam::eigenVectors(Foam::Field<Foam::Tensor<double > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: void Foam::eigenVectors(Foam::Field<Foam::Tensor<double > >&, const Foam::UList<Foam::SymmTensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::UList<Foam::SymmTensor<double> >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/tensorField.H:70: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::eigenVectors(const Foam::tmp<Foam::Field<Foam::SymmTensor<double> > >&)
/opt/openfoam171/src/OpenFOAM/lnInclude/dimensionedTensor.H:65: note: Foam::dimensionedTensor Foam::eigenVectors(const Foam::dimensionedTensor&)
/opt/openfoam171/src/OpenFOAM/lnInclude/dimensionedTensor.H:68: note: Foam::dimensionedTensor Foam::eigenVectors(const Foam::dimensionedSymmTensor&)
make: *** [Make/linuxGccDPOpt/TalibicoFoam2DframeInvariant.o] Error 1
i also tried volSymmTensorField T=eigenVectors(E); but it also didn't work !!
Any ideas ????
T.D. is offline   Reply With Quote

Old   March 21, 2011, 13:19
Default
  #4
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 8
fcollonv is on a distinguished road
Hello T.D.,

my fault, eigenVectors is implemented only with volTensorField as input parameter not with volSymmTensorField.

So you will have to convert your E in a volTensorField. Hopefully a trick like tensor(1, 0, 0, 0, 1, 0, 0, 0, 1)*E will do the trick...

Good luck,

Frederic
__________________
Frederic Collonval
Technische Universität München
Thermodynamics Dpt.
fcollonv is offline   Reply With Quote

Old   March 22, 2011, 04:37
Default
  #5
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Hi
it didn't work as you said, i think it seems that eigenVectors() function does not accept a tensor with dimensions, any idea how to take only the values of the dimensioned volSymmTensorField "E" and put them in another dimensionless volTensorField (for example "E2" ) ???

thanks a lot

yours,

T.D.

Last edited by T.D.; March 22, 2011 at 04:51. Reason: forgot something need to be changed
T.D. is offline   Reply With Quote

Old   March 23, 2011, 03:24
Default
  #6
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 8
kathrin_kissling is on a distinguished road
Hi it should work for a dimensionedTensor, since its implemented in the dimensionedTensor class. Probably it does not work on the boundaries... Try to work only on the internal field.

dimensionedTensorField myTensorFieldOfTheInternal = myVolTensorFieldWhatIHave.internal();
dimensionedTensorField myDesiredEigenvectors = eigenVectors(myTensorFieldOfTheInternal);

Then you give it back as

volTensorField myEigenVectors
(
IOobject
(
"myEigenVectors",
myVolTensorFieldWhatIHave.time().timeName(),
myVolTensorFieldWhatIHave.mesh(),
IOobject::NO_READ
),
myVolTensorFieldWhatIHave.mesh(),
dimensionedTensor::zero
);

myEigenVectors.internal() = myDesiredEigenvectors;


If you need the values on the boundary, maybe you have to loop over those and do the same.
Hope this helps

Kathrin

Last edited by kathrin_kissling; March 23, 2011 at 03:29. Reason: Formating screwed up
kathrin_kissling is offline   Reply With Quote

Old   March 23, 2011, 04:59
Default
  #7
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Hi,
thanks a lot for your anwser, but i tried this inside the time loop:

volTensorField Gr=fvc::grad(U);
volSymmTensorField E = symm(Gr);

Srate.component(0)=E.component(0);
Srate.component(1)=E.component(1);
Srate.component(2)=E.component(2);
Srate.component(3)=E.component(3);
Srate.component(4)=E.component(4);
Srate.component(5)=E.component(5);
Srate.component(6)=E.component(6);
Srate.component(7)=E.component(7);
Srate.component(8)=E.component(8);

volTensorField Ei=eigenVectors(Srate);

and it compiles well. What i need to know now, is it OK like this for filling all Srate components ? however E is symmetric tensor but Srate is not;

RK: ----inside .H file, Srate defined as:
volTensorField Srate
(
IOobject
(
"Srate",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh
);
---------------------------------------------------------------------


yours,
T.D.
T.D. is offline   Reply With Quote

Old   October 21, 2013, 02:47
Default
  #8
New Member
 
Ripudaman Manchanda
Join Date: May 2013
Posts: 29
Rep Power: 4
ripudaman is on a distinguished road
I tried the above recommendations to obtain the eigenVectors but I get a NO_READ error. Also, can anyone on this forum tell me how to obtain the eigenvectors as three different vectors instead of a tensor so that I can easily plot the individual vectors as arrows.
ripudaman is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
EigenVectors and volSymmTensorField shane5ul OpenFOAM 0 November 25, 2009 12:23
Eigenvectors and solution to sparse linear system. mr_fluent Main CFD Forum 0 August 6, 2009 21:13
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


All times are GMT -4. The time now is 06:34.