|
[Sponsors] |
March 19, 2013, 09:46 |
Negative of a scalar s ??
|
#1 |
Member
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 14 |
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. |
|
March 19, 2013, 12:11 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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.
|
|
March 19, 2013, 14:42 |
|
#3 |
Member
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 14 |
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) = ? |
|
May 25, 2020, 07:34 |
|
#4 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
pos(s):
if s is positive or 0, then pos(s) = 1, else 0. neg(s): if s is negative, then neg(s) = 1, else 0. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
compressible flow in turbocharger | riesotto | OpenFOAM | 50 | May 26, 2014 02:47 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |