CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

macro substitutions in fvSolution

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 5, 2015, 17:48
Default macro substitutions in fvSolution
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 676
Rep Power: 8
sharonyue is on a distinguished road
Hi guys,

for some reason I want to make this snippet workthis is quite abnormal to do this but this is just an example)

Code:
PIMPLE
{   
    nOuterCorrectors $nCorrectors;
    nCorrectors     3;
    nNonOrthogonalCorrectors 0;
}
But it does not! it says:
Code:
--> FOAM FATAL IO ERROR: 
Illegal dictionary entry or environment variable name "nCorrectors"
Valid dictionary entries are 
0
(
)
How can I make it work? thanks.
sharonyue is offline   Reply With Quote

Old   March 6, 2015, 11:32
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 240
Rep Power: 9
olivierG is on a distinguished road
hello,

Maybe put the scalar definition outside the PIMPLE Dict ...
regards,
olivier
olivierG is offline   Reply With Quote

Old   March 6, 2015, 12:19
Default
  #3
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 279
Rep Power: 12
zfaraday will become famous soon enough
Hi,

The variable you are calling should be defined first, that's why it's complaining because the code can't recognize tha variable you call. I think that something like that should work instead:

Code:
PIMPLE
{   
    nOuterCorrectors 3;
    nCorrectors     $nOuterCorrectors;
    nNonOrthogonalCorrectors 0;
}
Hope it helps!

Regards,

Alex
__________________
I'm newbie in OpenFOAM's world and not an English-speaking, so if I make any mistake a correction will be welcome!
zfaraday is offline   Reply With Quote

Old   March 6, 2015, 12:22
Default
  #4
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 676
Rep Power: 8
sharonyue is on a distinguished road
Thank you guys,

what a pity...I forgot why I wanna do this...
sharonyue 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
How to use the thread_storage macro? lxlxlxt FLUENT 0 February 10, 2014 22:53
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 06:00
Macro Trouble -Winows Explorer Crashes with Macro Martin Castillo FLUENT 1 July 25, 2007 04:18
Macro problem cfddummy CD-adapco 1 April 9, 2007 12:37
Call a macro from a macro Flav CD-adapco 2 July 1, 2004 05:42


All times are GMT -4. The time now is 19:57.