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 set two conditions for one boundary condition(vector)?

Please login with a confirmed email address before reporting spam

Hi all,

I want to define two conditions for one part of rectangular that I have in 2D (xz) and put two different value of pressure head in one boundary condition,
like Hp=0 if z>= - 0.5159m
and Hp=0.05159 if z< - 0.5159m
how is it possible to write these in one boundary condition?
Attached screen shot for better explanation


5 Replies Last Post 20 mar 2014, 11:39 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 18 mar 2014, 09:47 GMT-4
I wrote expression in a way that I put the screenshot, But I confronted with this error,
I am new in comsol and I need your help.
Best
Sepideh
I wrote expression in a way that I put the screenshot, But I confronted with this error, I am new in comsol and I need your help. Best Sepideh


Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 mar 2014, 04:53 GMT-4
Hi,

Use the following expression:

0*(z>=- 0.5159)+0.05159*(z<- 0.5159)

or simpler just

0.05159*(z<- 0.5159)

Best regards,
Magnus Ringh, COMSOL
Hi, Use the following expression: 0*(z>=- 0.5159)+0.05159*(z

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 mar 2014, 08:59 GMT-4

Hi,

Use the following expression:

0*(z>=- 0.5159)+0.05159*(z<- 0.5159)

or simpler just

0.05159*(z<- 0.5159)

Best regards,
Magnus Ringh, COMSOL


Thanks for reply Magnus,
I tried with the first expression and I confronted with error in screen shot1, and then I tried with the second expression and I confronted with screen shot2.
I am new to comsol, therefore your comments will help me a lot.
Best,
Sepideh
[QUOTE] Hi, Use the following expression: 0*(z>=- 0.5159)+0.05159*(z


Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 mar 2014, 05:51 GMT-4
Hi again,

Could it be that none of your spatial coordinates is called z? Typically, in a 2D model, the spatial coordinate names are x and y.

Best regards,
Magnus Ringh, COMSOL
Hi again, Could it be that none of your spatial coordinates is called z? Typically, in a 2D model, the spatial coordinate names are x and y. Best regards, Magnus Ringh, COMSOL

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 mar 2014, 11:39 GMT-4
Thanks a lot it worked with "y", and I just defined one side of rectangle for two types of condition like this
(C1*(p<p1) + C2*(p>=p1)). C1 and C2 are conditions.
Hope it helps for others.
Sepideh
Thanks a lot it worked with "y", and I just defined one side of rectangle for two types of condition like this (C1*(p=p1)). C1 and C2 are conditions. Hope it helps for others. Sepideh

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.