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.

Math Operator Question

Please login with a confirmed email address before reporting spam

Hey guys,

Just had a question about math operators. I'm a little new to comsol.

Let's say I'm working with a heat source term in nonisothermal flow. On my Q, I defined Q as a function in the variables section. But, what if I want Q to be the calculated value of the function I already defined for only certain values.

What I have now:

Q = Qdefined*(Qdefined>0)

which I'm taking to mean, if the calculated Q is greater than 0, use that value. But what exactly does the *Qdefined>0 mean? Does it mean that it's 0 for all other values?

If not, what mathematical operator do I use so that if Q is NOT a positive number calculated by the function (i.e negative or 0), it gives 0 as the answer.

Thanks!

1 Reply Last Post 2012年6月25日 GMT-4 10:21
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 2012年6月25日 GMT-4 10:21
Hi

the (Qdefined>0) is a Bolena operator, giving 0 if not true and 1 if true, so if true Q=Qdefined, ifnot Q=0 in your case

Note that such hard "dirac type transition can make life tough for the solvers, often it's worth to consider smoothing the transition with a "step()" operator or whatever applies (but simetimes its OK, all model dependent)

--
Good luck
Ivar
Hi the (Qdefined>0) is a Bolena operator, giving 0 if not true and 1 if true, so if true Q=Qdefined, ifnot Q=0 in your case Note that such hard "dirac type transition can make life tough for the solvers, often it's worth to consider smoothing the transition with a "step()" operator or whatever applies (but simetimes its OK, all model dependent) -- 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.