|
[Sponsors] |
September 2, 2011, 08:38 |
lookup a scalar
|
#1 |
New Member
David S
Join Date: Nov 2010
Posts: 9
Rep Power: 15 |
Hi,
I would like to insert a scalar into the for-loop condition which is looked up in any datafile like controlDict or fvSolution. I tried to use these two examples located in the main funtion of myFoam.C Code:
dictionary outerloop = mesh.solutionDict().subDict("OUTERLOOP"); int nOuterCorr(readInt(outerloop.lookup("nOuterCorrectors"))); //or scalar mIt = readScalar(solutionDict.lookup("mIt")); Code:
for (int m=0; m<nOuterCorr; m++) ... //or for (int m=0; m<mIt; m++) ... Code:
OUTERLOOP { nOuterCorrectors 3; } //or mIt 3; Thanks for advise! David |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solving for an additional species CO in coalChemistryFoam | N. A. | OpenFOAM Programming & Development | 3 | February 18, 2019 05:58 |
dieselFoam problem!! trying to introduce a new heat transfer model | vivek070176 | OpenFOAM Programming & Development | 10 | December 23, 2014 23:48 |
Specifying nonuniform boundary condition | maka | OpenFOAM Running, Solving & CFD | 59 | October 22, 2014 14:52 |
Convergence on anisotropic tetahedral meshes | pbo | OpenFOAM Running, Solving & CFD | 12 | December 14, 2010 11:59 |
CFX12 rif errors | romance | CFX | 4 | October 26, 2009 13:41 |