-
Filter by Topic
Most Popular
All Topics
- List all discussions
export current plot/particle tracing with comsol w/ matlab
|
Thread index | Previous thread | Next thread | Start a new discussion |
March 8, 2010 11:32am UTC
export current plot/particle tracing with comsol w/ matlab
Hi,
I'm working on polymer flow, through a canal, and I need to determine the temperature function of time, for some particles in the flow. But I don't know how to do that through Matlab.
I'm using the particle tracing plot of postprocessing of COMSOL, and more precisely the function "color expression" where I write "partt", it represents the time. I export the datas with "file/export/current plot + write script etc.".
I repeat the same operation writing "T" (for temperature) instead of partt in the color expression of particle tracing plot, and then export datas through the same way (file/export/...).
The problem is that I need to do this for a program which can't be runned with Comsol, but only with Matlab with comsol because of some loops in it.
I've no problem to do the particle tracing plot with matlab (using postplot), but I really don't know how to obtain the same datas than with "File/export current plot, ...".
I've been trying with postcrossplot (+ outtype with postdata) but didn't find how to call "partt"...
Does anyone have an idea ?
Thank you.
Reply | Reply with Quote | Send private message | Report Abuse
March 8, 2010 3:35pm UTC in response to Julien LAUNAY
Re: export current plot/particle tracing with comsol w/ matlab
I finally found the solution of my problem, maybe it could be useful for somebody.
Some codes seems to work with Comsol but not with Matlab. This is the one I use :
"VAR_PART=postplot(fem, ...
'outtype','postdataonly', ...
'partmasstype','massless', ...
'partstart',{[0.001],[eps]}, ...
'partcolordata','partt', ...
'partdata',{'u','v'}, ...
'partedgetol',0.001, ...
'parttvar','partt', ...
'partres',5, ...
'solnum','end', ...
'geom','off', ...
'axis',[-0.038658065092179075,0.08865806583723716,-0.005000000074505795,0.10500000156462193]);"
And the datas are contained in the workspace of Matlab, in VAR_PART, to access them, by example the time :
VAR_PART{1,1}.parttime
To plot the results, just change outtype in "postdata" or "handle".
Reply | Reply with Quote | Send private message | Report Abuse
March 8, 2010 4:31pm UTC in response to Julien LAUNAY
Re: export current plot/particle tracing with comsol w/ matlab
Hi man!
Listen I have a problem...I'm able to plot streamlines in COMSOL+Matlab but not pathlines. Here is my code (just a part of it):
A = {0.24, -0.015}; % Single streamline/pathline as test case
figure
h = postplot(fem,...
'parttvar','partt','parttstar','auto',...
'partstart',A,'outtype','postdata');
grid on
xlabel('x-coordinate');
ylabel('y-coordinate');
Can you tell me why doesn't work? Thanks in advance for that!
J
Reply | Reply with Quote | Send private message | Report Abuse
March 9, 2010 10:43am UTC in response to Jacopo Biasetti
Re: export current plot/particle tracing with comsol w/ matlab
Hi,
I'm not sure for your code, but using the one I post below, it seems to work, with something like that :
A = {0.24, -0.015};
figure
h=postplot(fem, ...
'outtype','postdata', ...
'partstart',A, ...
'parttstar','auto', ...
'partdata',{'u','v'}, ...
'parttvar','partt', ...
'geom','off');
grid on
xlabel('x-coordinate');
ylabel('y-coordinate');
You can change 'geom' in 'on' to see your geometry with the particle.
I think the problem was the line 'partdata'
Hope it will help you,
JL
Reply | Reply with Quote | Send private message | Report Abuse
March 9, 2010 5:13pm UTC in response to Julien LAUNAY
Re: export current plot/particle tracing with comsol w/ matlab
In my case partdata is giving error, I'm forced to use partvelvar. No idea why...
Reply | Reply with Quote | Send private message | Report Abuse
March 9, 2010 5:14pm UTC in response to Jacopo Biasetti
Re: export current plot/particle tracing with comsol w/ matlab
Forgot this...and doesn't work anyway!
Reply | Reply with Quote | Send private message | Report Abuse
Rules and guidelines
