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.

arbitrary volume integrals

Please login with a confirmed email address before reporting spam

Hi

I would like to know if it is possible to calculate a volume integral over an arbitrary (non-meshed) enclosed surface in the post-processing of a solution. An example might be integrating an electrical energy integral over a sphere and determining the change in that integral along a line.

thanks

Nicolas

5 Replies Last Post 21 oct. 2013, 09:40 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 oct. 2013, 07:56 UTC−4

Hi

I would like to know if it is possible to calculate a volume integral over an arbitrary (non-meshed) enclosed surface in the post-processing of a solution. An example might be integrating an electrical energy integral over a sphere and determining the change in that integral along a line.

thanks

Nicolas


"Volume integral over a surface"? You must draw a surface before calculating the solution; "change in that integral along a line"? You mean by varying the radius of the sphere? Then draw several (concentric?) spheres. Remember to include these extra spheres (or what ever they are) in the simulation domain.

Lasse
[QUOTE] Hi I would like to know if it is possible to calculate a volume integral over an arbitrary (non-meshed) enclosed surface in the post-processing of a solution. An example might be integrating an electrical energy integral over a sphere and determining the change in that integral along a line. thanks Nicolas [/QUOTE] "Volume integral over a surface"? You must draw a surface before calculating the solution; "change in that integral along a line"? You mean by varying the radius of the sphere? Then draw several (concentric?) spheres. Remember to include these extra spheres (or what ever they are) in the simulation domain. Lasse

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 oct. 2013, 09:07 UTC−4
Hi Nicolas,

If you want to compute integrals on the SURFACE of that sphere, then you should define a dataset of the parametric surface type and compute your integral on that dataset.

If you want to compute integrals on the VOLUME inside the sphere, then simply use an expression that vanishes outside the sphere: something like your_integrand*(((x-x0)^2+(y-y0)^2+(z-z0)^2)<r0^2)

See the attached file that computes the average temperature on the surface of a sphere and the average temperature inside a sphere.

Best,
Jeff
Hi Nicolas, If you want to compute integrals on the SURFACE of that sphere, then you should define a dataset of the parametric surface type and compute your integral on that dataset. If you want to compute integrals on the VOLUME inside the sphere, then simply use an expression that vanishes outside the sphere: something like your_integrand*(((x-x0)^2+(y-y0)^2+(z-z0)^2)


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 oct. 2013, 09:31 UTC−4
Hi

Thanks. I realise that my question was a bit confusing. I meant over the enclosed volume. I also specifically do not want to draw the domains and disrupt the mesh and I also want to be able to calculate this integral along a line through my simulation domain.

Nicolas
Hi Thanks. I realise that my question was a bit confusing. I meant over the enclosed volume. I also specifically do not want to draw the domains and disrupt the mesh and I also want to be able to calculate this integral along a line through my simulation domain. Nicolas

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 oct. 2013, 09:33 UTC−4
Hi

That looks ideal. I'll give it a shot and thanks for your time

Nicolas
Hi That looks ideal. I'll give it a shot and thanks for your time Nicolas

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 oct. 2013, 09:40 UTC−4
Hi

Using this method, do you have to define every point for the sphere centres manually or could you calculate this average temperature along a line, say straight through the middle of your domain from the high temperature side to the low temperature side (obviously truncated by the closest position being the radius of the spherical volume). This would be to determine the average temperature experienced by a particle whose centre obviously cannot be closer than one radius away from the surface).

thanks again

Nic
Hi Using this method, do you have to define every point for the sphere centres manually or could you calculate this average temperature along a line, say straight through the middle of your domain from the high temperature side to the low temperature side (obviously truncated by the closest position being the radius of the spherical volume). This would be to determine the average temperature experienced by a particle whose centre obviously cannot be closer than one radius away from the surface). thanks again Nic

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.