CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   changeDictionary fails with multiple times (http://www.cfd-online.com/Forums/openfoam-bugs/123546-changedictionary-fails-multiple-times.html)

wouter September 16, 2013 03:37

changeDictionary fails with multiple times
 
Hello All,
because ParaFoam cannot work with uniformfixedValue I need to use
changeDictionary -time 70,80,90,100 this option does not work only the first time gets changed.

Best regards
Wouter
Ubuntu 13.04
Openfoam 2.2.x

ngj September 17, 2013 13:01

Hi Wouter,

I am sorry to tell that after a quick look in the source code, then it does what it is designed for, since there is no loop over the time instances.

It reads the time list given by the user, if the time list is of length zero, the utility throws an error and otherwise it does:

Code:

runTime.setTime(times[0], 0);
i.e. sets the current time instance to the first element in the user defined list. Therefore, it seems that you only have two options:

1. Execute for each time instance "manually" or,
2. Modify the solver.

Kind regards

Niels

wouter September 17, 2013 14:59

Hello ngj,

So I can assume the bugreport has to mention the bug in the help text.

All the best
Wouter

wyldckat September 17, 2013 18:40

Greetings to all!

@Wouter: Ah, this is one of those situations where shell scripting can come in handy. Try this:
Code:

for timeIter in 70 80 90 100; do
  changeDictionary -time $timeIter
done

It's the same as:
Code:

for timeIter in 70 80 90 100; do  changeDictionary -time $timeIter ; done
As for bug reporting, I would say that this is a bug, because the description for the "-time" option is misleading.
But for reporting bugs to be fixed in OpenFOAM, you have to write the bug report on the official bug tracker: http://www.openfoam.org/bugs/

Best regards,
Bruno

wouter September 18, 2013 04:06

Dear wyldckat,
Thank you again for the scripts. A hurdle is signing in for a bugreport.
I looked at sample an reconstructPar and I think it is a challenge to write my own change dir. But in the meantime I will use your script.

Regards
Wouter

Bernhard September 18, 2013 04:59

Quote:

Originally Posted by wyldckat (Post 452294)
Greetings to all!

@Wouter: Ah, this is one of those situations where shell scripting can come in handy. Try this:
Code:

for timeIter in 70 80 90 100; do
  changeDictionary -time $timeIter
done

It's the same as:
Code:

for timeIter in 70 80 90 100; do  changeDictionary -time $timeIter ; done

Note that in bash, you can also loop as follow

Code:

for ((i=70; i<101; i+=10)); do...; done
And, probably, this would also help you (but use with cause)
Code:

for dir in [0-9]*; do ...; done;

wouter September 18, 2013 10:50

Dear Bernhard,
Thanks for that option, because I have 300 timesteps in parallel.
I have to run it in every processor and it is slow.

Thanks All
Wouter
for future use I renamed BC uniformFixedValue to TimeVaryingFixedValue.


All times are GMT -4. The time now is 17:00.