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

Compute eigenspectrum of linearized Navier-Stokes

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 4, 2020, 05:40
Default Compute eigenspectrum of linearized Navier-Stokes
  #1
New Member
 
Join Date: Sep 2020
Posts: 9
Rep Power: 6
AndreaCFD is on a distinguished road
Dear group members,

I would like to retrieve the matrix of coefficients of the linearized Navier-Stokes equations and possibly compute its eigenvectors and eigenvalues directly in OpenFOAM-v1912. Is it possible? Which are the input files/commands?

My application is a 2D-flow past a circular cylinder @ Re=100.

Thanks in advance.

AndreaCFD
AndreaCFD is offline   Reply With Quote

Old   September 5, 2020, 12:15
Default
  #2
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
If I unterstand your question correctly you want to do DMD.


You might want to take a look at the dynamic mode decomposition function object in OF-v2006:

https://www.openfoam.com/releases/op...processing.php
Bloerb is offline   Reply With Quote

Old   September 5, 2020, 12:58
Default
  #3
New Member
 
Join Date: Sep 2020
Posts: 9
Rep Power: 6
AndreaCFD is on a distinguished road
Thanks for answering Bloerb,

Actually I only want to calculate the eigenvalues/eigenvectors of the matrix of coefficients of the discretized Navier-Stokes. So I need a function that gets the matrix UEqn and computes the eigendecomposition. I will use them to reduce the dimensionality of the system similarly to DMD but with a different technique.

Best,

Andrea
AndreaCFD is offline   Reply With Quote

Old   September 5, 2020, 13:00
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
there is also a new dense-matrix eigen decomposition solver in v2006: EigenMatrix.
cfdonlineuser likes this.
HPE is offline   Reply With Quote

Old   September 9, 2020, 11:30
Default
  #5
New Member
 
Join Date: Sep 2020
Posts: 9
Rep Power: 6
AndreaCFD is on a distinguished road
Thanks for answering HPE,

Could you give me some further info on how to use it? Do I have to download the .C and .H files and recompile my OpenFoam? Which is the right folder to save them?

In case I have a matrix A, its eigenvecors are computed with the commands:
eigenvectors(A.EVecs()) and complexEigenvectors(A.complexEVecs())

Sorry for the stupid questions but I am a bit lost.

Best,

Andrea
AndreaCFD is offline   Reply With Quote

Old   September 9, 2020, 15:50
Default
  #6
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
No question is stupid!

Please search Test-EigenMatrix.C or EigenMatrix.H files for usage examples. They are extensive.

You dont need to download anything unless you compile/install OFv2006.

Im writing on my phone, if you cant find those files, let us know.
HPE is offline   Reply With Quote

Old   September 10, 2020, 10:57
Default
  #7
New Member
 
Join Date: Sep 2020
Posts: 9
Rep Power: 6
AndreaCFD is on a distinguished road
Quote:
Originally Posted by HPE View Post
No question is stupid!

Please search Test-EigenMatrix.C or EigenMatrix.H files for usage examples. They are extensive.

You dont need to download anything unless you compile/install OFv2006.

Im writing on my phone, if you cant find those files, let us know.
Dear HPE,

I installed the new version of OFv2006 and checked the references.

What I have understood is that EigenMatrix.C performs the eigendecomposition of a matrix of type SquareMatrix. The matrix of coefficients UEqn (the one I need to decompose) is of type fvmVectorMatrix, hence the compiler produces an error.

Is there a way to convert one type to the other? Namely reconstruct the sparse matrix from the dense one? Are there functions that directly perform the eigendecomposition on the dense matrix?

Thanks for answering,

Andrea
AndreaCFD is offline   Reply With Quote

Old   September 10, 2020, 17:11
Default
  #8
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

The type of UEqn is not any sort of matrix, but a system of algebraic system. Therefore, there is no eigen decomposition for it.

EigenMatrix works on only SquareMatrix type, which can be sparse or dense.

Last edited by HPE; September 11, 2020 at 03:52.
HPE is offline   Reply With Quote

Old   September 11, 2020, 02:53
Default
  #9
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 773
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Possibly this helps:

1/ Use ofgdb to print matrix to file. See https://openfoamwiki.net/images/1/18/GdbOF-Manual.pdf

2/ Read file into Matlab, Python, Julia, Octave, Scilab or what have you;

3/ Convert matrix from sparse to dense and use eigenvalue computations provided for dense matrices;

Above might work small meshes. For large meshes instead, you might want to revert to the interface to PETSc and use the SLEPc components of PETSc to compute eigenvalues.

OpenFoam-PETSc interface: https://develop.openfoam.com/modules/external-solver
dlahaye is offline   Reply With Quote

Old   March 18, 2022, 08:04
Default
  #10
New Member
 
SUN
Join Date: Feb 2022
Posts: 4
Rep Power: 4
mufeng is on a distinguished road
Quote:
Originally Posted by AndreaCFD View Post
Dear group members,

I would like to retrieve the matrix of coefficients of the linearized Navier-Stokes equations and possibly compute its eigenvectors and eigenvalues directly in OpenFOAM-v1912. Is it possible? Which are the input files/commands?

My application is a 2D-flow past a circular cylinder @ Re=100.

Thanks in advance.

AndreaCFD
Hi AndreaCFD. I have the similar question which is about to retrieve the matrix of coefficients of the linearized Navier-Stokes equations and possibly compute its eigenvectors and eigenvalues directly in OpenFOAM. Have you ever solved your question?
Would you like to share some experience on this issue?
mufeng is offline   Reply With Quote

Reply

Tags
eigenvalue solver, linearized cfd, navier stokes equations, openfoamv1912, vortex shedding openfoam


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
Convection Term in Linearized Navier Stokes Equations And901 OpenFOAM Running, Solving & CFD 1 October 23, 2014 02:33
Convective term in Linearized Navier Stokes Equations And901 OpenFOAM Programming & Development 0 October 22, 2014 11:00
how to compute the stokes number in Fluent Messi FLUENT 0 May 6, 2014 11:44
How to compute values of Navier Stokes terms mixer CFX 4 August 5, 2009 01:41
Newbie:Viscoelasticity and Navier stokes equation Rajil Saraswat Main CFD Forum 2 June 9, 2003 07:21


All times are GMT -4. The time now is 23:51.