CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] allowed functions in funkySetFields expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2012, 12:23
Default allowed functions in funkySetFields expression
  #1
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16
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, 17:40
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 07:20
Default
  #3
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16
michielm is on a distinguished road
Thanks! That one will definitely do the trick!
michielm 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
Outlet boundary condition in interFoam Andrea_85 OpenFOAM Running, Solving & CFD 51 July 20, 2017 14:31
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 08:24
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
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


All times are GMT -4. The time now is 13:51.