Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Calculating flux in more than 100 cutlines in 2D

Please login with a confirmed email address before reporting spam

Hi

I have a 2D model that I have to study the flux distribution in it (not B). I drew a cut line and used ''Additional parallel lines'' in that cut line to draw more lines. when I integrate over that cut line using line integration COMSOL give me just one number ( in wb/m). In fact I expect one number for each parallel cut line. How can I solve this problem? I do not want to do this manually, because they are more than 100 lines !

Regards
Hamid

5 Replies Last Post 2016年5月24日 GMT-4 14:31
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年5月24日 GMT-4 10:46
Hello Hamid,
Several ways of achieving what you want are presented on the COMSOL Blog:
www.comsol.com/blogs/maximum-evaluations-on-parallel-sections/

Yet another way is to create a method in an app. That assumes that you have version 5.0 or later on Windows. Big picture: repetitive post-processing (or pre-processing, for that matter) tasks are often extremely easy to automate using a method in an app.
Best,
Jeff
Hello Hamid, Several ways of achieving what you want are presented on the COMSOL Blog: https://www.comsol.com/blogs/maximum-evaluations-on-parallel-sections/ Yet another way is to create a method in an app. That assumes that you have version 5.0 or later on Windows. Big picture: repetitive post-processing (or pre-processing, for that matter) tasks are often extremely easy to automate using a method in an app. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年5月24日 GMT-4 12:12
Thanks Jeff
That was great. I think I understand everything there except 'quickz'.In my case, since it is a 2D model I will replace cpl1 with cln1. The u should be converted to mf.normB in linear mode (1). But what is quickz?

Regards
Hamid

P.S.: I paste the program for quick reference.

z = [z1 z2 z3 zn];

for i = 1:length(z)

model.result.dataset('cpl1').set('quickz', z(i));

umax(i) = mphmax(model,'u',2,'dataset','cpl1');

end

plot(z, umax)
Thanks Jeff That was great. I think I understand everything there except 'quickz'.In my case, since it is a 2D model I will replace cpl1 with cln1. The u should be converted to mf.normB in linear mode (1). But what is quickz? Regards Hamid P.S.: I paste the program for quick reference. z = [z1 z2 z3 zn]; for i = 1:length(z) model.result.dataset('cpl1').set('quickz', z(i)); umax(i) = mphmax(model,'u',2,'dataset','cpl1'); end plot(z, umax)

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年5月24日 GMT-4 14:06
Hello Hamid,
You're basically asking COMSOL to define the cut plane data set using a plane specified quickly by its being normal to the z direction at the z-coordinate z(i), as opposed to the more general ways of defining a cut plane (with 3 points or, alternatively a point and a normal). If the above is not so clear, please take a look at the GUI interface for creating a cut plane and you'll see what I mean.
Best,
Jeff
Hello Hamid, You're basically asking COMSOL to define the cut plane data set using a plane specified quickly by its being normal to the z direction at the z-coordinate z(i), as opposed to the more general ways of defining a cut plane (with 3 points or, alternatively a point and a normal). If the above is not so clear, please take a look at the GUI interface for creating a cut plane and you'll see what I mean. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年5月24日 GMT-4 14:11
Hi Jeff
Actually, I'm working in 2D. It does not make sence for a line. Also I do not want ot create any thing, I just want to switch from one line to another.
Regards
Hamid
Hi Jeff Actually, I'm working in 2D. It does not make sence for a line. Also I do not want ot create any thing, I just want to switch from one line to another. Regards Hamid

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年5月24日 GMT-4 14:31
Indeed, in your 2D case, things will be slightly different from the 3D example in the blog, although the general approach is the same. You do need to create data sets though.
Best,
Jeff
Indeed, in your 2D case, things will be slightly different from the 3D example in the blog, although the general approach is the same. You do need to create data sets though. Best, Jeff

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.