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.

operations involving derived values

Please login with a confirmed email address before reporting spam

Hello, In the Results node, I would like to evaluate expressions and formulas involving derived values. For example, in a 2D problem, I need to divide a line averaged value (temperature, magnetic induction, it does not matter) obtained averaging on a select 1D element, by , for instance, a surface obtained by integration on a 2D (obviously) different element. I do not succeed to make simple operations (x,+,-,/) on derived values when they refer to different elements. Yes, I can do it later by hand but I would like Comsol to do these calculations for me, expecially in a parametric sweep. Thank you in advance.


1 Reply Last Post 31 gen 2023, 09:09 GMT-5
Dmitry COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31 gen 2023, 09:09 GMT-5

Hello!

You can do it, if you add Average and Inegration operators to the Definitions node, click Update solution and add the Global Evaluation node to the Derived Values. Then in the expression field of Global Evaluation enter aveop1(T)/intop1(T). Here aveop1 and intop1 are the names of Average and Inegration operators. You can define these operators on different geometric entities, for example, Average could be defined on a 1D line, and Inegration could be defined on a 2D surface. T is the variable that you want to average or to integrate (you can use different variables as operators arguments). Update solution is neccessary if you define Average and Inegration operators when solution is already obtained. This will make these operators available in Results without resolving the model.

-------------------
Best regards,
Dmitry Lazarev
Hello! You can do it, if you add *Average* and *Inegration* operators to the *Definitions* node, click *Update solution* and add the *Global Evaluation* node to the *Derived Values*. Then in the expression field of *Global Evaluation* enter *aveop1(T)/intop1(T)*. Here *aveop1* and *intop1* are the names of *Average* and *Inegration* operators. You can define these operators on different geometric entities, for example, *Average* could be defined on a 1D line, and *Inegration* could be defined on a 2D surface. *T* is the variable that you want to average or to integrate (you can use different variables as operators arguments). *Update solution* is neccessary if you define *Average* and *Inegration* operators when solution is already obtained. This will make these operators available in *Results* without resolving the model.

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.