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

allowed functions in funkySetFields expression

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 1, 2012, 11:23
Default allowed functions in funkySetFields expression
  #1
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 6
michielm is on a distinguished road
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?
michielm is offline   Reply With Quote

Old   June 1, 2012, 16:40
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by michielm View Post
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
gschaider is offline   Reply With Quote

Old   June 2, 2012, 06:20
Default
  #3
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 6
michielm is on a distinguished road
Thanks! That one will definitely do the trick!
michielm is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
funkySetFields - expression evaluation - error grjmell OpenFOAM Pre-Processing 2 January 26, 2012 05:46
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 18:23


All times are GMT -4. The time now is 09:43.