|
[Sponsors] |
April 11, 2012, 04:59 |
Using codestream in controlDict
|
#1 |
New Member
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Run-time Code Compilation in controlDict | JNSN | OpenFOAM Programming & Development | 6 | October 24, 2022 06:23 |
Representing controlDict information using OpenFOAM classes | sanatan | OpenFOAM Programming & Development | 4 | February 28, 2012 07:46 |
Forces not calculated when including a library in controlDict | fusij | OpenFOAM | 2 | May 13, 2011 08:25 |
controlDict 'forces' function: multiple output files? | lordvon | OpenFOAM | 0 | January 10, 2011 17:22 |
writing controlDict as otherfields | ubaid | OpenFOAM | 5 | September 29, 2010 08:28 |