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

Using MatLab

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2010, 03:02
Default Using MatLab
  #1
Senior Member
 
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15
Rickard.Solsjo is on a distinguished road
Hi everyone!
I have succesfully used sampleDict to get a plane slicing through my domain. So I have the x,y and z-direction plus the amount of fuel in each cell.
Does anyone know how to plot this in MatLab?
Rickard.Solsjo is offline   Reply With Quote

Old   August 2, 2010, 03:18
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
http://web.cecs.pdx.edu/~gerry/MATLA...ml#loadAndPlot
akidess is offline   Reply With Quote

Old   December 4, 2011, 08:49
Default Plotting SampleDict output using GNU Plot
  #3
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18
musahossein is on a distinguished road
I would appreciate it very much if some one could tell me how to plot the sampleDict output using GNU plot. I can do simple x y plots in GNU plot, but I have no idea how to plot all the individual files in the set folders. Would I have a write a script of sorts? I had assumed that since OpenFOAM permits data output in GNU format, there would some direction in the OpenFOAM users guide as to how to plot the data in GNU plot. But I have not found it yet. Any suggestion/help would be greatly appreciated. Thanks!
musahossein is offline   Reply With Quote

Old   December 4, 2011, 15:54
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi musahossein,

Without looking deeper into this, I can say that the tutorial "mesh/moveDynamicMesh/simpleHarmonicMotion" from OpenFOAM 2.0 seems to have several hints to what you need to do. There you'll find 3 important files:
  • Allrun - the main script for running the tutorial.
  • extractData - called by "Allrun" for extracting data into a format that gnuplot can easily understand.
  • shm.gnuplot - the script for gnuplot.
Another tutorial that uses gnuplot is "./incompressible/boundaryFoam/boundaryWallFunctionsProfile", but at first glance is doesn't seem to do what you need.


Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 4, 2011, 16:06
Default
  #5
Member
 
Tony
Join Date: Jun 2010
Posts: 54
Rep Power: 15
tonyuprm is on a distinguished road
Hey musaddeque,

I had the same situation a while ago having too many plots. Scripting is the way to go. I first used Octave to plot and handle different files. Octave uses gnuplot as the plotting engine. I had a hard time getting quality plots because of bugs between Octave/gnuplot and finally opted for using python and the matplotlib which works like a charm for generating good quality plots.

gl,

Tony

Here are some scripts which might help.

Octave Scripts.zip
tonyuprm is offline   Reply With Quote

Old   December 4, 2011, 18:54
Default
  #6
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18
musahossein is on a distinguished road
Bruno / Tom,
Thankyou very much for your suggestions and files.

Musa
musahossein is offline   Reply With Quote

Reply


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
Quick OpenFoam to MatLab lesson plz :) Rickard.Solsjo OpenFOAM 6 October 26, 2020 11:58
OpenFOAM command from inside MATLAB sega OpenFOAM Post-Processing 18 September 25, 2012 07:35
Pohlhausen energy equation MATLAB help abe_cooldude Main CFD Forum 2 May 3, 2010 16:58
caling matlab in Fortran HaKu Main CFD Forum 0 July 16, 2009 15:35
is matlab enough? prapanj Main CFD Forum 9 August 10, 2006 19:16


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