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 2 sept. 2009, 09:14 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 1 sept. 2009, 20:32 UTC−4
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: 2 decades ago 2 sept. 2009, 09:14 UTC−4
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.