|
[Sponsors] |
November 15, 2014, 11:15 |
How to use endTime in ControlDict
|
#21 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all:
I am using OpenFoam 2.2.1 , InterDyMFoam/SloshingTank2D as follows: I am running a code that will modify the displacement .dat file in OpenFoam/SloshingTank2D as follows: Each time the file is overwritten with 2 lines of data with a begin time and end time and corresponding displacements as follows: 2 ( ( 0.19 (( 0.0265476475 0.00 0.00) ( 0.00 0.00 0.00))) ( 0.21 (( 0.0369661065 0.00 0.00) ( 0.00 0.00 0.00))) ) The first column is time and the next column are the displacements associated with the time. Since both the time column and the displacement column will change as the new data is created, I would like to get an output at each end time (0.21 in this case). Can anyone suggest how I can use startFrom and stopAt to do this? In the OpenFoam Manual, for controlDict under "startFrom", there are options such as firstTime, startTime and latestTime options. so for example if the file previous to the one above is as follows: 2 ( ( 0.17 (( -0.0665476475 0.00 0.00) ( 0.00 0.00 0.00))) ( 0.19 (( 0.0369661065 0.00 0.00) ( 0.00 0.00 0.00))) ) Should I use the latestTime option? What about the stopAt option? looks like I only have the writeNow option. Is that correct? Any suggestions or comments would be appreciated, Thanks. |
|
November 17, 2014, 16:22 |
|
#22 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Musaddeque,
If you have a certain code that generates the file for the movement, then you can also have that code generate a file that has the times for start and stop. For example, the new file "system/controlDict.start_stop" would have this: Code:
newStartTime 0.17; newStopTime 0.19; Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "controlDict.start_stop" application icoFoam; startFrom startTime; startTime $newStartTime; stopAt endTime; endTime $newEndTime; //.... This is further explained in the release notes for one of OpenFOAM's versions... er, I have no idea in which version of OpenFOAM this was included. OK, it's explained in the User Guide: http://www.openfoam.org/docs/user/ba...8-1040004.2.10 - section 4.2.10 The #include and #inputMode directives Best regards, Bruno
__________________
|
|
November 18, 2014, 22:01 |
|
#23 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Thankyou very much for your response. I am trying that approach.
|
|
November 22, 2014, 21:51 |
|
#24 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
Code:
{stuff deleted} #19 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f7219c39de5] #20 interDyMFoam() [0x43c56d] [5] [5] [5] --> FOAM FATAL ERROR: [5] current time (0.12) is greater than the maximum in the data table (0.12) [5] [5] From function solidBodyMotionFunctions::tabulated6DoFMotion::transformation()[2] [2] [2] --> FOAM FATAL ERROR: [2] current time (0.12) is greater than the maximum in the data table (0.12) [2] [2] From function solidBodyMotionFunctions::tabulated6DoFMotion::transformation() [2] [4] [4] [4] --> FOAM FATAL ERROR: [4] current time (0.12) is greater than the maximum in the data table (0.12) [4] [4] From function solidBodyMotionFunctions::tabulated6DoFMotion::transformation() [4] in file solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C at line [3] [3] [3] --> FOAM FATAL ERROR: [3] current time (0.12) is greater than the maximum in the data table (0.12) [3] [3] From function solidBodyMotionFunctions::tabulated6DoFMotion::transformation() [3] in file solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C[1] {stuff deleted} Thankyou Last edited by wyldckat; November 23, 2014 at 16:31. Reason: Added [CODE][/CODE] |
||
November 23, 2014, 16:35 |
|
#25 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
My guess is that this message: Quote:
A possible solution is to change your file to have something like this example, for 0.17 to 0.19: Code:
4 ( ( 0.16 (( -0.0665476475 0.00 0.00) ( 0.00 0.00 0.00))) ( 0.17 (( -0.0665476475 0.00 0.00) ( 0.00 0.00 0.00))) ( 0.19 (( 0.0369661065 0.00 0.00) ( 0.00 0.00 0.00))) ( 0.20 (( 0.0369661065 0.00 0.00) ( 0.00 0.00 0.00))) ) Best regards, Bruno |
||
November 23, 2014, 22:59 |
Bruno, thanks again
|
#26 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
The numbers that my code sends to openfoam -- startTime, endTime, and the displacements are all followed by "0d0" after the last digit. This will ensure that there are no unintended digits. So if an updated time is 0.12, then the code will send 0.120d0, i.e. 0.1200000...to the end. Maybe that is where the conflict was. Even when I set the writeinterval in controlDict to 0.0005, the last OpenFoam time would be 0.1195 -- never quite reaching 0.1200. So what I did was subtract a small number say 0.0001 from the start time and add the same number to the end time in the displacement file, so that my displacement file would look like: 2 (0.1200001 (0, start_displacement) .... other columns deleted) (0.1400001 (0, end_dispalcement)......other columns deleted) However, in the controlDict file, the startTime and endTime are kept as 0.1200 and 0.1400. Given a larger time range in the displacement file, OpenFOAM now accepts the update and does the analysis w/o problems (well until the next time). So thank you for your suggestion. But may I suggest that OpenFOAM standardize the way numbers are dealt with so it keeps track of significant digits and sets all other numbers after it to zero. I am sure this way errors such as the one I came across can be avoided. I am not sure though, however, why OpenFOAM refused to write data after 0.1195, eventhough the write interval was 0.0005, and there was a displacement associated with 0.1200000. |
||
November 27, 2014, 12:39 |
|
#27 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
|
||
November 27, 2014, 16:33 |
OpenFOAM write interval doesnt always work
|
#28 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
As a follow up to the previous thread, in control dict I specify the write time as 0.02 as shown below:
Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * new file * * * * * * * * * * * * * * * * * * * * * * * * * * // application interDyMFoam; startFrom latestTime; startTime 21.70000; stopAt endTime; endTime 21.72000; deltaT 0.0005; writeControl adjustableRunTime; writeInterval 0.02; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression compressed; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 0.5; maxAlphaCo 0.5; maxDeltaT 1; Code:
. . . 21.68 21.7199999999 Any suggestions advice would be greatly apprciated. Thanks! Last edited by wyldckat; January 25, 2015 at 12:09. Reason: Added [CODE][/CODE] |
|
January 25, 2015, 12:21 |
|
#29 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
Sorry, I wasn't able to look into this any sooner. And I know there is a bug report related to this issue, but I haven't found it yet. OK, the latest error seems to be because the time snapshot 21.70 doesn't exist and because you have these settings: Code:
startFrom latestTime; startTime 21.70000; endTime 21.72000; timePrecision 6; Code:
21.68 21.7199999999 Can you please provide a test case? Because I'm not able to reproduce this error. Best regards, Bruno edit: OK, found it: http://www.cfd-online.com/Forums/ope...ct-number.html Last edited by wyldckat; January 25, 2015 at 12:24. Reason: see "edit:" |
|
January 25, 2015, 16:56 |
OpenFOAM write interval doesnt always work
|
#30 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
WyldKat:
Thanks for your response. I cant provide a test case as I have coupled at program with openfoam. The program looks for specific files with specific time stamps. As a result, if it does not find the file 27.72 for example, it will give an error. I got around this problem for the time being by: 1.Increasing the time stamp by a range. So for example, instead of supplying the start time as 2.00 seconds of simulation time, I will supply 1.999999. Similarly, I will increase the end time by a small amount say 0.0001. So the code now looks for something within that range. 2. Increasing the writPrecision in controlDict to 6. Both these appear to help and I have running simulations w/o problems on this issue. I will try OpenFOAM version 2.3 soon. Thanks |
|
June 4, 2015, 16:00 |
|
#31 |
New Member
romain
Join Date: Jun 2015
Posts: 2
Rep Power: 0 |
Dear all.
I have the same type of problem as musahossein. I’am working on foam-extend 3.1 on a turbine simulation. I am using pimpleDyMFoam to solve the simulation. What I need to do now, is to set probes on one face of the blades. But probes can’t be fixed. I need them to follow the blades to always get the pressure at the good point. I read all your previous post but I could not fix my problem. Do you have an idea about the way I can do this? It also need to be run in parallel. I don’t know if it’s possible with this “moving” probes. Best Regards Romain |
|
June 12, 2015, 19:38 |
|
#32 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Romain and welcome to the forum!
AFAIK, "moving probes" is only somewhat implemented in OpenFOAM 2.2.x and newer: http://www.openfoam.org/mantisbt/view.php?id=1090 It's in this commit: https://github.com/OpenFOAM/OpenFOAM...f27b5d573c2a9b I don't know if this feature has been back-ported to foam-extend already or not. Best regards, Bruno
__________________
|
|
June 16, 2015, 20:44 |
|
#33 |
New Member
|
Sample can be run in parallel on a decomposed case in exactly the same manner as the case itself is run in parallel.
For instance, if you have a case decomposed into four processor directories, you can run sample in parallel on four processors by mpirun -np 4 sample -parallel This is much faster than running reconstructPar and then sample. |
|
June 18, 2015, 12:36 |
|
#34 |
New Member
romain
Join Date: Jun 2015
Posts: 2
Rep Power: 0 |
Dear Bruno
Thanks for your reply and your help. I will try it and I will let you know regards |
|
August 14, 2015, 07:27 |
|
#35 |
Member
Gautami Erukulla
Join Date: Mar 2009
Posts: 71
Rep Power: 17 |
Dear All,
I am working on the interDyMFoam/floatingObject tutorial. I need guidance with post processing. I am trying to get fluid velocities and acceleration values at specific points in the computational domain. 1.In the "sampleDict/controlDict" file can I use the option "type cloud" and read the points from a file. 2.Is it possible to get the acceleration data for these specific points by using "fields" (as U for velocity). Thank you. |
|
August 17, 2015, 13:39 |
|
#36 |
Member
Gautami Erukulla
Join Date: Mar 2009
Posts: 71
Rep Power: 17 |
Dear Mr Bruno,
I am trying to use sampleDict utility with cloud of points option. Kindly can you please guide me as to how I could read the coordinates of the cloud points form a data file (as I need to track up to 150 points). Your help is highly appreciated.Thank you. Regards, Gautami. |
|
August 18, 2015, 15:08 |
|
#37 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answers:
Quote:
Quote:
The best you can do is use "#include" to include the file that has the data, but the data must be formatted in OpenFOAM's own interpretation of the data, e.g.: Code:
somePoints { type cloud; axis xyz; points ( #include "$FOAM_CASE/the_data.txt" ); } Code:
(0.049 0.049 0.00501) (0.051 0.049 0.00501) Quote:
|
||||
August 19, 2015, 14:34 |
|
#38 |
Member
Gautami Erukulla
Join Date: Mar 2009
Posts: 71
Rep Power: 17 |
Dear Mr Bruno,
Thank you very much for your reply. As per your suggestion I have used "#include option" in the "sampleDict" utility, to read the coordinate of the points from file "mordata" as: Code:
sets ( somePoints { type cloud; axis xyz; #include "mordata" points; } ); http://cfd.direct/openfoam/user-guid...c-file-format/) Code:
points ( (0 0 0) (1 0 1.1) (2 0 1.2) (3 0 1.3) (4 0 1.4) (5 0 1.5) ); However when I try to implement the same in "controlDict" utility to obtain the data runtime I end up getting the following error: Code:
/opt/OpenFOAM-2.2.0/bin/tools/RunFunctions: line 42: 8205 Segmentation fault $APP_RUN "$@" > log.$APP_NAME 2>&1 Code:
functions { points { type sets; functionObjectLibs ("libsampling.so"); outputControl outputTime; interpolationScheme cellPoint; setFormat raw; sets ( somePoints { type cloud; axis xyz; #include "mordata" points; } ); fields ( U ); } } (I would like to mention here that, the option probes and wallPressure/surfaces in controlDict works fine, but the line option and points option in controlDict gaves me this error similar to the above error. Code:
: /opt/OpenFOAM-2.2.0/bin/tools/RunFunctions: line 42: 18418 Segmentation fault $APP_RUN "$@" > log.$APP_NAME 2>&1. Your guidance will be invaluable. Regards, Gautami. Last edited by wyldckat; August 19, 2015 at 17:11. Reason: Added [CODE][/CODE] markers |
|
July 7, 2016, 06:31 |
|
#39 |
New Member
Bah.Mah
Join Date: Jun 2016
Posts: 18
Rep Power: 10 |
Hello Mr Bruno,
I was looking how to extraxt points from my configuration for the postprocessing till I found these posts above, I kindly would like to know how can I extract points from differents lines from my geometry and save it with a format that OpenFOAM would read it, (I´m using type cloud for sampling) The point is to sample the concentration in these differents cells on each time step |
|
July 17, 2016, 11:00 |
|
#40 |
New Member
mohafarmani
Join Date: Aug 2015
Location: shiraz
Posts: 14
Rep Power: 11 |
Hi Bruno
first thanks for your kindness and time. I want to take the velocity profile at every time steps over some surfaces located in computational doamin during running, and as my case is big so i can't save all fields every time steps and i couldn't use sampleDict. could you please let me know the way? |
|
Tags |
controldict, interpolate, sampledict |
|
|