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.
Integrating over a portion of a 3D domain?
Posted 2015/09/14 17:07 GMT-4 Parameters, Variables, & Functions, Results & Visualization Version 4.4 7 Replies
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
If it is not possible to add such a region and high accuracy is not crucial, integrate over a larger domain while using a boolean expression in your integrand.
Jeff
Please login with a confirmed email address before reporting spam
I'll also have to look into how to add a boolean to the integrand. That's new territory for me.
Thanks,
Paul
Please login with a confirmed email address before reporting spam
Say that you want to integrate u^2 but not over the whole domain. You only want the integration where X>17 and Y<4711. Then you can integrate the expression
(X>17)*(Y<4711)*u^2
The logical expressions evaluate to either 1 or 0.
Regards,
Henrik
Please login with a confirmed email address before reporting spam
in which way is using the boolean expression in the integrand affecting precision?
Cheers
Edgar
--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Please login with a confirmed email address before reporting spam
That makes that nice and simple! Thank you.
Paul
Please login with a confirmed email address before reporting spam
When carrying out numerical integration by Gaussian quadrature, if you use the boolean expression approach instead of the separate domain approach you're putting yourself at the mercy of elements that sit on both sides of the boolean condition: how many of their quadrature points are on each side and what their weights are is rather unpredictable.
Example: Set up a Laplace equation model on the canonical square [0,1]x[0,1], so that the solution is u=1. Mesh it with a single rectangular element. COMSOL captures the trivial solution perfectly, of course. But compute the integral of u over [0,.6]x[0,1] using the boolean approach and you'll get ~.722 because of where the Gauss points are and of their weights. ( As a side note, if you reduce the quadrature order from the default 4 to 3, you'll get .5 because then half the Gauss points and half the weights sit on each side of the x=.6 line).
On the other hand, if you split the domain into two at x=.6, you'll get the correct solution: .6.
Jeff
Please login with a confirmed email address before reporting spam
thanks for the explanation. So, small domains with few inner and relatively many edge (at the boolean edge) elements are more susceptible to this kind of numerical error.
Cheers
Edgar
--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
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.
Suggested Content
- FORUM Integrating an expression over discrete volumes within a domain
- KNOWLEDGE BASE Solving electromagnetic heating models with high-frequency loads
- FORUM Integrating over Poynting vector
- BLOG Studying Stress in Threaded Pipe Fitting Designs from CAD Assemblies
- FORUM Integrating over an arbitrary line
