Read a field at different times
Hi,
I want to create a post-processing utility, which traverses all time steps and compares the data with the data of all other time steps. So I end up with two nested loops traversing all time steps. So, in pseudo code, it looks like this: Code:
// go over all time steps Code:
volScalarField alpha1 I assume, that this might be done faster. Is there a way to just read the field at the current time, like read()? |
solved yet?
Hi Gerhard,
did you solve this already? I'm also interested... best regards, Shir ---- edit 2019-06-03: seems to be the only way. |
As of now, there are two ways to deal with this problem:
So,we can choose between
I ended up implementing the second variant. |
I'm quite new to OpenFoam, so maybe there is a better answer but if you know the time you need to read, you can convert into a word with the right precision using the runTime.timeName(scalar time) function.
For example, in my solver there is: Code:
word cTime(runTime.timeName(currentTime[i].value())); |
Code for writeAlpha2
1 Attachment(s)
Hi everyone,
I'd like to share my successful code for writing int_V(alpha2)dV = "volume of gas phase" to postProcessing/volumeIntegrate_volumeIntegral/0/alpha2. It's written for foam-extend-4.0. Can also be used for postProcessing of a parallel case via e.g. mpirun -np $threads writeAlpha2 -parallel Install: extract tar.gz to $WM_PROJECT_DIR/applications/utilities/postProcessing/miscellaneous/ and cd there and do "wmake". |
All times are GMT -4. The time now is 18:26. |