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 set boundary condition on a part of a boundary

Please login with a confirmed email address before reporting spam

I import a geometry into COMSOL 5.2 through livelink for SolidWorks. And it's been divided into several domains and boundaries automatically.
But I have encountered a problem. I want to set boundary conditions on just a small part of a boundary. For example, there's a geometry -- a cube. And i want to set temperature condition on a triangle area on a surface. What can i do to make this happen?

5 Replies Last Post 27 juin 2016, 09:23 UTC−4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 avr. 2016, 11:29 UTC−4
You will need to draw that triangle on the surface, either in the CAD package (SolidWorks, for you) before you import it into COMSOL, or in COMSOL. See www.comsol.com/community/forums/general/thread/15263/#p246712 regarding the latter.
Best,
Jeff
You will need to draw that triangle on the surface, either in the CAD package (SolidWorks, for you) before you import it into COMSOL, or in COMSOL. See https://www.comsol.com/community/forums/general/thread/15263/#p246712 regarding the latter. Best, Jeff

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 avr. 2016, 17:16 UTC−4
Hi,

As long as the boundary condition is of Neumann type, another possibility is to write the load as a boolean expression based on the coordinates. Something like

17.4*(x>0.2)*(x<0.35)*(y<0.12)

This is of course only feasible for simple geometrical shapes of the loaded area. Also, the mesh must be fine enough, so that the discretization errors are small.

Actually the same idea can be used also for Dirichlet type boundary conditions, but with a little trick. If the degree of freedom is 'u', then the following expression for the value of a Dirichlet condition will prescribe u to 12 inside an area, and let u be free elsewhere:

if((x>0.2)*(x<0.35)*(y<0.12),12, u)

If anyone is curious about how this expression works, a Dirichlet condition is implemented as u - prescribed_value. But if the prescribed value happens to be 'u' itself, u - u will cancel during the symbolic evaluation and the constraint magically disappears.

Regards,
Henrik

Hi, As long as the boundary condition is of Neumann type, another possibility is to write the load as a boolean expression based on the coordinates. Something like 17.4*(x>0.2)*(x

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 20 avr. 2016, 03:00 UTC−4
Hi Henrik

Thanks for the nice trick, then it should also apply to other cases, such as T for temperature (in K) etc
Worth a Blog presentation with several examples on different physics, for me :)

--
Good luck
Ivar
Hi Henrik Thanks for the nice trick, then it should also apply to other cases, such as T for temperature (in K) etc Worth a Blog presentation with several examples on different physics, for me :) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 22 avr. 2016, 03:24 UTC−4
Thank you very much. I'll try that immediately
Thank you very much. I'll try that immediately

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 27 juin 2016, 09:23 UTC−4
Hi Ivar,

The blog post that you suggested is now published!

www.comsol.com/blogs/how-to-make-boundary-conditions-conditional-in-your-simulation/

Regards,
Henrik
Hi Ivar, The blog post that you suggested is now published! https://www.comsol.com/blogs/how-to-make-boundary-conditions-conditional-in-your-simulation/ Regards, Henrik

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.