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.

"boundary integration" question

Please login with a confirmed email address before reporting spam

Hi all, I would like to make sure my understanding of 'Boundary Integration' in Postprocessing is correct.

Assuming we are doing boundary integration of a pressure expression, P, with unit [Pa], and we can get the result with unit [N/m].

And I think we should get the same result if we use the method below.
1. Find the pressure P [Pa] from Domain Plot Parameter -> Line/Extrusion;
2. Find the interval size [m] depending on the mesh quality from Domain Plot Parameter -> Line/Extrusion;
3. Find the force density [N/m] in each mesh interval;
4. Finally, sum all the force density up.

Is that how COMSOL does the boundary integration numerically? Thanks.

C.M.S.

6 Replies Last Post 7 set 2012, 10:17 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 20 gen 2010, 21:50 GMT-5
Hi

I have partly the same understanding, apart from perhaps your point 1.

Basically I understand that as "p" is a "dependent variable" it is solved for for each FEM elements, and p is hence known at the node locations.

For me the "boundary integration" is what its name says: an integration over the domain of the varable*dx in 1D (or over ds, a synonyme) , over dx*dy in 2D and dx*dy*ds in 3D. As the boundaries are discretised by the FEM "elements" its equivalent to a sum over the elements. As each elements are of a given "order" so som polynomial development is used to smoothen and interpolate over the element length/area/volume.

That is also why you get a change in units, pressure [Pa=N/m^2] indegrated along a "length" gives you [N/m] as dx or ds has a unit of [m]. In 2D, as there is an implicit depth or thickness of 1[m], and integration over a boundary length, would mean over a boundary area dx*(dz=1[m]), hence the result of the integrated pressure is [N]. To find back your pressure you must divide the result by respective the total length/area/volume, that you can easily get by integration the value "1" over the line/surface/volume = edge/boundary/sub-domain.

If you need to know the length/area/volume of several items, but want to define them in one go with one single identical name (only valid on selected edges/boundaries/subdomain) you can integrate the bolean variable (dest(dom)==dom), which means that the boulean value is equal to 1 where the destination and source domain "id" are equal, do not forget to deselect the "global" box and and in the "destination tab" select the desired edges/boundaries/sub-domains.

In 2D axi you must take care of the use of "2*pi*r", the "loop length" that is not included by default in the "boundary integration" variables, but that can be included in the boundary settings and postprocessing integration by selecting the appropriate tick box (as for default depth/thickness inclusion in 2D).

Do we agree ?
Good luck
Ivar
Hi I have partly the same understanding, apart from perhaps your point 1. Basically I understand that as "p" is a "dependent variable" it is solved for for each FEM elements, and p is hence known at the node locations. For me the "boundary integration" is what its name says: an integration over the domain of the varable*dx in 1D (or over ds, a synonyme) , over dx*dy in 2D and dx*dy*ds in 3D. As the boundaries are discretised by the FEM "elements" its equivalent to a sum over the elements. As each elements are of a given "order" so som polynomial development is used to smoothen and interpolate over the element length/area/volume. That is also why you get a change in units, pressure [Pa=N/m^2] indegrated along a "length" gives you [N/m] as dx or ds has a unit of [m]. In 2D, as there is an implicit depth or thickness of 1[m], and integration over a boundary length, would mean over a boundary area dx*(dz=1[m]), hence the result of the integrated pressure is [N]. To find back your pressure you must divide the result by respective the total length/area/volume, that you can easily get by integration the value "1" over the line/surface/volume = edge/boundary/sub-domain. If you need to know the length/area/volume of several items, but want to define them in one go with one single identical name (only valid on selected edges/boundaries/subdomain) you can integrate the bolean variable (dest(dom)==dom), which means that the boulean value is equal to 1 where the destination and source domain "id" are equal, do not forget to deselect the "global" box and and in the "destination tab" select the desired edges/boundaries/sub-domains. In 2D axi you must take care of the use of "2*pi*r", the "loop length" that is not included by default in the "boundary integration" variables, but that can be included in the boundary settings and postprocessing integration by selecting the appropriate tick box (as for default depth/thickness inclusion in 2D). Do we agree ? Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 gen 2010, 22:51 GMT-5
Thanks Ivar. I put my comments between the quotes below.


"For me the "boundary integration" is what its name says: an integration over the domain of the varable*dx in 1D (or over ds, a synonyme) , over dx*dy in 2D and dx*dy*ds in 3D. As the boundaries are discretised by the FEM "elements" its equivalent to a sum over the elements. As each elements are of a given "order" so som polynomial development is used to smoothen and interpolate over the element length/area/volume."


Yes. I agree with this point.


"That is also why you get a change in units, pressure [Pa=N/m^2] indegrated along a "length" gives you [N/m] as dx or ds has a unit of [m]. In 2D, as there is an implicit depth or thickness of 1[m], and integration over a boundary length, would mean over a boundary area dx*(dz=1[m]), hence the result of the integrated pressure is [N]. To find back your pressure you must divide the result by respective the total length/area/volume, that you can easily get by integration the value "1" over the line/surface/volume = edge/boundary/sub-domain."


I think in 2D case, the unit we get after the boundary integration of the pressure is [N/m] instead of [N]. There is an implicit depth (default is 1[m]), but I think what boundary integration does is integrate(p * dx).

And I have another question regarding to this point. How dose COMSOL find dx (i.e. what is the value of dx)? Does it depends on the mesh quality? Can we find it by doing something as below:
1. Select "Postprocess -> Domain plot parameters... -> Line/Extrusion plot";
2. Export the data from the line plot;
3. The values of the x-axis is the mesh element node position;


"If you need to know the length/area/volume of several items, but want to define them in one go with one single identical name (only valid on selected edges/boundaries/subdomain) you can integrate the bolean variable (dest(dom)==dom), which means that the boulean value is equal to 1 where the destination and source domain "id" are equal, do not forget to deselect the "global" box and and in the "destination tab" select the desired edges/boundaries/sub-domains.

In 2D axi you must take care of the use of "2*pi*r", the "loop length" that is not included by default in the "boundary integration" variables, but that can be included in the boundary settings and postprocessing integration by selecting the appropriate tick box (as for default depth/thickness inclusion in 2D)."


I don't really understand these two paragraph. Could you please explain it a little bit more? Thanks.

CMS
Thanks Ivar. I put my comments between the quotes below. [QUOTE] "For me the "boundary integration" is what its name says: an integration over the domain of the varable*dx in 1D (or over ds, a synonyme) , over dx*dy in 2D and dx*dy*ds in 3D. As the boundaries are discretised by the FEM "elements" its equivalent to a sum over the elements. As each elements are of a given "order" so som polynomial development is used to smoothen and interpolate over the element length/area/volume." [/QUOTE] Yes. I agree with this point. [QUOTE] "That is also why you get a change in units, pressure [Pa=N/m^2] indegrated along a "length" gives you [N/m] as dx or ds has a unit of [m]. In 2D, as there is an implicit depth or thickness of 1[m], and integration over a boundary length, would mean over a boundary area dx*(dz=1[m]), hence the result of the integrated pressure is [N]. To find back your pressure you must divide the result by respective the total length/area/volume, that you can easily get by integration the value "1" over the line/surface/volume = edge/boundary/sub-domain." [/QUOTE] I think in 2D case, the unit we get after the boundary integration of the pressure is [N/m] instead of [N]. There is an implicit depth (default is 1[m]), but I think what boundary integration does is integrate(p * dx). And I have another question regarding to this point. How dose COMSOL find dx (i.e. what is the value of dx)? Does it depends on the mesh quality? Can we find it by doing something as below: 1. Select "Postprocess -> Domain plot parameters... -> Line/Extrusion plot"; 2. Export the data from the line plot; 3. The values of the x-axis is the mesh element node position; [QUOTE] "If you need to know the length/area/volume of several items, but want to define them in one go with one single identical name (only valid on selected edges/boundaries/subdomain) you can integrate the bolean variable (dest(dom)==dom), which means that the boulean value is equal to 1 where the destination and source domain "id" are equal, do not forget to deselect the "global" box and and in the "destination tab" select the desired edges/boundaries/sub-domains. In 2D axi you must take care of the use of "2*pi*r", the "loop length" that is not included by default in the "boundary integration" variables, but that can be included in the boundary settings and postprocessing integration by selecting the appropriate tick box (as for default depth/thickness inclusion in 2D)." [/QUOTE] I don't really understand these two paragraph. Could you please explain it a little bit more? Thanks. CMS

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12 mar 2011, 10:03 GMT-5
Hi, I am quite interested in your post.
So, if follow what ivar comment, if we want to find volumetric flow rate in 2-D,
we just integrate the velocity [m/s] over the inlet and will get the volumetric flow rate [m^3/s] at that particular inlet, right?
Or any advice for this.

Appreciate.
Hi, I am quite interested in your post. So, if follow what ivar comment, if we want to find volumetric flow rate in 2-D, we just integrate the velocity [m/s] over the inlet and will get the volumetric flow rate [m^3/s] at that particular inlet, right? Or any advice for this. Appreciate.

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 13 mar 2011, 06:38 GMT-4
Hi

I agree in 2D you have the default 1[m] depth that one should not forget, COMSOL is calculating in 3D for all cases, it just simplifies the equations related to a third dimension = 1[m] for most physics.

you are right that a boundary (1D) integration in 2D physics is giving results per "m". The multiplication is formally ds where "s" is sqrt(x^2+y^2), but using the sign of the arrow for the direction, "s" is the edge length element. If your edge is along x alone, it is indeed as for "dx"

It took me some time too to understand the implicit notation of COMSOL: when you select an edge and integrate along it, it takes the nodes and elements along the edge and uses the values for x (or s) while it moves along the edge for the itegration (or the summation). Depending on your settings it does a square summation, or a triangular, or 2nd oder integration with interpolations, to get the integraton value out. You can illustrate this if you look at the results with the "Wireframe" and turn off and on the smoothing (applies to v4) you will see the intermediate additional mesh appearing.

THen I'm referring to 2D-axi, this is slightly differet from 2D as we are looking at cylindrical coordinates, so the depth in "z" for a 2D transforms into a loop lengt of "2*pi*r", where r is the radius from the 2D-axis of asymmetry

The trick with *(dom==1) is a way to select, from a formula only a given domain (but you must no its id number here =1). THis is because if you select several domains, and integration will summ over all domains, but if you add the bolean ooperation the result you are summing is ==0 except for the domain dom==1. This allows you to use a global equation for justa selection of the elements it applies too. I would need to find back a simple example, I belive there are a few in the KB

--
Good luck
Ivar
Hi I agree in 2D you have the default 1[m] depth that one should not forget, COMSOL is calculating in 3D for all cases, it just simplifies the equations related to a third dimension = 1[m] for most physics. you are right that a boundary (1D) integration in 2D physics is giving results per "m". The multiplication is formally ds where "s" is sqrt(x^2+y^2), but using the sign of the arrow for the direction, "s" is the edge length element. If your edge is along x alone, it is indeed as for "dx" It took me some time too to understand the implicit notation of COMSOL: when you select an edge and integrate along it, it takes the nodes and elements along the edge and uses the values for x (or s) while it moves along the edge for the itegration (or the summation). Depending on your settings it does a square summation, or a triangular, or 2nd oder integration with interpolations, to get the integraton value out. You can illustrate this if you look at the results with the "Wireframe" and turn off and on the smoothing (applies to v4) you will see the intermediate additional mesh appearing. THen I'm referring to 2D-axi, this is slightly differet from 2D as we are looking at cylindrical coordinates, so the depth in "z" for a 2D transforms into a loop lengt of "2*pi*r", where r is the radius from the 2D-axis of asymmetry The trick with *(dom==1) is a way to select, from a formula only a given domain (but you must no its id number here =1). THis is because if you select several domains, and integration will summ over all domains, but if you add the bolean ooperation the result you are summing is ==0 except for the domain dom==1. This allows you to use a global equation for justa selection of the elements it applies too. I would need to find back a simple example, I belive there are a few in the KB -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 7 set 2012, 07:00 GMT-4

Dear Ivar,

Considering the 2D case, the geometry being a shape of a rectangle.
To calculate the volumetric flow rate at the exit, I do: integrate u * ds? or
u * dx on the border.

Thanks
Dear Ivar, Considering the 2D case, the geometry being a shape of a rectangle. To calculate the volumetric flow rate at the exit, I do: integrate u * ds? or u * dx on the border. Thanks


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 7 set 2012, 10:17 GMT-4
Hi

Well "s" (ds being the elementary entity length, mainly for lines in 2D, is defined from 0 to 1 along any edge in the direction of the entitiy direction arrow (COMSOL decides which direction, you can turn on the arrow representation to check), while x is the true coordinate, so if you integrate ds you get the total length, while integrating dx you get the x component. I believe you can say, in all generality that ds = +/- sqrt(dx^2+dy^2+dz^2)/Length *1[m] as ds has a dimension of length, and the sign is defined by convention
Now in anycase your ds or dx*dy*dz (or only dx depending on the dimensions used) is implicit COMSOL uses it internally for you

The best is to check out such things on simple examples, take a long rectangle, put ina normalised parabolic flow integrate velocity along the input and output and check the coherence of the results, you will soon get the grasp of how to use the integration. One thing, always check your units, as this mostly tells you if you have missed a dimension in your equation, such as the 2D depth that is easily forgotten, or the 2D.axi loop length 2*pi*r ...

--
Good luck
Ivar
Hi Well "s" (ds being the elementary entity length, mainly for lines in 2D, is defined from 0 to 1 along any edge in the direction of the entitiy direction arrow (COMSOL decides which direction, you can turn on the arrow representation to check), while x is the true coordinate, so if you integrate ds you get the total length, while integrating dx you get the x component. I believe you can say, in all generality that ds = +/- sqrt(dx^2+dy^2+dz^2)/Length *1[m] as ds has a dimension of length, and the sign is defined by convention Now in anycase your ds or dx*dy*dz (or only dx depending on the dimensions used) is implicit COMSOL uses it internally for you The best is to check out such things on simple examples, take a long rectangle, put ina normalised parabolic flow integrate velocity along the input and output and check the coherence of the results, you will soon get the grasp of how to use the integration. One thing, always check your units, as this mostly tells you if you have missed a dimension in your equation, such as the 2D depth that is easily forgotten, or the 2D.axi loop length 2*pi*r ... -- Good luck Ivar

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.