|
[Sponsors] |
accessing 0 time directory in coded functionObject |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 21, 2018, 09:41 |
accessing 0 time directory in coded functionObject
|
#1 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi there,
I am hoping to get some help with coded function objects in openFoam. I have written a function object to compute the radius of a bubble based on volume fraction alpha and cell volume as follows (compressibleInterFoam): Code:
// section of coded to be executed, in controlDict forAll(centers, I) { if (alpha[I] < th) { // TO COMPUTE RADIUS // compute numerator, time-varying sumNumerator += (1-alpha[I])*(V[I]); // per time-step // compute denominator, constant at t = 0 sumDenominator += (1-alpha[I])*(V[I]); // CHANGE TO ACCESS VALUES AT TIME = 0 -- how? // At each time-step bracket = pow(sumNumerator/sumDenominator, 1/3); // compute Radius Radius = Rstart*bracket; } } The code compiles and runs but with the above setting the radius clearly stays constant for all time-directories. Please help. Any advice will be greatly appreciated. p.s. I know I can do something similar in swak4Foam but so far I have not managed to make this work for my current version (v5.0) and I want to try out some coding in OpenFOAM and c++ as an exercise (still a newbie). |
|
Tags |
codedfunctionobjects, compressibleinterfoam, functionobjects, postprocessing, time |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 06:49 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
same geometry,structured and unstructured mesh,different behaviour. | sharonyue | OpenFOAM Running, Solving & CFD | 13 | January 2, 2013 23:40 |
1.7.x Environment Variables on Linux 10.04 | rasma | OpenFOAM Installation | 9 | July 30, 2010 05:43 |