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

lookup a scalar

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 2, 2011, 08:38
Default lookup a scalar
  #1
New Member
 
David S
Join Date: Nov 2010
Posts: 9
Rep Power: 15
ds-gti is on a distinguished road
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"));
to call it
Code:
for (int m=0; m<nOuterCorr; m++)
...
//or
for (int m=0; m<mIt; m++)
...
in fvSolution I added:
Code:
OUTERLOOP
{
    nOuterCorrectors 3;
}
//or
mIt             3;
None of them works, where are I am mistaken?

Thanks for advise!
David
ds-gti is offline   Reply With Quote

 


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
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


All times are GMT -4. The time now is 17:25.