update dictionary within runTime loop
Hello.
Following this and this I'm trying to update a subdictionary of dynamicMeshDict whitin the runTime loop of pimpleDyMFoam.C with
Code:
myDict.set("name",value);
but I'm facing the same problem as the first link above: the code compiles with no errors but the value does not update. I changed the WRITE_OPTIONS of the dictionary to AUTO_WRITE as suggested in first link but the problem persists. Here's what I have:
Code:
const word dictName("dynamicMeshDict");
const word subDictName("solidBodyMotionFvMeshCoeffs");
const word subsubDictName("rotatingMotionCoeffs");
fileName dictPath;
dictPath =runTime.constant()/dictName;
IOdictionary dynamicMeshDict
(
IOobject
(
dictPath,
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
)
);
Then, within runTime loop, I have:
Code:
newomega = newomega + domegadt;
vector omegav = vector(dynamicMeshDict.subDict(subDictName)
.subDict(subsubDictName)
.lookup("axis"))*
readScalar(dynamicMeshDict.subDict(subDictName)
.subDict(subsubDictName)
.lookup("omega"));
dynamicMeshDict.subDict(subDictName).subDict(subsubDictName).set("omega",newomega);
I'm using OpenFOAM-v1606+
Any help in figuring out why "omega" is not being updated in dynamicMeshDict with really be appreciated.
Thanks for reading.
|