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

update dictionary within runTime loop

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2018, 22:37
Default update dictionary within runTime loop
  #1
New Member
 
Join Date: Jun 2018
Posts: 2
Rep Power: 0
sam7 is on a distinguished road
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.
sam7 is offline   Reply With Quote

Old   September 8, 2018, 22:35
Default
  #2
Member
 
Pavan
Join Date: Jan 2016
Posts: 53
Rep Power: 10
pvpnrao is on a distinguished road
Sam



were you able to figureout this issue.


I need to implement the same functionality
pvpnrao is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
ill defined primitiveEntry starting at keyword 'value' on line 197 ChangeDictionary Struggle_Achieve OpenFOAM Pre-Processing 2 December 20, 2017 03:58
Implicit mesh update restriction for faster calculation burning_bert Fluent UDF and Scheme Programming 1 May 28, 2017 16:59
Problem in3D model processing mebinitap OpenFOAM 2 December 12, 2014 04:40
Understanding the PISO loop of icoFoam ooo OpenFOAM Programming & Development 0 March 14, 2014 09:28


All times are GMT -4. The time now is 11:30.