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.

"NullPointerException" Error related to Material Switch

Please login with a confirmed email address before reporting spam

Hello everyone, I bumped into this singular error and I was wondering if it occurred to someone else. The context is the following. I have a very simple 2D enclosure domain, which feature the same fluid material everywhere. I want to run a natural convection heat transfer simulation with it, comparing the results I obtain with three different fluids. Therefore, I set up a Switch Material node including them all (I created the fluids from scratch as blank materials, customizing the required properties under the subnode "Basics"). However, I realized later that I made a mistake, so I tried to drag one of the material out of the switch node, and here the problem occurred. A window (simply titled "Error") popped up, showing this message: "An unexpected error occurred. See the end of log file for details". So I opened the log and I found the following lines near the end of it:

ERROR A function link could find the source 'root.comp1.sw1.mat1.def.rho_BF'. [com.comsol.util] java.lang.NullPointerException: A function link could find the source 'root.comp1.sw1.mat1.def.rho_BF'.

which makes me think that the error is related to the definition of the density "rho_BF" for the fluid called "BF". This is quite annoying, because the above error message keeps popping up every time I click on any subnode under the Materials node. It continues to appear also when I try to open another Comsol file, by clicking on File->Open etc and choosing "No" when Comsol asks me if I want to save the current file. So, the only way I have to go on is to close Comsol and start a new session.

Could someone help me, please? Thank you so much Kind regards

[EDIT #1] The error doesn't occur when I try do to the same action (dragging one of the materials out from the switch node) on another PC, where I have the same version of COMSOL (5.4) but another SO, i.e. Windows 10 Home 64bit instead of Windows 7 Professional 64bit, which is the OS of the PC where the error occurred. Btw, several OS updates were missing from the PC with W7, so I'm trying to install them, uninstall COMSOL and re-install it. I will write here if it works.

[EDIT #2] The above trial didn't work. The issue is still open :'(


0 Replies Last Post 21 oct. 2020, 11:45 UTC−4
COMSOL Moderator

Hello Daniele

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.