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.

[Comsol 3.5a heat transfer pb] Variable definition problem

Please login with a confirmed email address before reporting spam

Hello to all
I want to take a temperature in a boundary and define it with a specific variable name, for example myT=T and in the same analysis i want to define in another boundary an heat flux including the previous variable, for example h*(myT-T0).
What is the way to define this problem?
Thank you in advance

Luca

1 Reply Last Post 09.01.2010, 16:00 GMT-5
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: 1 decade ago 09.01.2010, 16:00 GMT-5
Hi

A would believe it depends somewhat how you build up your model and how many physics you have, but I would start regarding the "Options - Expressions - Boundary ..." to define "My_T" as "T". It is then only defined on that/those particular boundary(ies) selected at the variable definition time. If you want to have it as a "global" variable as T is a scalar you could use the "Options - Expressions - Scalar" but then there is no real difference between "T" and "My_T" they are just synonymes of the same value, while adding extra computation to the model, not the best for your case, but very usefull for postprocessing several physics with similar vcariables but of different names.

Now if you want to compute the mean value of T over a boundary to use that elsewhere, you should look at the "Integration Coupling Variables" then you need a 2 step approach: first to calculate the Vol=volume/Are=area/Len=length of your subdomain/boundary/edge respectively, by integrating "1", and then integrate T/Vol or T/Are or T/Len over the desired subdomain/boundary/edge item(s).
By the way integration of T^2/Vol or T^2/Are or T^2/Len is the variance of T, or the square of the rms value, etc.

Next step is to reuse this value on another boundary: here again, it depends on your model set up, if it is in another application domain probably you could use it "as is" at least if the first physics is solved before the second is treated, but that depends on your solving strategy: global/segregated ...
If not I would set up a global equation, that by default is solved for by minimising it to "0", in the same process as the rest of the model, The global equation should express the difference of My_T and the T_something, to finally make them the same. Take care with the signs and if the variable is complex, (probably not for your T), using the square of the difference could be safer, normalising it has also often some benefit, but that depends on the desired precision, and if you know how/with which value you can safely normalise it.

Hope this helps, there are examples around in the doc, but cannot hink of one particular one just like that
Good luck
Ivar
Hi A would believe it depends somewhat how you build up your model and how many physics you have, but I would start regarding the "Options - Expressions - Boundary ..." to define "My_T" as "T". It is then only defined on that/those particular boundary(ies) selected at the variable definition time. If you want to have it as a "global" variable as T is a scalar you could use the "Options - Expressions - Scalar" but then there is no real difference between "T" and "My_T" they are just synonymes of the same value, while adding extra computation to the model, not the best for your case, but very usefull for postprocessing several physics with similar vcariables but of different names. Now if you want to compute the mean value of T over a boundary to use that elsewhere, you should look at the "Integration Coupling Variables" then you need a 2 step approach: first to calculate the Vol=volume/Are=area/Len=length of your subdomain/boundary/edge respectively, by integrating "1", and then integrate T/Vol or T/Are or T/Len over the desired subdomain/boundary/edge item(s). By the way integration of T^2/Vol or T^2/Are or T^2/Len is the variance of T, or the square of the rms value, etc. Next step is to reuse this value on another boundary: here again, it depends on your model set up, if it is in another application domain probably you could use it "as is" at least if the first physics is solved before the second is treated, but that depends on your solving strategy: global/segregated ... If not I would set up a global equation, that by default is solved for by minimising it to "0", in the same process as the rest of the model, The global equation should express the difference of My_T and the T_something, to finally make them the same. Take care with the signs and if the variable is complex, (probably not for your T), using the square of the difference could be safer, normalising it has also often some benefit, but that depends on the desired precision, and if you know how/with which value you can safely normalise it. Hope this helps, there are examples around in the doc, but cannot hink of one particular one just like that Good luck Ivar

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.