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, 08:46
Default Negative of a scalar s ??
  #1
Member
 
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 13
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, 11: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, 13:42
Default
  #3
Member
 
Nikesh Bhattarai
Join Date: Nov 2011
Location: Sacheon, South Korea
Posts: 82
Rep Power: 13
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, 06:34
Default
  #4
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
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 17:22
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 04:00.