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.

Plotting local surface integration along a line

Please login with a confirmed email address before reporting spam

Hello,

I have a fluid flow model in a channel that has a rather complex geometry and cannot be sliced up. I'm trying to extricate local flow rates numbers (for the sake of averaging) from along this channel. I was able to do this by creating a parameterized surface that covers only the fluid section in the channel at the inlet, and then "walking" the surface along the channel by manually changing its coordinates. I used a derived integration value to get the actual flow rate (volumetric) out of integrating the local normal velocity over the surface. This was rather tedious and exactly the kind I thing I thought should have an automated solution for somewhere... but I couldn't find any sort of solution/information on how to do this automatically on the web.

Does anyone have any advice on this?

The ideal situation for me would be to cut a 3D line along the channel and then somehow plot the local surface integrations at each of the line's local x values.

Thanks,
-Michelle.

3 Replies Last Post Mar 29, 2014, 2:57 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 16, 2014, 12:04 a.m. EDT
I will only "bump" this once. Should I gather from the lack of response that there is no way to do this? Even not in 4.4? The manual way of moving a surface to perform the integration in different locations that are not pre-cut in the geometry is the only way?

-Michelle.
I will only "bump" this once. Should I gather from the lack of response that there is no way to do this? Even not in 4.4? The manual way of moving a surface to perform the integration in different locations that are not pre-cut in the geometry is the only way? -Michelle.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 28, 2014, 8:12 p.m. EDT
For closure's sake, this is the solution I came up with after a bunch of research:

Using LiveLink with Matlab, I exported the COMSOL model into Matlab and repeated my manual procedure of walking a surface and evaluating the derived integration into a table. I then saved the COMSOL file as a Matlab script (.m) and opened it in Matlab. I took the code that correlated with my manual procedure and put it into a new script with a simple for loop etc.

This method is a bit of a weird hybrid because it uses the COMSOL UI to properly set up the surface and the integration operation associated with it (so it can be performed on just a small part of a larger geometry), and then just iterates the surface over the length of the segment of interest in Matlab.

But it works great. If anyone has a question about the specific API, I can help out with that. Otherwise, this topic can be closed.

-Michelle.
For closure's sake, this is the solution I came up with after a bunch of research: Using LiveLink with Matlab, I exported the COMSOL model into Matlab and repeated my manual procedure of walking a surface and evaluating the derived integration into a table. I then saved the COMSOL file as a Matlab script (.m) and opened it in Matlab. I took the code that correlated with my manual procedure and put it into a new script with a simple for loop etc. This method is a bit of a weird hybrid because it uses the COMSOL UI to properly set up the surface and the integration operation associated with it (so it can be performed on just a small part of a larger geometry), and then just iterates the surface over the length of the segment of interest in Matlab. But it works great. If anyone has a question about the specific API, I can help out with that. Otherwise, this topic can be closed. -Michelle.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 29, 2014, 2:57 a.m. EDT
Thanks for sharing your solution! I guess that's the only way out, considering the fact no other response shows up.

Best!
--
Pu, ZHANG
DTU Fotonik
Thanks for sharing your solution! I guess that's the only way out, considering the fact no other response shows up. Best! -- Pu, ZHANG DTU Fotonik

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.