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 to impose a boundary condition that is spatially varying

Please login with a confirmed email address before reporting spam

Hi, I am wondering how one can impose a boundary condition that is spatially changing. For example, if I have a boundary 0<x<1. The concentration along this boundary is c=x^2 or a general function c = f(x). How could I implement this in Comsol? I tried in boundary settings c=x^2. But it seems not working.

Thanks.

2 Replies Last Post Sep 2, 2009, 9:14 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 1, 2009, 8:32 p.m. EDT
You can try using the functions definition dialog (Options->Functions) and define a new function (analytic is usually fine) and then in the Expression field you can define your expression X^2 or what not. Then in the boundary conditions dialog you just set the appropriate type of boundary condition and specify your function as the condition with whatever parameters are nessecary.

So if your function is defined as C(q) = q^2, then in the boundary dialog you can put C(x) if the variation is in the x direction.

~Jon
You can try using the functions definition dialog (Options->Functions) and define a new function (analytic is usually fine) and then in the Expression field you can define your expression X^2 or what not. Then in the boundary conditions dialog you just set the appropriate type of boundary condition and specify your function as the condition with whatever parameters are nessecary. So if your function is defined as C(q) = q^2, then in the boundary dialog you can put C(x) if the variation is in the x direction. ~Jon

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 2, 2009, 9:14 a.m. EDT
Thanks, it works now.
Thanks, it works now.

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.