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.

Integration of a value over cross-section

Please login with a confirmed email address before reporting spam

Hello everyone,

I have a model of molecular diffusion in a cylinder (axisymmetric geometry), and after solving (stationary solver) I get the concentration field c(r,z).

I would like to get rid of the r dependency and have access to the average concentration per cross-section

c_average(z)=2*pi*int(r*c(r,z),0,R)/(pi*R^2)

where R is the radius of the cylinder.

I managed to get the value for any fixed value of z using Results > Derived Value > Line integration, but I would like to define this variable for any value of z to be able to plot c_average(z) vs z.

Is there a way to do this?

Thanks a lot for your help!

Fabien



6 Replies Last Post 14 mag 2014, 17:51 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 6 dic 2011, 12:01 GMT-5

Actually after some efforts I found the solution using linear projection:

2*linproj1(r*c)/R^2

Regards

Fabien
Actually after some efforts I found the solution using linear projection: 2*linproj1(r*c)/R^2 Regards Fabien

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 gen 2012, 05:07 GMT-5
i would like to do the same operation, on a 2D system to evaluate the cross sectional temperature average all along the x direction.
Can you tell me in detail how did you solve it?

Thankyou
i would like to do the same operation, on a 2D system to evaluate the cross sectional temperature average all along the x direction. Can you tell me in detail how did you solve it? Thankyou

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 gen 2012, 08:24 GMT-5

Hello Arsene,

I describe here my understanding of the linear projection which is in my sense not very well documented and quite obscure.

To do this you have to add an linear model coupling: right click on 'definitions' under your 'model' node and add a 'model coupling: linear projector' (by default linproj1).

Then you can select the domains where this projector applies and using the vertices you can define the source (define the plane Oxy by adding the corresponding points) and destination (line Oy) dimensions.

The linear projection gives the integral of the value so you have to divide by the length of the line on which the value was integrated to get the average (refered as 'length' in the formula below).

I think you have to relaunch the computation after adding the model coupling to be able to use it.

To plot the average temperature you have to add the boudaries along Oy of the domains you are interested in, then use as y-axis data expression:

linproj1(T) / length

where h is the length of cross-section, and y as x-data expression.

I hope this helps!

All the best,

Fabien
Hello Arsene, I describe here my understanding of the linear projection which is in my sense not very well documented and quite obscure. To do this you have to add an linear model coupling: right click on 'definitions' under your 'model' node and add a 'model coupling: linear projector' (by default linproj1). Then you can select the domains where this projector applies and using the vertices you can define the source (define the plane Oxy by adding the corresponding points) and destination (line Oy) dimensions. The linear projection gives the integral of the value so you have to divide by the length of the line on which the value was integrated to get the average (refered as 'length' in the formula below). I think you have to relaunch the computation after adding the model coupling to be able to use it. To plot the average temperature you have to add the boudaries along Oy of the domains you are interested in, then use as y-axis data expression: linproj1(T) / length where h is the length of cross-section, and y as x-data expression. I hope this helps! All the best, Fabien

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 gen 2012, 10:28 GMT-5
Thankyou Fabien, for this detailed explanations!
It seems to be clear, I'll try and hope it'll work!

Kind regards
Thankyou Fabien, for this detailed explanations! It seems to be clear, I'll try and hope it'll work! Kind regards

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 ago 2013, 17:01 GMT-4
Hi:

And what If I want the the same, but I have to integrate in a 3d domain i.e. the average over every cross section x,y and plot this average with respect to z.

Thanks
Hi: And what If I want the the same, but I have to integrate in a 3d domain i.e. the average over every cross section x,y and plot this average with respect to z. Thanks

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 mag 2014, 17:51 GMT-4
Hi to everyone,

I would be grateful if someone could help me out with this noob problem.
I have little experience with COMSOL and I've never used any model couplings before. I need to find out how to use "Definition - Model Couplings - Linear or general projection", or another way, to calculate and plot the average velocity in y*z cross-section over the length of a rectangular pipe, (spanning across the x direction).
I've searched the forum and the documentation and I haven't manage much :-(

Thank you in advance

Panagiotis
Hi to everyone, I would be grateful if someone could help me out with this noob problem. I have little experience with COMSOL and I've never used any model couplings before. I need to find out how to use "Definition - Model Couplings - Linear or general projection", or another way, to calculate and plot the average velocity in y*z cross-section over the length of a rectangular pipe, (spanning across the x direction). I've searched the forum and the documentation and I haven't manage much :-( Thank you in advance Panagiotis

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.