Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

IF OPERATOR

Please login with a confirmed email address before reporting spam

Hi,
I am solving the Helmholtz equation and I would like to use the IF operator such that when the dependent variable u > uref, then I specify the parameter c = 100 and when u < uref, c = 10.

Can I use IF(u>uo,100,10) when specifying the value of c? Because u is also a dependent variable, I am not sure if this is permitted in COMSOL.

To make it more simple, suppose that you are solving a heat transfer equation and you want to specify the thermal conductivity such that when the temperature is less than a certain value, you let the thermal conductivity be A and when it is greater, then the thermal conductivity is B.

Can anyone help with this?

Thanks.

Sincerely,
EH


1 Reply Last Post 3 ott 2011, 09:21 GMT-4
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: 1 decade ago 3 ott 2011, 09:21 GMT-4
Hi

what happens when the variable is equal the test value ? then how to define a derivative (left/right ?)

using if(u,,) means that depending on the diplacement something happens with your value, as u=u(x,y,z) it might differe when and where it happns, I believe it should work, but you should ensure you have a rather smooth derivable transition, else you might have a serious convergence issue.

You might also get into a circular dependence if you loop your variables in the wrong way, to be checked carefully

--
Good luck
Ivar
Hi what happens when the variable is equal the test value ? then how to define a derivative (left/right ?) using if(u,,) means that depending on the diplacement something happens with your value, as u=u(x,y,z) it might differe when and where it happns, I believe it should work, but you should ensure you have a rather smooth derivable transition, else you might have a serious convergence issue. You might also get into a circular dependence if you loop your variables in the wrong way, to be checked carefully -- Good luck Ivar

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.