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.

Sequential solution for multiple point sources

Please login with a confirmed email address before reporting spam

I'm currently trying to do a cross-well EM forward model and having some difficulties. In my survey, I have multiple different locations at which a transmitter is located (say, 5 in one well and 5 in another). I've defined a survey area and a set of points within that area. I'm using the RF module for electromagnetic waves. What I'm doing is calling comsol from matlab, specifying one of the points as a magnetic point dipole, and calculating the forward model. I then output the results, and modify the model so that the next point in my list is a magnetic point dipole.

Now, this works - I can get a sufficiently acceptable overall model. However, it is very, very slow - many small cells in a 3D model, and more importantly each time I call COMSOL it recalculates the entire problem with the new source. Mathematically, this shouldn't be an issue - all that changes in the equation is the right hand side. However, if I understand what comsol is doing correctly, it recalculates the full stiffness matrix solution again. This adds a significant amount of time to the solution of the problem.

The main question out of all of this: is there a way to solve, sequentially, for multiple point sources without having to completely recalculate the entire problem? ie can the stiffness matrix be saved, or can comsol somehow sweep through a series of magnetic point dipoles?

1 Reply Last Post 2011年10月19日 GMT-4 04:47

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年10月19日 GMT-4 04:47

(...)
The main question out of all of this: is there a way to solve, sequentially, for multiple point sources without having to completely recalculate the entire problem? ie can the stiffness matrix be saved, or can comsol somehow sweep through a series of magnetic point dipoles?

Kris,
The parametric sweep feature in COMSOL is designed to handle this. Add a parametric sweep and sweep the parameter P1 (say) over 1, 2, 3 etc.

In a point source, set source magnitude to if(P1==1,M1,0) . In the next source, set if(P1==2,M2,0) . This way source 1 will have magnitude M1 if P1 is 0, else the source will be 0 and so on. If the "else" value is always zero you can use the shorthand notation M1*(P1==1) and get the same results.

If you do this with a parametric sweep, the COMSOL solvers will not recompute the Jacobian (stiffness matrix for a linear problem) between cases, unless it is needed. Further, the COMSOL solvers will not repeat a factorization for a direct solver and the iterative solvers will not perform the tasks not needed between parameter cases.

The parameter P1 must be defined in the Global Definitions node at the top. For a tutorial how to set up a parametric sweep, see page 64 in this tutorial:
www.comsol.com/shared/downloads/IntroductionToCOMSOLMultiphysics.pdf

regards
Niklas
[QUOTE] (...) The main question out of all of this: is there a way to solve, sequentially, for multiple point sources without having to completely recalculate the entire problem? ie can the stiffness matrix be saved, or can comsol somehow sweep through a series of magnetic point dipoles? [/QUOTE] Kris, The parametric sweep feature in COMSOL is designed to handle this. Add a parametric sweep and sweep the parameter P1 (say) over 1, 2, 3 etc. In a point source, set source magnitude to [b]if(P1==1,M1,0)[/b] . In the next source, set [b]if(P1==2,M2,0)[/b] . This way source 1 will have magnitude M1 if P1 is 0, else the source will be 0 and so on. If the "else" value is always zero you can use the shorthand notation [b]M1*(P1==1)[/b] and get the same results. If you do this with a parametric sweep, the COMSOL solvers will not recompute the Jacobian (stiffness matrix for a linear problem) between cases, unless it is needed. Further, the COMSOL solvers will not repeat a factorization for a direct solver and the iterative solvers will not perform the tasks not needed between parameter cases. The parameter P1 must be defined in the Global Definitions node at the top. For a tutorial how to set up a parametric sweep, see page 64 in this tutorial: http://www.comsol.com/shared/downloads/IntroductionToCOMSOLMultiphysics.pdf regards Niklas

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.