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.

how to find the average concentration in 2-D diffusion problem?

Please login with a confirmed email address before reporting spam

Hi,

I have a 2-D dynamic diffusion problem. I would like to know how to compute the average concentration over the 2-D subject?

Thanks in advance,

Xin

5 Replies Last Post 8 mar 2011, 13:42 GMT-5
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 9 mar 2010, 02:18 GMT-5
Hi

In a general sens an average value of a variable. let us say "T", is obtained by an integration coupling Variable:

If you integrate "T[K]" over an edge or a surface (boundary), respctively a volume (sub-domain) you get a value of dimensions [K*m], [K*m^2] repsectively [K*m^3], therefore to get the average value you must then divide your integration by the total edge Length, surface Area respectively Volume that is obtained by integrating the value "1" ove the edge, area, or volume, and off you go.

I agree that it could be so much easier if COMSOL wrote out the equation of the integration coupling variables but basically, how I understand it, it's the integration from "0" to "L" of the arc length of your expression "*ds", or a double integral over the boundary (area) of the expression "*ds1*ds2" etc. These integration could also be expressed as related to your reference coordinates, with the start end ending positions of your edge, boundary sub-domain respectively.

Now there is neither no clear explanations how this integration is really performed, I assume it is done in analogy to the "Postprocessing" edge, boundary or sub-doman "integration" functions. In there you have a "smoothing" and an "advanced" sub-tab. The latter allows you to select "summation" over the nodes or an "integration" in both cases you can define the order of the polynomial used to improve the integration value. Just as the smoothing allow you to select how the lower level elements (points w.r.t edges, edges w.r.t surfaces ...) are defined with respect to their neighbors (i.e. a the value of a variable on a point can be averaged over the neibouring edges attached to the point, or the value on an edge from the neighbouring surfaces etc.

At least this is my interpretation of the integration variables, and has been successfull to me so far.

One way to experiment this is to draw a circle if radius "1" in 2D, to mesh it as extremely coarse (I get a dodecagone perifery), to do a "solve get initial values", and have a look at the postprocessng geometrical properties, as well as a bundary integration along the perifery (=2*pi*r) with summation 1st, 2, 4 th order and an integration (the smooting has no effect on a circle like this I believe, use a cople of adjacent squares to play with that functionality).

Note that the "summation" gives you an ordinary sum (and COMSOL does no add the default [m], [m^2 respective [m^3] in the units section). The summation of the circle (=24 as I have a dodecagone from the mesh) is not the sum of the four 1/4 circles or the 4 quadrants (24 <> 4*7=28) because of the 4 common points (28-4=24).
While the integration gives you a value in the correct units and is close to 2*pi, in fact even better if you select a 2nd order intrpolation, than a default "auto" 4the order.

As the help files says, "summation" is typically used for reaction forces.

Hope this helps
Ivar
Hi In a general sens an average value of a variable. let us say "T", is obtained by an integration coupling Variable: If you integrate "T[K]" over an edge or a surface (boundary), respctively a volume (sub-domain) you get a value of dimensions [K*m], [K*m^2] repsectively [K*m^3], therefore to get the average value you must then divide your integration by the total edge Length, surface Area respectively Volume that is obtained by integrating the value "1" ove the edge, area, or volume, and off you go. I agree that it could be so much easier if COMSOL wrote out the equation of the integration coupling variables but basically, how I understand it, it's the integration from "0" to "L" of the arc length of your expression "*ds", or a double integral over the boundary (area) of the expression "*ds1*ds2" etc. These integration could also be expressed as related to your reference coordinates, with the start end ending positions of your edge, boundary sub-domain respectively. Now there is neither no clear explanations how this integration is really performed, I assume it is done in analogy to the "Postprocessing" edge, boundary or sub-doman "integration" functions. In there you have a "smoothing" and an "advanced" sub-tab. The latter allows you to select "summation" over the nodes or an "integration" in both cases you can define the order of the polynomial used to improve the integration value. Just as the smoothing allow you to select how the lower level elements (points w.r.t edges, edges w.r.t surfaces ...) are defined with respect to their neighbors (i.e. a the value of a variable on a point can be averaged over the neibouring edges attached to the point, or the value on an edge from the neighbouring surfaces etc. At least this is my interpretation of the integration variables, and has been successfull to me so far. One way to experiment this is to draw a circle if radius "1" in 2D, to mesh it as extremely coarse (I get a dodecagone perifery), to do a "solve get initial values", and have a look at the postprocessng geometrical properties, as well as a bundary integration along the perifery (=2*pi*r) with summation 1st, 2, 4 th order and an integration (the smooting has no effect on a circle like this I believe, use a cople of adjacent squares to play with that functionality). Note that the "summation" gives you an ordinary sum (and COMSOL does no add the default [m], [m^2 respective [m^3] in the units section). The summation of the circle (=24 as I have a dodecagone from the mesh) is not the sum of the four 1/4 circles or the 4 quadrants (24 4*7=28) because of the 4 common points (28-4=24). While the integration gives you a value in the correct units and is close to 2*pi, in fact even better if you select a 2nd order intrpolation, than a default "auto" 4the order. As the help files says, "summation" is typically used for reaction forces. Hope this helps Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 mar 2010, 12:14 GMT-5
Ivar,

Many thanks for the explaination. In line with your explaination and Xin's case, do you know how integrals are calculated over a deformed mesh? and how to find that area to calculate an average?
Ivar, Many thanks for the explaination. In line with your explaination and Xin's case, do you know how integrals are calculated over a deformed mesh? and how to find that area to calculate an average?

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 10 mar 2010, 01:56 GMT-5
Hi

No not in detail, I havent found that in the doc, but you must define on which frame you are calculating, and I expect COMSOL to use the same principles, in each case

normally it remains the integration of "1" over the area, but on the deformed mesh

look carefully on the integration coupling variable GUI, when you add an ALE you get a frame option added in to define on which frame you want to calculate

Good luck
Ivar
Hi No not in detail, I havent found that in the doc, but you must define on which frame you are calculating, and I expect COMSOL to use the same principles, in each case normally it remains the integration of "1" over the area, but on the deformed mesh look carefully on the integration coupling variable GUI, when you add an ALE you get a frame option added in to define on which frame you want to calculate Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 mar 2011, 10:48 GMT-5
Hi Ivar:

I'm using a COMSOL heat transfer module (time dependent) for my Laser surface heating model. I'm using line integration for measuring temperature vs time. I can able to get the data for temperature, but temperature is in (m*K) unit. I go through the manual as well as blogs/forums and found that we have to divide this temperature (m*K)... with lenght of the line which is of unit m. Is this true? Is there any other way to get the temperature in unit Kelvin directly?

Pls guide.

Hitesh
Hi Ivar: I'm using a COMSOL heat transfer module (time dependent) for my Laser surface heating model. I'm using line integration for measuring temperature vs time. I can able to get the data for temperature, but temperature is in (m*K) unit. I go through the manual as well as blogs/forums and found that we have to divide this temperature (m*K)... with lenght of the line which is of unit m. Is this true? Is there any other way to get the temperature in unit Kelvin directly? Pls guide. Hitesh

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 mar 2011, 13:42 GMT-5

Hi Ivar:

I'm using a COMSOL heat transfer module (time dependent) for my Laser surface heating model. I'm using line integration for measuring temperature vs time. I can able to get the data for temperature, but temperature is in (m*K) unit. I go through the manual as well as blogs/forums and found that we have to divide this temperature (m*K)... with lenght of the line which is of unit m. Is this true? Is there any other way to get the temperature in unit Kelvin directly?

Pls guide.

Hitesh


yes. there is also an average operator in comsol 4.x

--
Comsol 4.1
Ubuntu 10.04.1
[QUOTE] Hi Ivar: I'm using a COMSOL heat transfer module (time dependent) for my Laser surface heating model. I'm using line integration for measuring temperature vs time. I can able to get the data for temperature, but temperature is in (m*K) unit. I go through the manual as well as blogs/forums and found that we have to divide this temperature (m*K)... with lenght of the line which is of unit m. Is this true? Is there any other way to get the temperature in unit Kelvin directly? Pls guide. Hitesh [/QUOTE] yes. there is also an average operator in comsol 4.x -- Comsol 4.1 Ubuntu 10.04.1

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.