|
[Sponsors] |
June 16, 2016, 09:51 |
Interpolating between tables with time
|
#1 |
Member
Join Date: Nov 2015
Posts: 57
Rep Power: 10 |
Hello all,
I want to assign to a wall a boundary condition of temperature that changes with time. I have two tables (containing X Y Z and temperature) corresponding to two steady state results. How would my field function look like to interpolate with my time step between those two tables and assign this as my boundary condition? Thanks |
|
June 17, 2016, 14:35 |
|
#2 |
New Member
Kevin
Join Date: Oct 2012
Posts: 29
Rep Power: 13 |
You can create two field functions using the interpolatePositionFunction() function. This will create a spatially resolved function of data at time=t1 and another function at time=t2. Then, create a third field function which does your interpolation, as you see fit, between the two starting functions. One example is phi(t)=phi(t1)+ (phi(t2)-phi(t1))/(t2-t1)*(t-t1). It doesn't look so pretty in text, but I'm sure you get the gist and/or have done linear interpolation before. You can use different interpolation schemes if you wish - quadratic, etc - as fancy as you want to be.
This gets much more difficult if you use three or more tables for different levels in time. Then you can either use multiple functions and select between them based on time (decent until you get to 4-6 tables) - after that, I don't have a good suggestion. But since you mention only two tables, the first method should be fine. |
|
June 18, 2016, 03:40 |
|
#3 |
Member
Join Date: Nov 2015
Posts: 57
Rep Power: 10 |
Hi,
Thanks for your answer. Indeed I did what you suggested, I only mentionned two tables because I supposed it would be the same for n tables. I give conditions such as: (Time < 2 sec) ? formula for table 1 & 2 : (Time < 4 sec) ? formula for table 3 & 2 : and so on. Max |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple floating objects | CKH | OpenFOAM Running, Solving & CFD | 14 | February 20, 2019 09:08 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 02:20 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 13:58 |
same geometry,structured and unstructured mesh,different behaviour. | sharonyue | OpenFOAM Running, Solving & CFD | 13 | January 2, 2013 22:40 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 07:56 |