|
[Sponsors] |
February 3, 2016, 04:35 |
Read gravity data varying with time
|
#1 |
Senior Member
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13 |
Dear Foam users,
I would like to read the gravity values varying with time from a dataFile located in constant folder. As much as I searched, there is a close post here: http://www.cfd-online.com/Forums/ope...ty-time-2.html In this post, iinterpolationTable<vector> is recommended which can be only used when the gravity values increase. However, I have random value depending on the time such as: 4 ( (0 (10 -5 0)) (0.1 (2 4 0)) (0.2 (-6 1.31 0)) (0.3 (21 0 0)) ... ) Is there anyone let me know how to read these gravity data varying with time. Thank you in advance. |
|
February 3, 2016, 09:49 |
|
#2 |
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 87
Rep Power: 13 |
Hi
Try to use the swak4Foam toolkit. Mehrez |
|
February 4, 2016, 19:09 |
|
#3 | |
Senior Member
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13 |
Hi Mehrez,
Thank you very much for your reply. Actually, after looking at the interpolationTable code I found how to read the gravitation data from .dat file as follows: Code:
interpolationTable<vector> Acc ( runTime.path()/runTime.caseConstant()/".dat" ); g.value()= Acc.(runTime.value()); 4 ( (1 (1 5 4)) (2 (2 4 8)) ... above code works well. My another question is if my time step is 0.5 how can i make interpolation between these values given in .dat file. Any advice will be appreciated. Thank you ________ Moderator note: The following was also asked via PM: Quote:
Last edited by wyldckat; February 21, 2016 at 14:52. Reason: see "Moderator note:" |
||
February 21, 2016, 15:57 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Quick answers @Baris: Sorry, I'm out of time for today and a bit grumpy/hungry, but nonetheless here goes:
|
||
June 9, 2016, 04:58 |
|
#5 | |
Member
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10 |
Quote:
Hi Baris, hi Foamers do you know how to apply the interpolationTable code to read the forces.dat file, that is updated every timestep, in run time? Thanks in advice. Federica |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 04:13 |
[General] 2 datas on one plot | Akuji | ParaView | 46 | December 1, 2013 14:06 |
AMI interDyMFoam for mixer nu problem | danny123 | OpenFOAM Programming & Development | 8 | September 6, 2013 02:34 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 07:56 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 02:58 |