# Discussion Forum

## Unexpected behaviour of "intop" function

Hi all!

First of all I'd like to thank this forum, here I have found many answers I needed before. But now I couldn't find any at all.

Thing is, I have a quite complicated 2D model of a superconducting magnet. My model is a transversal section of the magnet where we can see all the conductors as "domains" and the electric current is perpendicular to the plane.

The electrical resistivity of the conductor is a function of the temperature and magnetic field. So I imported a table and COMSOL interpolates it to obtain the resistivity, that works fine.

Now I need to implement an electric current that follows Where I0 and L are constants.

R is the resistivity (rho) integrated all over the conductor's domain, it reads:

I used "intop" to tackle this double integral over the conductor's domain, and the outer one is the length in the "z" direction.

COMSOL apparently does simulate with this setup, but the calculations are too too slow. It takes a lot of memory as well (plus than 80GB!) However, if I use I(t)=I0, it works nice and fast, so I'm sure there's a problem with the "intop" function.

So I ask you if there's something I am missing, or some suggestions to make the simulation faster.

Lucas

2 Replies Last Post 21 mag 2019, 14:06 GMT-4

Posted: 3 months ago

After all it wasn't "intop" causing troubles. COMSOL does evaluate the integrals with little effort.

The problem was that I implemented I(t) as a Heat Source source term in

When I did everything worked like a charm, so it must have something to do with the methodology COMSOL utilises to evaluate power of functions.

Something like the difference of using a*a and pow(a,2) in a C code.

Anyways, if someone happens to know the explanation I'd be glad to hear about it.

Thanks

Lucas

Posted: 3 months ago

Hi Lucas,

interesting catch, thanks for sharing. A good C-compiler would typically optimize this automatically for integer constant powers. I would also appreciate to hear more about that.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com