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
08.04.2012, 04:22 GMT-4
Hi
I agree at the beginning the function definitions can be surprising, mostly COMSOL proposes a name for the argument and the expression, but it's a dummy argument only used for the function definition, you can define it with a t (usually used for time) but then call it with a T temperature or x, position or u displacement etc.
Think of the definition argument as a name separted from the final one, a "dummy" argument.
Depending on which funtion you choose you can overwrite the argument name and use something closer to your wish, but not in all cases.
"t" is a default definition set to time, so you cannot use t for both time and dummy argument T within the same expression. so there you must find another way around.
Then do not forget that using boolean expressions makes Dirac function steps in the expression, and these are very difficult to handle for the solver, as the solving process uses the estimated derivatives of te expressions for the slope estimation, and at a step you have 2 or more derivatives hence convergence isues when solving. The rect() or step() built in functions are there to give you smooth but steep transition, continuously (or at least a couple of times) derivative
--
Good luck
Ivar
Hi
I agree at the beginning the function definitions can be surprising, mostly COMSOL proposes a name for the argument and the expression, but it's a dummy argument only used for the function definition, you can define it with a t (usually used for time) but then call it with a T temperature or x, position or u displacement etc.
Think of the definition argument as a name separted from the final one, a "dummy" argument.
Depending on which funtion you choose you can overwrite the argument name and use something closer to your wish, but not in all cases.
"t" is a default definition set to time, so you cannot use t for both time and dummy argument T within the same expression. so there you must find another way around.
Then do not forget that using boolean expressions makes Dirac function steps in the expression, and these are very difficult to handle for the solver, as the solving process uses the estimated derivatives of te expressions for the slope estimation, and at a step you have 2 or more derivatives hence convergence isues when solving. The rect() or step() built in functions are there to give you smooth but steep transition, continuously (or at least a couple of times) derivative
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
29.04.2012, 14:41 GMT-4
Thanks, Ivar.
Just to be clear then, what variable should I be using when trying to reference the material properties? I tried using other dummy variables such as k(S) but S was not really defined anywhere and is now giving me issues with the Jacobian. What would you suggest I do?
Thanks.
Thanks, Ivar.
Just to be clear then, what variable should I be using when trying to reference the material properties? I tried using other dummy variables such as k(S) but S was not really defined anywhere and is now giving me issues with the Jacobian. What would you suggest I do?
Thanks.
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
29.04.2012, 15:23 GMT-4
Hi
if you define a function with an internal argument such as "t" i.e. my_k(t), then you might call it somehere inside a COMSOL entry field by my_k(T), COMSOL will map "T" to the internal argument name "t" of your function and give out the result.
he only thing you must check are the units, either they are defined in the function (possible for certain functions) or you must pass the argument unitless, and add units on to the results such as "my_k(T[1/K])*1[W/m/K]" where T is mapped to a number reppresented by an absolute Kelvin value, and my_k is returned with heat conduction units
Hope it's clearer ;)
--
Good luck
Ivar
Hi
if you define a function with an internal argument such as "t" i.e. my_k(t), then you might call it somehere inside a COMSOL entry field by my_k(T), COMSOL will map "T" to the internal argument name "t" of your function and give out the result.
he only thing you must check are the units, either they are defined in the function (possible for certain functions) or you must pass the argument unitless, and add units on to the results such as "my_k(T[1/K])*1[W/m/K]" where T is mapped to a number reppresented by an absolute Kelvin value, and my_k is returned with heat conduction units
Hope it's clearer ;)
--
Good luck
Ivar
Nagi Elabbasi
Facebook Reality Labs
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
29.04.2012, 23:41 GMT-4
As Ivar mentioned the “t” is just a dummy argument. You should call the function with “T” instead and check the units. If I understand your intent correctly I would define k as: k_material1(T)*(t<200)+k_material2(T)*(t>=500)+k_material3(T)*(t>=200)*(t <500).
Nagi Elabbasi
Veryst Engineering
As Ivar mentioned the “t” is just a dummy argument. You should call the function with “T” instead and check the units. If I understand your intent correctly I would define k as: k_material1(T)*(t=500)+k_material3(T)*(t>=200)*(t
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
09.05.2012, 04:30 GMT-4
Thank you for your help! :)
Thank you for your help! :)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
20.06.2012, 17:06 GMT-4
I did a simpler model to double check that everything is working correctly and it seems like the model is only working for part of it.
This is what I am inputting for the thermal properties under Head Transfer in Solids:
material1*(t<200)+material2*(200<=t<300)+material3*(t>=300)
where material1, material 2, material 3 are interpolation functions that were imported under global definitions. Under the t column, Temperatures were imported, and under the f(t) column, the material properties were inputed. The model seems to switch the material properties correctly at Temperature=200 but instead of using the properties of material 3 after Temperature=300, the model continues to use the properties of material 2. Is the syntax I am using correct? Or how can I solve this problem?
Thank you!
I did a simpler model to double check that everything is working correctly and it seems like the model is only working for part of it.
This is what I am inputting for the thermal properties under Head Transfer in Solids:
material1*(t
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
20.06.2012, 19:03 GMT-4
Please disregard my previous message. I did not correctly read your earlier response and therefore did not implement the correct syntax you had suggested. Sorry about that. Thanks for your help!
Please disregard my previous message. I did not correctly read your earlier response and therefore did not implement the correct syntax you had suggested. Sorry about that. Thanks for your help!