|
[Sponsors] |
January 12, 2011, 06:56 |
Implementation of runTime-updated scalar
|
#1 |
Member
Sebastian Lang
Join Date: Aug 2009
Posts: 47
Rep Power: 16 |
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"))); 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 |
|
Tags |
controldict, read from file, runtime, update |
|
|
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 |