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

runTimeMOdifiable

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 17, 2013, 14:06
Default runTimeMOdifiable
  #1
Senior Member
 
Join Date: Jan 2013
Posts: 204
Rep Power: 5
openfoammaofnepo is on a distinguished road
Dear All,

I generate an additional file in constant folder, and I wrote some flag parameter in it. However, although I set the option runTimeMOdifiable to true, I cannot make OpenFOAM read in the modified parameters again if I change some parameters in that file. How can I make running Openfoam know that modification during the run time?
openfoammaofnepo is offline   Reply With Quote

Old   May 18, 2013, 12:04
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings openfoammaofnepo,

Can you describe how you are loading the parameters from the new dictionary file?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   May 18, 2013, 12:09
Default
  #3
Senior Member
 
Join Date: Jan 2013
Posts: 204
Rep Power: 5
openfoammaofnepo is on a distinguished road
Hello,

In the createFields.H file, there are the following lines:

Info<< "Reading Parameters from Dictionary additionalControls \n" << endl;
IOdictionary additionalControls
(
IOobject
(
"additionalControls",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

dimensionedScalar OmegaRelax
(
additionalControls.lookup("OmegaRelax")
);


In that file, I wrote it like this:

OmegaRelax OmegaRelax [ 0 0 0 0 0 0 0 ] 0.5;

Using this method, I found that I cannot make it modifiable during the simulation.

Thank you.

Quote:
Originally Posted by wyldckat View Post
Greetings openfoammaofnepo,

Can you describe how you are loading the parameters from the new dictionary file?

Best regards,
Bruno
openfoammaofnepo is offline   Reply With Quote

Old   May 18, 2013, 12:48
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi openfoammaofnepo,

Try switching "MUST_READ" to "MUST_READ_IF_MODIFIED".

For reference, check the solver icoFoam, more specifically the file "createFields.H": https://github.com/OpenFOAM/OpenFOAM...createFields.H

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 24, 2013, 10:11
Question
  #5
Senior Member
 
Join Date: Jan 2013
Posts: 204
Rep Power: 5
openfoammaofnepo is on a distinguished road
Dear Bruno,

When I use MUST_READ_IF_MODIFIED option, when I change that parameter during the run time period, the new value for it is still updated in the simulations. But from the output, the dictionary has already been read again. This is a little strange. Did I forget the change something in the createFields.H?

Thank you very much.

Quote:
Originally Posted by wyldckat View Post
Hi openfoammaofnepo,

Try switching "MUST_READ" to "MUST_READ_IF_MODIFIED".

For reference, check the solver icoFoam, more specifically the file "createFields.H": https://github.com/OpenFOAM/OpenFOAM...createFields.H

Best regards,
Bruno
openfoammaofnepo is offline   Reply With Quote

Old   August 18, 2013, 16:56
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi openfoammaofnepo,

I've been very busy for the past few weeks. I don't know if you have solved this. Either way, I'm not sure I understand what you wrote:
Quote:
Originally Posted by openfoammaofnepo View Post
when I change that parameter during the run time period, the new value for it is still updated in the simulations. But from the output, the dictionary has already been read again.
Do you mean that although the dictionary is read during the run, the value inside the variable in memory has not changed?

If this is the case, I suggest that you test the "cavity" tutorial case with icoFoam and a very long simulation time; then change the "nu" property in the file "constant/transportProperties" while it's running. Check the results and whether the viscous influence changed the flow profile or not.
  • If it works for icoFoam, then this method should work for you as well.
  • But if it does not work for icoFoam, then it's unlikely that it will work for you.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
runTimeModifiable Djub OpenFOAM 3 December 13, 2012 11:27
runTimeModifiable directories daniquefintelman OpenFOAM Running, Solving & CFD 0 August 23, 2012 04:55
RunTimeModifiable did not work maka OpenFOAM Running, Solving & CFD 4 November 18, 2008 09:05


All times are GMT -4. The time now is 09:37.