CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Negative of a scalar s ?? (http://www.cfd-online.com/Forums/openfoam-solving/114876-negative-scalar-s.html)

nikesh March 19, 2013 09:46

Negative of a scalar s ??
 
hii,
I have a small doubt I'd like to clarify. Hope somebody would help me out.
I understand that Positive of a scalar s is:

pos(s) = 1 if s>=0
= 0 if s<0

How can I express Negative of a scalar s?

neg(s) = ???

I'm assuming that this is possible BUT I find OpenFoam guide mentioning only about pos(s), but doesn't talk about neg(s). So just wanted to make sure.
I'm using OF version 1.7.1.

I'd appreciate any help.

Thanks in advance.
Nikesh.

mturcios777 March 19, 2013 12:11

I'm pretty sure there is a neg function, I did a quick search on the Doxygen docs and found several (in 2.2.x). You could also call pos(-s) and get near identical behaviour if your version of Foam doesn't have neg.

nikesh March 19, 2013 14:42

I tried using neg(s) in one of my codes and it does not seem to give me any error msg. But I'm still not sure what neg(s) would return.
neg(s) = ?


All times are GMT -4. The time now is 17:01.