How to import result data from OpenFOAM to matlab?

hello, I want to import the result data from OpenFOAM which are compressed to matlab to plot the results and compare them with the results of other flow models. Can anyone please help me with the code?
Regards, Mahendra

Respuestas (2)

Precise Simulation
Precise Simulation el 27 de Mayo de 2019

2 votos

Dear Mahendra,
If this is still relevant, you can both run OpenFOAM CFD simulations directly in MATLAB and import/export Foam and ParaView VTK results files from/to MATLAB with the FEATool Multiphysics Toolbox (as well as other formats).

4 comentarios

Hello Precise Simulation,
I have installed FEATool Multiphysics Toolbox in MATLAB. I have an OpenFOAM case already run in ubuntu (I have all the time directories, system and constant folders). I need to tranfer my case to MATLAB for post processing since I don't want to do it in ParaView.
Can you tell me how can I transfer my case to FEATool in MATLAB? There is no option to import the OpenFOAM case in FEATool as far as I have explored.
Thank You :)
Import is typically done automatically for you after the solution process but you can use the openfoam m-code function
in the Matlab CLI to import OpenFOAM data as:
sol.u = openfoam( fea, 'mode', 'import', ... );
can you please also let me know fro where can I find information about connecting my matlab model with OpenFOAM or ANsys models. I would like to run both simluations openfoam and matlab together as a input and output files.
Precise Simulation
Precise Simulation el 30 de Sept. de 2024
Editada: Precise Simulation el 30 de Sept. de 2024
@Arman Burkitbayev The toolbox has now been updated with a MATLAB API for OpenFOAM which supports exporting and importing OpenFOAM dictionaries and result data, the information can be found in the toolbox documentation:

Iniciar sesión para comentar.

Seyyed Ali
Seyyed Ali el 21 de Mayo de 2018

0 votos

Hi Mahendra,
Have you found anything? The only I have found so far is that you can convert data to VTK (foamToVTK) and read VTK in matlab using some VTK reader function. I have not found a better solution yet.
SAHM>

1 comentario

you might do it as a input and output files when you connect matlab and openfoam models.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.

Preguntada:

el 19 de Abr. de 2018

Editada:

el 30 de Sept. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by