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.

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 2022年7月11日 GMT-4 09:40
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 2022年7月7日 GMT-4 08:32

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: 2 years ago 2022年7月7日 GMT-4 09:12

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: 2 years ago 2022年7月8日 GMT-4 05:38

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: 2 years ago 2022年7月11日 GMT-4 09:40

Ok I see. Thank you!

Ok I see. Thank you!

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.