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 Dec 23, 2022, 12:33 p.m. EST
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago Dec 21, 2022, 10:57 a.m. EST
Updated: 2 years ago Dec 22, 2022, 8:36 a.m. EST

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 Dec 21, 2022, 7:09 p.m. EST

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 Dec 21, 2022, 7:30 p.m. EST

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 Dec 22, 2022, 8:46 a.m. EST
Updated: 3 months ago Apr 8, 2024, 2:37 p.m. EDT

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 Dec 23, 2022, 12:32 p.m. EST

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 Dec 23, 2022, 12:33 p.m. EST

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

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.