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

Implementation of runTime-updated scalar

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By sebonator

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 12, 2011, 06:56
Default Implementation of runTime-updated scalar
  #1
Member
 
Sebastian Lang
Join Date: Aug 2009
Posts: 47
Rep Power: 16
sebonator is on a distinguished road
Hi there!

I am writing a modified solver and had to add a new entry "steadyIterationSteps" to my controlDict. This constant should be updated every time step for my transient solver. The aim is, that the constant can be modified during runtime, like for example the value of "stopAt" in the controlDict.

I read the constant every time step (=> The "read"-command is located inside the "while (runTime.run())"-loop), but the value with which the solver works isn't updated! If I change the value before starting the solver, then it reads the value as I want it to, but a modification during runtime still is not possible! So my problem is, that the controlDict is read for the first time step, but not for the following time steps!

Maybe the operation of reading is not the problem, but at least the variable "iterationSteps" in my solver does not receive the new value properly!

I tried both of the following commands to read in the value:

Code:
scalar iterationSteps = runTime.controlDict().lookupOrDefault<scalar>("steadyIterationSteps", 500);
Code:
scalar iterationSteps(readScalar(runTime.controlDict().lookup("steadyIterationSteps")));
but no one of them is able to update the value of "iterationSteps" every time-step.

Could you give me a hint what is missing in my code or what I do wrong? I also tried to find out how the other entries in the controlDict are read in, but I didn't understand the codes and classes as they seem to be extremely nested at this point!

Thanks for every reply!
Greetings Sebastian
HakikiCanakkaleli and codder like this.
sebonator is offline   Reply With Quote

 

Tags
controldict, read from file, runtime, update


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
CFX12 rif errors romance CFX 4 October 26, 2009 13:41
solving passive scalar by user function in AVLFIRE huyp Main CFD Forum 0 September 4, 2008 10:21


All times are GMT -4. The time now is 06:54.