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

runTimeMOdifiable

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2013, 15:06
Default runTimeMOdifiable
  #1
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
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, 13:04
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 13:09
Default
  #3
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
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, 13:48
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 11:11
Question
  #5
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
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, 17:56
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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

Old   November 3, 2015, 13:57
Default
  #7
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Dear Bruno,

I checked this test case. It indeed has the following for the icoFoam solver:

Code:
    IOdictionary transportProperties                                    (                                        IOobject                                        (                                            "transportProperties",                                            runTime.constant(),                                            mesh,                                            IOobject::MUST_READ_IF_MODIFIED,                                            IOobject::NO_WRITE                                        )                                    );                                 
                                   dimensionedScalar nu                                    (                                        transportProperties.lookup("nu")                                    );
In cavity case, when it is running, when I change nu from 0.01 to a non-numeric value, say, "x". The solver is still running, and it should crash. So that means the solver does not know this change. The version of Openfoam I am using is 2.1.1.

OFFO.

Quote:
Originally Posted by wyldckat View Post
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:

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
openfoammaofnepo is offline   Reply With Quote

Old   November 29, 2015, 12:28
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick note - Answered here: http://www.cfd-online.com/Forums/ope...tml#post575490 - post #7
wyldckat 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
RunTimeModifiable did not work maka OpenFOAM Running, Solving & CFD 5 July 26, 2021 17:56
runTimeModifiable Djub OpenFOAM 3 December 13, 2012 11:27
runTimeModifiable directories daniquefintelman OpenFOAM Running, Solving & CFD 0 August 23, 2012 05:55


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