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.

[solved] Call functions in 4.3a

Please login with a confirmed email address before reporting spam

Hi

I created an interpolation fonction in the global definitions node. I need to use that function as an excitation in a bondary condition and simulate according to that interpolation. So, I put "Int1" (without brackets) in the according space in the BC node. But, it appears with the orange color and I've got an error message telling me that Comsol doesn't understand the included function. I searched in the forum to no avail and the docs related to that point are quite vague concerning the calling of the functions.

How should I do to correctly call this type of functions in the simulation ?

Thanks a lot

2 Replies Last Post 19 nov. 2012, 05:32 UTC−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 17 nov. 2012, 09:24 UTC−5
Hi

first of all orange means normally unit incoherence, it's a Warning, not formally an Error, as COMSOL will calculate een if you have unit errors.

so first thing functions, if you have not defined explicitely in their definition that thy have units, do not transport with them the unts COMSOL expect to find, so often one need to add thse by a 1[W/m^2]*int1(...).

The second point is that normally a function has arguments and expression (or interpolation values), so you need to define the arguments in your funcion call, you need to set something in the brakets.

There are some cases when you can define imported multi argument functions as depending on the spatial variables, but then you should also take care to adapt accordingly offset and signs (directions). As your geoemtry might move around in space

--
Good luck
Ivar
Hi first of all orange means normally unit incoherence, it's a Warning, not formally an Error, as COMSOL will calculate een if you have unit errors. so first thing functions, if you have not defined explicitely in their definition that thy have units, do not transport with them the unts COMSOL expect to find, so often one need to add thse by a 1[W/m^2]*int1(...). The second point is that normally a function has arguments and expression (or interpolation values), so you need to define the arguments in your funcion call, you need to set something in the brakets. There are some cases when you can define imported multi argument functions as depending on the spatial variables, but then you should also take care to adapt accordingly offset and signs (directions). As your geoemtry might move around in space -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 nov. 2012, 05:32 UTC−5
Thanks for the reply.

According to what you have said, this is what I did :

In the global definitions, I declared "t" as a variable and I've put "t" as its expression. COMSOL seems to have understood that since it automatically put "s" as a unit.

In the boundary condition excitation space, I've put : "1[A/m^2]*int1(t[1/s])". This seems to be right since it's no more orange but finally black.

But when I run the simulation the result is wrong since I've got no excitation and all the values are null.

What have I missed, please ?

EDIT : Problem solved. Thanks for your help

Thanks for the reply. According to what you have said, this is what I did : In the global definitions, I declared "t" as a variable and I've put "t" as its expression. COMSOL seems to have understood that since it automatically put "s" as a unit. In the boundary condition excitation space, I've put : "1[A/m^2]*int1(t[1/s])". This seems to be right since it's no more orange but finally black. But when I run the simulation the result is wrong since I've got no excitation and all the values are null. What have I missed, please ? EDIT : Problem solved. Thanks for your help

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.