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

Using codestream in controlDict

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 11, 2012, 03:59
Default Using codestream in controlDict
  #1
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 20
Rep Power: 7
pad is on a distinguished road
Hi all,

I am having some trouble using #codestream in controlDict file.

Basically, what I want is outlined below:

transientRunTime 0.816326530612;
application transientSimpleDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime #codeStream
{
code
#{
scalar startFrom = readScalar(dict.lookup("startFrom"));
scalar runTime = readScalar(dict.lookup("transientRunTime"));
os << startFrom+runTime;
#};
};

However, when I run the simulation I get the following error:

--> FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 22 the word 'startTime'
file: /storage/42938/Projects/Poseidon_2/E.35000W.50Hz.8P/EIMP.35.50.01.EVOL.35.50.01/Q100/system/controlDict::startFrom at line 22.
From function operator>>(Istream&, Scalar&)
in file lnInclude/Scalar.C at line 91.
FOAM exiting

Does anyone know how to get the value of 'startTime' assigned to 'startFrom' instead of the name 'startTime'

BR,
Per
__________________
Regards,
Per
pad 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
Representing controlDict information using OpenFOAM classes sanatan OpenFOAM Programming & Development 4 February 28, 2012 06:46
Run-time Code Compilation in controlDict JNSN OpenFOAM Programming & Development 0 February 7, 2012 04:40
Forces not calculated when including a library in controlDict fusij OpenFOAM 2 May 13, 2011 07:25
controlDict 'forces' function: multiple output files? lordvon OpenFOAM 0 January 10, 2011 16:22
writing controlDict as otherfields ubaid OpenFOAM 5 September 29, 2010 07:28


All times are GMT -4. The time now is 04:29.