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

How to define macros in Dictionary files?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wyldckat

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 24, 2013, 10:46
Default How to define macros in Dictionary files?
  #1
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 13
keepfit is on a distinguished road
Hi Foamers,

as the newest version of OpenFOAM 2.2.x supports Dictionary Macro Expansion, I wonder if it can be used for blockMeshDict:

....

xSize 10;
ySize 18;
zSize 15;

...

hex (0 22 24 11 37 47 35 40) (xSize ySize zSize) simpleGrading (0.5 0.5 1);

....

But when runing blockMesh, it says

Quote:
wrong token type - expected int, found on line 85 the word 'xSize1'..
So I wonder how to use Macros in OpenFoam correctly.

Best,

David



Edit1: Using predefined variables needs '$' .

Edit2: It would be great if mathematical operation is supported via macros, e.g.

a 5;
b 6;
c = $a + $b;

Last edited by keepfit; April 24, 2013 at 15:30.
keepfit is offline   Reply With Quote

 

Tags
dictionary, macros


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
Run time Selection Mechanism - Some help required to understand jaswi OpenFOAM Programming & Development 3 October 29, 2015 13:42
OpenFOAM15 paraFoam bug koen OpenFOAM Bugs 19 June 30, 2009 10:46
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


All times are GMT -4. The time now is 06:03.