|
[Sponsors] |
January 9, 2014, 17:45 |
Write field data at a few specific timesteps
|
#1 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Hi All,
Is it possible to control the writing of the filed data happens at some specific timesteps which are not necessarily a multiple of "writingInterval"? Let's say I want the data to be written only at timesteps = 10, 17, 43 and 71. Right now I have to write data out every timestep in order to obtain field at these timesteps. How can I write data only at the mentioned timesteps? Cheers, Kasra. Last edited by gary7; January 10, 2014 at 01:43. |
|
October 21, 2016, 08:51 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 250
Rep Power: 12 |
Hi Kasra,
have you found any answer to this question? Of course one could write a shell-script which reads the OpenFOAM output and changes the controlDict at the appropriate time, but that isn't very elegant. Best regards, Kate |
|
October 21, 2016, 14:40 |
|
#3 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Hi Kate,
I used a quick hack to do it. It is not the best way to do it but it does the job: Code:
if ( mag(runTime.value() - runTime.deltaT().value() * 10) < SMALL ) { runTime.writeNow(); } Cheers, Kasra. |
|
October 24, 2016, 07:12 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 250
Rep Power: 12 |
Hi Kasra,
thanks for your response. This works only for a fixed timestep, right? Kate |
|
October 24, 2016, 17:42 |
|
#5 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
That's right. You can write the results at specific timesteps, you can add more timesteps using "or" (||) operator. However, the clean and robust way of doing it is defining an IOdictionary and list the required timesteps in there and use those instead of hard coding the timesteps right into the code.
|
|
March 11, 2020, 13:31 |
|
#6 |
New Member
Mark
Join Date: Oct 2018
Posts: 18
Rep Power: 8 |
Hi! Do you happen to know how to use the IO dictionary to make your simulation write out user-specified times?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem in sampling data of custom field function in ANSYS FLUENT v14 | apek_great | ANSYS | 1 | February 26, 2014 06:10 |
[General] 2 datas on one plot | Akuji | ParaView | 46 | December 1, 2013 15:06 |
Indentify internal field value at specific patch | Giancarlo_IngChimico | OpenFOAM Programming & Development | 6 | April 16, 2013 13:29 |
User field function for specific heat deifnition | crevoise | STAR-CCM+ | 2 | January 28, 2013 05:25 |
Access raw field data (scalars, vectors) on mesh | haakon | OpenFOAM Programming & Development | 3 | September 25, 2012 11:01 |