Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

defining a variable for each element

Please login with a confirmed email address before reporting spam

hi ,
i would like to know how can i define a variable (which i am using in calculating other properties of the material) such that it is solved for each element separately ?
Right now what COMSOL does is solve for a time step and use that value to calculate material properties for all elements together , whereas i would like COMSOL to solve that variable for all elements differently (much like temperature in heat transfer) in each time step.

- Hirendra

5 Replies Last Post 18 mag 2012, 03:55 GMT-4
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 15 mag 2012, 08:19 GMT-4
Hi

I'm not sure I catch you correctly but with COMSOL, most variables are fields defined per f(x,y,z,t), only global variables (integrated over dx,dy,dz hence only F(t)), are available everywhere.

but perhaps you are looking for a custom defined dependent variable, in chich case you must add a ODE or a weak expression

--
Good luck
Ivar
Hi I'm not sure I catch you correctly but with COMSOL, most variables are fields defined per f(x,y,z,t), only global variables (integrated over dx,dy,dz hence only F(t)), are available everywhere. but perhaps you are looking for a custom defined dependent variable, in chich case you must add a ODE or a weak expression -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 17 mag 2012, 06:10 GMT-4
hi Ivar ,
i have tried doing that , i added a PDE(c) defining 'u' such that du/dt = (T>=T_vap) and then used this variable 'u' to calculate material properties for example Cp_steel*(u==0)+Cp_air*(u>0) , but as soon as u>0 (initial value of u was 0 ) , the material property for every element became the same which i don't want . I want that u should be calculated at every node just like Temperature.
i hope i am able to explain my problem.
- Hirendra
hi Ivar , i have tried doing that , i added a PDE(c) defining 'u' such that du/dt = (T>=T_vap) and then used this variable 'u' to calculate material properties for example Cp_steel*(u==0)+Cp_air*(u>0) , but as soon as u>0 (initial value of u was 0 ) , the material property for every element became the same which i don't want . I want that u should be calculated at every node just like Temperature. i hope i am able to explain my problem. - Hirendra

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 17 mag 2012, 07:44 GMT-4
Hi

still I do not catch your formulas, probably because for me "u" is a reserved variable name of COMSOL for solid and CFD and other physics. You should try to avoid all single letter variable nemaes, most are already used by COMSOL

Then you must define the PDE as a domain equation and not a global equation, your variable should be a field u(x,y,z,t) and not just u(t)


--
Good luck
Ivar
Hi still I do not catch your formulas, probably because for me "u" is a reserved variable name of COMSOL for solid and CFD and other physics. You should try to avoid all single letter variable nemaes, most are already used by COMSOL Then you must define the PDE as a domain equation and not a global equation, your variable should be a field u(x,y,z,t) and not just u(t) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 18 mag 2012, 01:50 GMT-4
Thanks a lot Ivar :) after using domain ODE i got the results .
I would like to know how can i make my problem converge faster , any tips ?

Thanks once again
- Hirendra
Thanks a lot Ivar :) after using domain ODE i got the results . I would like to know how can i make my problem converge faster , any tips ? Thanks once again - Hirendra

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 18 mag 2012, 03:55 GMT-4
Hi

often by starting with initial value closer to the result, the solver gets their quicker, but its a type of chicken an egg loop

--
Good luck
Ivar
Hi often by starting with initial value closer to the result, the solver gets their quicker, but its a type of chicken an egg loop -- 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.