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.

average of parametric sweep solutions.

Please login with a confirmed email address before reporting spam

Hi all,

I'm simulating the effect on heating uniformity of a sample by moving a stirrer within a microwave reactor.

The stirrer position is given by a parameter related to its rotation angle, and I want to average the power loss density (emw.Qe) of all stirrer positions to then evaluate the power loss uniformity over a full stirrer rotation.

I tried to do an operation based in "with" and "sum" operators of the form:

(sum(with(i,emw.Qe,i,1,37))/36

However, I can't use the "with" operator as it gives an error of the solution specification being nonscalar or out of range. I think this is because is not meant for parametric sweep, but for a parametric solver; however, giving that I'm changing the geometry of the problem, a parametric sweep should be the way to go.

I could use "withsol" operator to call all the specific solutions, but as this requieres to input a string tag of the form 'solN', something like

(withsol('sol3',emw.Qe)+withsol('sol4',emw.Qe)+...+withsol('solN',emw.Qe))/(N-2)

However, as I'm dealing a large number of solutions, this requieres a really long line of code for averaging them all, and COMSOL seems to limit the maximum extension on the expr boxes. I'm not sure if "sum" could be used to pass the tags to "withsol" to reduce the length of the expression).

Thanks


2 Replies Last Post 24 giu 2019, 16:51 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 17 giu 2019, 09:07 GMT-4
Updated: 5 years ago 17 giu 2019, 09:07 GMT-4

Update: Sorry, COMSOL is able to handle the long expr, it was I syntax error.

Update: Sorry, COMSOL is able to handle the long expr, it was I syntax error.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 24 giu 2019, 16:51 GMT-4
Updated: 5 years ago 24 giu 2019, 16:46 GMT-4

Yo ucan use this expression to do averaging.
Sum(withsol('sol1', emw.Qe, setind(theta, i)), i, 1,36)/36

There t theta is the name of the paramter sweeped . 'Sol1' is the tag of the paramteric solver.

Yo ucan use this expression to do averaging. Sum(withsol('sol1', emw.Qe, setind(theta, i)), i, 1,36)/36 There t **theta** is the name of the paramter sweeped . 'Sol1' is the tag of the paramteric solver.

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.