How can I extract the values of the variable at the mesh nodes and use them as an input during simulation?

Please login with a confirmed email address before reporting spam

Hi

Suppose I defiend a variable using Coefficient form PDE, and it is defined in the material frame. has different initial values at different coordinates. The values of will change with time at some coordinates while others will not.

Due to the requirement of my study, I need to know the values of at each node in real-time. And use them as an input to another physics interface.

I have tried the 'probe' function, but it only allows me to access the maximum, minimum, average and integral of the variable in a specific domain, boundary or point. There is another function, 'Domain point probe', which allows me to access the exact value of at a fixed coordinate. But I need to access the values at all the nodes, and it would be a bad idea to define millions of 'Domain point probe' manually.

So I wonder if there is any method to achieve such operation in an elegant way in COMSOL. Any suggestion will be much appreciated.

Best Runzi


4 Replies Last Post Jul 11, 2022, 9:40 a.m. EDT
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Jul 7, 2022, 8:32 a.m. EDT

You can simply use comp1.pde.phi in the other physics, if pde is the tag of the pde physics. Comsol takes care of the spatial reference on the repective entity. No need for any probes.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
You can simply use comp1.pde.phi in the other physics, if pde is the tag of the pde physics. Comsol takes care of the spatial reference on the repective entity. No need for any probes.

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Jul 7, 2022, 9:12 a.m. EDT

Hi Kaiser

Thank you for your reply!

The thing is, I want to do operations based on the values of . For example: if(>0,output1,NaN), and then I use 'output1' in another interface. I'm wondering where could I apply the condition statement if I want it to make judgements on every node in a 2D domain.

Best Runzi

Hi Kaiser Thank you for your reply! The thing is, I want to do operations based on the values of \phi. For example: if(\phi>0,output1,NaN), and then I use 'output1' in another interface. I'm wondering where could I apply the condition statement if I want it to make judgements on every node in a 2D domain. Best Runzi

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Jul 8, 2022, 5:38 a.m. EDT

You can apply boolean expressions like output1*(phi>0). I don't think you can apply NaN anywhere.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
You can apply boolean expressions like output1*(phi>0). I don't think you can apply NaN anywhere.

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Jul 11, 2022, 9:40 a.m. EDT

Ok I see. Thank you!

Ok I see. Thank you!

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.