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/)
-   -   allowed functions in funkySetFields expression (http://www.cfd-online.com/Forums/openfoam-solving/102763-allowed-functions-funkysetfields-expression.html)

michielm June 1, 2012 11:23

allowed functions in funkySetFields expression
 
Hi,
I am trying to set up an alpha1 field with funkySetFields and I would like to set alpha1 to 1 based on a calculation involving the remainder of a division.

I have tried using fmod(a/b) or a/b-floor(a/b) for this, but both fmod and floor are apparently not supported.

My question is: what functions are supported/allowed? is there a list of them somewhere?

gschaider June 1, 2012 16:40

Quote:

Originally Posted by michielm (Post 364312)
Hi,
I am trying to set up an alpha1 field with funkySetFields and I would like to set alpha1 to 1 based on a calculation involving the remainder of a division.

I have tried using fmod(a/b) or a/b-floor(a/b) for this, but both fmod and floor are apparently not supported.

My question is: what functions are supported/allowed? is there a list of them somewhere?

There is a modulo-operator (with a definition that is a bit different than the regular fmod). Have a look at http://openfoamwiki.net/index.php/Co...ression_syntax (that is BTW the best documentation for the syntax). Allowed functions are basically what is in the programmers guide (and there is no fmod ;) ) plus additional functions that were added during the years (not all of them documented on the Wiki).

An updated documentation is in progress, but as this is unpaid work it is not very high priority so don't expect it before the end of the year

michielm June 2, 2012 06:20

Thanks! That one will definitely do the trick!


All times are GMT -4. The time now is 10:59.