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

Using MatLab

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools 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: 7
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: Delft, Netherlands
Posts: 919
Rep Power: 17
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, 09:49
Default Plotting SampleDict output using GNU Plot
  #3
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
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, 16:54
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,507
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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, 17:06
Default
  #5
Member
 
Tony
Join Date: Jun 2010
Posts: 54
Rep Power: 7
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, 19:54
Default
  #6
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Bruno / Tom,
Thankyou very much for your suggestions and files.

Musa
musahossein is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM command from inside MATLAB sega OpenFOAM Post-Processing 18 September 25, 2012 07:35
Quick OpenFoam to MatLab lesson plz :) Rickard.Solsjo OpenFOAM 5 October 24, 2011 06:00
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 10:46.