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.

Unable to call external data file

Please login with a confirmed email address before reporting spam

Does anyone know how to import an external data file as a heat source. I am trtying to do it but when I call it, I get this error message of "unknown function or variable". Not sure what's going on.

To import an external data file,

I am going to function>interpolation>import data file, the fucntion has a name to call, lets say int1, but I am unable to call it.

In the heat transfer module, in place of Q0, I try to call it by int1, and with arguments int1(x,y,z), still get the error. Any suggetsions are welcome.


6 Replies Last Post 23 dic 2022, 12:33 GMT-5
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 21 dic 2022, 10:57 GMT-5
Updated: 2 years ago 22 dic 2022, 08:36 GMT-5

One possibility is that you are trying to call the function outside of its geometric scope, see this old thread. If that's not the issue, can you upload the model file?

Jeff

-------------------
Jeff Hiller
One possibility is that you are trying to call the function outside of its geometric scope, see [this old thread](https://www.comsol.com/forum/thread/312723/unknown-variables?last=2022-09-01T17:32:02Z). If that's not the issue, can you upload the model file? Jeff

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 21 dic 2022, 19:09 GMT-5

Hi Jeff,

Thank you very much for the response. I dont quite understand how to call the fucntion outside its geomtric scope when I am not able to assign a geometry to it. Proabably I am missing something here. I have attached my model file, please have a look at it and let me know where I am doing wrong exactly.

Regards, Kunjalata

Hi Jeff, Thank you very much for the response. I dont quite understand how to call the fucntion outside its geomtric scope when I am not able to assign a geometry to it. Proabably I am missing something here. I have attached my model file, please have a look at it and let me know where I am doing wrong exactly. Regards, Kunjalata


Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 21 dic 2022, 19:30 GMT-5

I encourage you to upload the external data file as well.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I encourage you to upload the external data file as well.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 22 dic 2022, 08:46 GMT-5
Updated: 8 months ago 8 apr 2024, 14:37 GMT-4

Hello Kunjala,

1/ I would place the definition of int1 in Component1, not in Global Definitions since it appears you want to use it for a spatially-dependent function in Component1.

2/ Your definition of int1 states it takes 2 arguments, but then you call it with 3?!? There's clearly an issue there.

Jeff

-------------------
Jeff Hiller
Hello Kunjala, 1/ I would place the definition of int1 in Component1, not in Global Definitions since it appears you want to use it for a spatially-dependent function in Component1. 2/ Your definition of int1 states it takes 2 arguments, but then you call it with 3?!? There's clearly an issue there. Jeff

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 23 dic 2022, 12:32 GMT-5

Hi Jeff,

Thanks a lot.

It works now.

Kunjalata

Hi Jeff, Thanks a lot. It works now. Kunjalata

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 23 dic 2022, 12:33 GMT-5

I encourage you to upload the external data file as well.

Hi Robert,

Thanks a lot for the response. It works now.

kunjalata

>I encourage you to upload the external data file as well. Hi Robert, Thanks a lot for the response. It works now. kunjalata

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.