Hydrodynamic Stability Implementation in FreeFEM

I am trying to carry out 3-D hydrodynamic stability analysis of 2-dimensional lid-driven square cavity flow at Re = 200.

I have calculated the 2-dimensional base flow at Re=200 and validated the base flow results with existing literature.

I would like to calculate the eigenvalues for the above-mentioned problem. I am not able to implement the stability analysis calculation in FreeFem.

There is a hydrodynamic stability problem implemented in ‘SLEPc-complex’ avaiable in FreeFem website.

I would like to implement my hydrodynamic stability code without any packages like SLEPc and PETSc. I am not able to find enough guidelines on implementation of hydrodynamic stability problem in FreeFem.

I would be extremely grateful if you please guide me on the implementation of hydrodynamic stability problem in FreeFem.

Looking forward to your kind reply. Thanks in advance.

Why not use SLEPc? You are free to reinvent the wheel, of course, but that’s a lot of effort for very little value, don’t you think?

I am running FreeFEM on Windows 10. ‘SLEPc-complex’ library is giving a lot of trouble and not working properly. So, I had to take the decision of working without ‘SLEPc-complex’ library.

It is working and extensively tested by our continuous integration workers. Are you using the latest release 4.7-1? What are the problems you are facing?

I just tried again right now on my machine. As you can see below, no problem whatsoever.

It also works in parallel, as you can see below.

1 Like

So far what I have been able to figure out is that the problem is related to installation of ‘SLEPc-complex’ library on my system.

What problem? You say that it “doesn’t work”, without saying what is not working.

1 Like

Does that still happen with 4.7-1? You are using only version 4.6, so you should consider updating your installation, there is a link given above.
Are you using a freefem++.pref file? If so, what’s its content?
The list of prefix 'E:\FreeFem++\\.\' does not look OK to me.
Also, once you have updated, if there is still a problem, could you try to use "..\..\FreeFem++-mpi.exe" instead of "FreeFem++-mpi.exe"?

In (ii), you have a extra space before the .edp filename…

As the base flow code: FreeFem-sources/navier-stokes-2d-PETSc.edp at develop · FreeFem/FreeFem-sources · GitHub, is not writing the base flow and the mesh, I am not able to run the code: FreeFem-sources/navier-stokes-2d-SLEPc-complex.edp at develop · FreeFem/FreeFem-sources · GitHub for eigen value computation.

Looking forward to your kind reply.

Are you launching the command prompt as an administrator?

Yes I am running the command prompt as an administrator. But the code “FreeFem-sources/navier-stokes-2d-PETSc.edp at develop · FreeFem/FreeFem-sources · GitHub” is neither writing the solution nor the mesh file.

Can you save a standard mesh, e.g., using savemesh?

Hello Sarkar,

Did you try to add your path when saving the mesh? Something like: savemesh(“C:\\Desktop\\…”)? I also use Windows10 and I saw that when I work with SLEPc and PETSc I have to write the full path when reading/writing files. Otherwise, when I don’t run in parallel it just read/save the file from the folder where the .edp file is located.
Regards,
Robert

Remark you can change of directory by adding in you script

     load "shell"
     exec("pwd"); // to see which current directory 
     chdir("directory path");  
     exec("pwd"); // to see which current directory

Thank you all.

Now the code: FreeFem-sources/navier-stokes-2d-PETSc.edp at develop · FreeFem/FreeFem-sources · GitHub is writing the mesh and base flow solution file. How to display the base flow solution as 4 mesh files are written by running the code on 4 processors?

Using the mesh file and base flow file, I was also able to also run the code: FreeFem-sources/navier-stokes-2d-SLEPc-complex.edp at develop · FreeFem/FreeFem-sources · GitHub…This code displays the eigen values on the command prompt. How to display the corresponding eigen modes?

You can plot the solution and eigenmodes at runtime using the command line parameter -wg (with graphics, default is off when using FreeFem++-mpi).

Yes using “-wg” with FreeFem+±mpi, the base solution and the eigen vector is being plotted.

But I was asking for something like using “ffmatlib.idp” for plotting in Octave/MATLAB so that the results can be used in reports.

Use ParaView, via savevtk.

According to “Visualization”, “Finite element variables saved using paraview must be in P0 or P1.”

But the codes: “FreeFem-sources/navier-stokes-2d-PETSc.edp at develop · FreeFem/FreeFem-sources · GitHub” and “FreeFem-sources/navier-stokes-2d-SLEPc-complex.edp at develop · FreeFem/FreeFem-sources · GitHub” use P2 and P1 elements.

Then how can the solutions be visualized in paraview? Using low order of elements would reduce the accuracy of the solutions.

You can still use ParaView with P2 finite elements, the documentation is not accurate. For visualisation purposes, it won’t make any difference.