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

macro substitutions in fvSolution

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2015, 16:48
Default macro substitutions in fvSolution
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
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, 10:32
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17
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, 11:19
Default
  #3
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
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
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   March 6, 2015, 11:22
Default
  #4
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
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 21:53
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 05:00
Macro Trouble -Winows Explorer Crashes with Macro Martin Castillo FLUENT 1 July 25, 2007 04:18
Macro problem cfddummy Siemens 1 April 9, 2007 12:37
Call a macro from a macro Flav Siemens 2 July 1, 2004 05:42


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