CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   MATLAB postProcessing woes (https://www.cfd-online.com/Forums/openfoam-post-processing/197485-matlab-postprocessing-woes.html)

tLashbrooke January 7, 2018 06:48

MATLAB postProcessing woes
 
Hello all,

I'm doing a project with OpenFOAM and wanting to use MATLAB for post processing but have hit a slight barrier when it comes to extracting data from the forceCoeffs/forces/bins DAT files.

Can somebody help me understand how to get readable data from this file programmatically? MATLAB just doesn't want to know!

force.dat

force_bins.dat

AliE January 7, 2018 08:38

Hi,

Matlab does not like '(' , ')' or text strings as maybe you already know. So if you want to avoid to delete it manually with the find and replace method in your favourite text editor, then I suggest you to write a little script in bash which will do the job for you.

AliE

tLashbrooke January 8, 2018 09:13

Quote:

Originally Posted by AliE (Post 677205)
Hi,

Matlab does not like '(' , ')' or text strings as maybe you already know. So if you want to avoid to delete it manually with the find and replace method in your favourite text editor, then I suggest you to write a little script in bash which will do the job for you.

AliE

Yeah, changing the output to raw sorted out the majority of the data, the rest I used pyFoam to convert into .txt files for Matlab. The Allrun is coming along nicely now!


All times are GMT -4. The time now is 08:32.