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.

Parametric Curve dataset for evenly spaced data along a line

Jose Martinez-Quijada

Please login with a confirmed email address before reporting spam

Hi everyone

I want to define a horizontal line across an axisymmetric model to plot heat flux at specific points. in 3.5a this was straightforward, but it isn't in 4.2a.

In 4.2a I can't do this using a Cut Line 2D dataset, because it does not allow to set up a resolution explicitly.

If I plot using a Cut Line 2D dataset, the plot looks good, but if you have noticed, the data points are actually arbitrarily spaced. The only setting available in the Line Graph is "Resolution", under Quality, which only increases or decreases the number of data points, but they are not evenly spaced.

The problem is how to define a simple straight line in "Expresson", in the Parameterized Curve node. in x I enter r (the horizontal cylindrical coordinate) and in y I enter a constant, but I get an error.

How could I define such a line ?, is there any other way to get evenly spaced data ?

Thanks in advance !

8 Replies Last Post 2012/06/13 16:43 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/02/21 15:53 GMT-5
Hi

I believe you can export with an even grid but then you need to read in your txt data again, either into another tool (EXCEL, MAtalb ...), or into a COMSOL interpolation function

I mostl generate an internal boundary along the lines where I want to extract, with prcision, my results

--
Good luck
Ivar
Hi I believe you can export with an even grid but then you need to read in your txt data again, either into another tool (EXCEL, MAtalb ...), or into a COMSOL interpolation function I mostl generate an internal boundary along the lines where I want to extract, with prcision, my results -- Good luck Ivar

Jose Martinez-Quijada

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/02/21 16:19 GMT-5
Hi Ivar, thans for your reply

if you open your .txt or .dat file in any other software you discover that although the resolution is good, the points are not evenly spaced. We usually don't cate because you get a nice graph anyway.

In Matlab or with the COMSOL interpolation function you can "re-sample" your data, through interpolation, but this adds error when the quantity that you plot has sharp gradients. This extra re-sampling should not be necesary.

As you say it is possible to draw an internal boundary, or cut line, at any precise location, but you won't get a data point say, each 1.00 micrometers. An "Exporting with even grid" setting is not available.

Jose
Hi Ivar, thans for your reply if you open your .txt or .dat file in any other software you discover that although the resolution is good, the points are not evenly spaced. We usually don't cate because you get a nice graph anyway. In Matlab or with the COMSOL interpolation function you can "re-sample" your data, through interpolation, but this adds error when the quantity that you plot has sharp gradients. This extra re-sampling should not be necesary. As you say it is possible to draw an internal boundary, or cut line, at any precise location, but you won't get a data point say, each 1.00 micrometers. An "Exporting with even grid" setting is not available. Jose

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/02/21 17:01 GMT-5
Hi

I'm not by my COMSOL WS tonight ;) so I have only he pdf's to read from, but If I take the Users guide p1075 exporting data, you can define: "Grid, Regular grid, or Take from data set a regular grid"

but I cannot tell how you define them from the doc, will have a look tomorrow.

Else it's perhaps something to propose to "support" as "improvement"

--
Good luck
Ivar
Hi I'm not by my COMSOL WS tonight ;) so I have only he pdf's to read from, but If I take the Users guide p1075 exporting data, you can define: "Grid, Regular grid, or Take from data set a regular grid" but I cannot tell how you define them from the doc, will have a look tomorrow. Else it's perhaps something to propose to "support" as "improvement" -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/02/21 17:15 GMT-5

In Matlab or with the COMSOL interpolation function you can "re-sample" your data, through interpolation, but this adds error when the quantity that you plot has sharp gradients. This extra re-sampling should not be necesary.


If you want non-interpolated data, you have to define evenly spaced mesh points along the desired line (when you create a mesh). In any other case it will be an interpolation as you solve FEM on discrete grid.

The option Ivar mentioned is located in Export-Data, "Points to evaluate in:". There you can select regular grid.
[QUOTE] In Matlab or with the COMSOL interpolation function you can "re-sample" your data, through interpolation, but this adds error when the quantity that you plot has sharp gradients. This extra re-sampling should not be necesary. [/QUOTE] If you want non-interpolated data, you have to define evenly spaced mesh points along the desired line (when you create a mesh). In any other case it will be an interpolation as you solve FEM on discrete grid. The option Ivar mentioned is located in Export-Data, "Points to evaluate in:". There you can select regular grid.

Jose Martinez-Quijada

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/02/22 13:15 GMT-5
Thanks a lot Alexander. That clarifies things up. At least for now I'm able to get interpolated points at even distances from Export > Data. In a next iteration I'll make a regular mesh.

Thanks also to Ivar for giving the hint
Thanks a lot Alexander. That clarifies things up. At least for now I'm able to get interpolated points at even distances from Export > Data. In a next iteration I'll make a regular mesh. Thanks also to Ivar for giving the hint

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/06/13 7:25 GMT-4
Hi

I got some similar questions.
I just have started using Comsol focusing on fluid flow. In order to familiarise with the software, I modelled Newtonian and power law fluids in a straight pipe.
When I exported the data for the velocity profile along a radial cut line to Excel, I wondered about the data distribution.

Does anybody know how Comsol selects the points where the data for the plots is evaluated (e.g. a mesh element is slightly rotated and cut by the cut line, which node is then taken into account) and how works the interpolation (only nodes along the cut line or neighbouring nodes from above/beneath the cut line)? Probably that's basic FEM knowledge, but I'd be happy for an answer...

Secondly I'd like to ask for your opnion: after plotting the velocity profile, an improvement for regions of interest is necessary. In this case this would be determined by the gradient of the velocity/shear rate profile.
I thought about adding some internal boundaries in these regions, refine the mesh in that area and run the simulation again. That's the only option I can see regarding the available meshing options. Adaptive remeshing seems to be only available for certain element types?
I am not sure, if this is the best/simplest way to do it, but if anybody has a better idea?

Thanks for any feedback!
Cheers,
Harry
Hi I got some similar questions. I just have started using Comsol focusing on fluid flow. In order to familiarise with the software, I modelled Newtonian and power law fluids in a straight pipe. When I exported the data for the velocity profile along a radial cut line to Excel, I wondered about the data distribution. Does anybody know how Comsol selects the points where the data for the plots is evaluated (e.g. a mesh element is slightly rotated and cut by the cut line, which node is then taken into account) and how works the interpolation (only nodes along the cut line or neighbouring nodes from above/beneath the cut line)? Probably that's basic FEM knowledge, but I'd be happy for an answer... Secondly I'd like to ask for your opnion: after plotting the velocity profile, an improvement for regions of interest is necessary. In this case this would be determined by the gradient of the velocity/shear rate profile. I thought about adding some internal boundaries in these regions, refine the mesh in that area and run the simulation again. That's the only option I can see regarding the available meshing options. Adaptive remeshing seems to be only available for certain element types? I am not sure, if this is the best/simplest way to do it, but if anybody has a better idea? Thanks for any feedback! Cheers, Harry

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/06/13 15:33 GMT-4
Hi

I have seen on the demos that in v4.3 you can define geometry specifically for nodes and mesh control, and not make domains or boundaries out of them, that will probably help you, but it implies some prior knowledge of the results

--
Good luck
Ivar
Hi I have seen on the demos that in v4.3 you can define geometry specifically for nodes and mesh control, and not make domains or boundaries out of them, that will probably help you, but it implies some prior knowledge of the results -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012/06/13 16:43 GMT-4
Thanks Ivar!
I will definitly have a look at v4.3
Thanks Ivar! I will definitly have a look at v4.3

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.