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.

Sum of variables in different domain definition

Please login with a confirmed email address before reporting spam

Hello everyone,

I would like to sum two variables define in two different domains.
The first domain (1) is included in the second one (2)

When i want to sum variables and plot it, i have only the plot of the intersection between the two domains but i want to have the plot inside the domains two (2) only, the bigger one.

I already tried to define variables of domain 1 equal to zero in domain 2, in order to have variable define in all the domain, but it didn't works.

Do you have any suggestions, advices or solutions ?


Regards

François

3 Replies Last Post Jun 27, 2017, 8:33 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jun 27, 2017, 5:16 a.m. EDT
Hi

You may sum up two global's (individual averages or integrals over each domains) but this is different than the total integral or average over both Entities (Domain or Boundaries ...)

But as most "variables" in COMSOL are in fact "fields" depending on (x,y,z) (and or time t or frequency f) you cannot "sum" them without having some mapping function to link Entities.

So what do you really want to do ?
and be aware of the implicit sums/integrations/averages of COMSOL

--
Good luck
Ivar
Hi You may sum up two global's (individual averages or integrals over each domains) but this is different than the total integral or average over both Entities (Domain or Boundaries ...) But as most "variables" in COMSOL are in fact "fields" depending on (x,y,z) (and or time t or frequency f) you cannot "sum" them without having some mapping function to link Entities. So what do you really want to do ? and be aware of the implicit sums/integrations/averages of COMSOL -- Good luck Ivar

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jun 27, 2017, 7:57 a.m. EDT
Updated: 7 years ago Jun 27, 2017, 8:07 a.m. EDT
Hello Francois,
Have you tried creating a third variable, and define it as var1+var2 in domain1 and var2 in the part of domain2 that is not in domain1?
See the attached file.
Best,
Jeff
Hello Francois, Have you tried creating a third variable, and define it as var1+var2 in domain1 and var2 in the part of domain2 that is not in domain1? See the attached file. Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jun 27, 2017, 8:33 a.m. EDT
Hello,

I found a solution, the problem was from variable divided by zero and after that the sum was not possible.

So i define a new variable (A) inside my domain 1 , which one depend from variables and i can do calculation (dividing up) inside my own domain 1.
I define A=0 everywhere else in domain 2

When i want to sum the new variable A with variable of domain 2, it works, the sum is effective in the whole domain 2.

thanks for your advice.
Hello, I found a solution, the problem was from variable divided by zero and after that the sum was not possible. So i define a new variable (A) inside my domain 1 , which one depend from variables and i can do calculation (dividing up) inside my own domain 1. I define A=0 everywhere else in domain 2 When i want to sum the new variable A with variable of domain 2, it works, the sum is effective in the whole domain 2. thanks for your advice.

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.