Comsol help write a boundary condition

Click For Summary

Discussion Overview

The discussion revolves around writing a boundary condition in COMSOL that depends on the gradient of a variable. Participants explore methods for implementing this in the software, including the use of internal functions and syntax derived from MATLAB.

Discussion Character

  • Technical explanation, Debate/contested, Experimental/applied

Main Points Raised

  • Lusann expresses difficulty in writing a boundary condition that relies on the gradient of a variable and notes a lack of adequate support documentation from COMSOL.
  • One participant suggests using the "diff" internal function to compute the gradient and incorporating it into the boundary condition.
  • Another participant mentions that familiarity with MATLAB can ease the transition to using COMSOL, and recommends utilizing the model library for guidance.
  • A later reply indicates that the "diff" function is not supported in version 4 of COMSOL, prompting a question about alternative methods for using it in that version.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to implement the gradient boundary condition, and there is uncertainty regarding the support for the "diff" function in different versions of COMSOL.

Contextual Notes

There are limitations regarding the specific version of COMSOL being discussed, as well as the availability of certain functions. Participants express varying levels of familiarity with the software and its documentation.

Lusann Yang
Messages
1
Reaction score
0
Hi there,

I'm using comsol for the first time, and I think I've got everything working, except that I need to write a boundary condition that is dependent upon the gradient of a variable. How do I tell Comsol to take the gradient? I suppose I can define my own function, but I don't even know where to begin... (Man, comsol's support is not up to par. I don't think they even have a list of functions available anywhere.)

Thanks so much,
Lusann
 
Engineering news on Phys.org
Hi, you could use the "diff" internal function or then its shorthand, like ux is diff(u,x) and then it in the BC. Yeah, getting going with this software isn't quite as fast as with several others.
 
All the syntax for COMSOL is taken from Matlab, so if you are familiar with the latter the former is pretty comfy. You can also send e-mails to help@comsol.com (or something like this) and they will tell you how to do stuff. There is also a forum on their website you can search, i often find helpful stuff there. Finally, the model library is very useful! Just find a model that is similar to yours and look inside to see how they did it. You can even save the whole model as an m-file and read out the syntax of all the commands.

Actually, i think there is even a gradient boundary condition type depending on what your application mode is... Just define the variable in the appropriate variable table and then insert it in the space provided in the boundary condition tab.
 
diff (u,x) is not supported in v4. Any idea how to use it there?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
17K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
12K