CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Negative of a scalar s ??

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2013, 09:46
Default Negative of a scalar s ??
  #1
Member
 
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 14
nikesh is an unknown quantity at this point
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.
nikesh is offline   Reply With Quote

Old   March 19, 2013, 12:11
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   March 19, 2013, 14:42
Default
  #3
Member
 
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 14
nikesh is an unknown quantity at this point
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) = ?
nikesh is offline   Reply With Quote

Old   May 25, 2020, 07:34
Default
  #4
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8
geth03 is on a distinguished road
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.
geth03 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 21:02.