|
[Sponsors] |
February 25, 2011, 13:41 |
heaviside?
|
#1 |
New Member
Martine Ginette
Join Date: Feb 2011
Posts: 5
Rep Power: 0 |
Dear Open Foam Community,
I am a brand new to OpenFoam. I would like to create a field like Code:
volScalarField toto = toto1 * heaviside(phi) + toto2 * heaviside(-phi); Many thanks in advance, Martin. |
|
February 25, 2011, 14:00 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Martine
You could use either of the functions Foam::neg or Foam:os. These functions return 1 if the argument is negative (positive) and 0 if the argument is positive (negative). I do not know how the functions handles 0, however. Best regards, Niels |
|
February 25, 2011, 14:24 |
|
#3 |
New Member
Martine Ginette
Join Date: Feb 2011
Posts: 5
Rep Power: 0 |
Indeed!
Thanks so much, Niels! Martin. PS: Is there a way to close the thread and tag is "solved"? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Heaviside Function | MCDG | CFX | 1 | December 3, 2007 03:32 |
smoothed interface capturing method: compressible. | jinwon | Main CFD Forum | 0 | May 14, 2007 00:20 |
Heaviside Function? | Zhou Hua | Main CFD Forum | 2 | December 8, 2003 05:10 |