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

Read gravity data varying with time

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2016, 04:35
Default Read gravity data varying with time
  #1
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
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.
shipman is offline   Reply With Quote

Old   February 3, 2016, 09:49
Default
  #2
Member
 
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 87
Rep Power: 13
Mehrez is on a distinguished road
Hi
Try to use the swak4Foam toolkit.
Mehrez
Mehrez is offline   Reply With Quote

Old   February 4, 2016, 19:09
Default
  #3
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Quote:
Originally Posted by Mehrez View Post
Hi
Try to use the swak4Foam toolkit.
Mehrez
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());
If the .dat file is same with the time step (for example deltaT= 1)
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:
Originally Posted by shipman
As an addition to above question, I used interFoam and I would like to get the water height vs time. Do you think that is it possible?

Last edited by wyldckat; February 21, 2016 at 14:52. Reason: see "Moderator note:"
shipman is offline   Reply With Quote

Old   February 21, 2016, 15:57
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
Quick answers @Baris: Sorry, I'm out of time for today and a bit grumpy/hungry, but nonetheless here goes:
  1. You should have stated which OpenFOAM or foam-extend version you're using!
  2. You should have provided code that I could test with, along with a test case
  3. Instead of using the interpolation table, use "DataEntry": http://www.cfd-online.com/Forums/ope...tablefile.html
  4. Quote:
    Originally Posted by shipman
    As an addition to above question, I used interFoam and I would like to get the water height vs time. Do you think that is it possible?
    Sorry, but the question is too vague I need a lot more details, context and what exactly you're trying to "get". Either way, it's probably possible, I guess
wyldckat is offline   Reply With Quote

Old   June 9, 2016, 04:58
Default
  #5
Member
 
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10
federicabi is on a distinguished road
Quote:
Originally Posted by shipman View Post
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());
If the .dat file is same with the time step (for example deltaT= 1)
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:

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
federicabi 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
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


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