|
[Sponsors] |
December 10, 2010, 12:39 |
Apply deltaT in utility
|
#1 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 16 |
Dear all,
At the moment I am trying to modify a utility file, where I want to multiply a constant by deltaT. I use a fixed Courant number, so I do not know the time step beforehand. I have tried the following: alpha=C*runTime.deltaT().value(); where alpha is the expression I want to modify, and C is a constant. When I recompile the utility I get the following error message: error: ‘runTime’ was not declared in this scope. I know there is not much information in the post, but if anybody could give me an advise on how to declare runTime, it will be appreciated. Kind regards, Bo Terp Ps. I am using OF 1.5-dev |
|
December 10, 2010, 14:37 |
|
#2 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Hi Bo Terp,
have a look at /applications/utilities/postProcessing/wall/wallGradU/wallGradU.C for example. Here is a code snippet that shows how to access the time values: Code:
... header from wallGradU.C ... int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "setRootCase.H" # include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); # include "createMesh.H" scalar lastTimeStep = 0; // added scalar deltaTime = 0; // added forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); deltaTime = timeDirs[timeI].value() - lastTimeStep; // added lastTimeStep = timeDirs[timeI].value(); // added Info<< "Time = " << runTime.timeName() << endl; Info<< "deltaT = " << deltaTime << endl; // added ... more code ... |
|
Tags |
deltat, openfoam 1.5-dev |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sample Utility not working in OpenFoam 1.6 | titio | OpenFOAM Post-Processing | 6 | November 15, 2014 19:04 |
problem with sampling Utility in openFOAM 1.6 | carmir | OpenFOAM Post-Processing | 10 | February 26, 2014 03:00 |
How to compile a new utility | rudy | OpenFOAM | 4 | October 1, 2011 23:48 |
Sample Utility not working in OpenFoam 1.6 | titio | OpenFOAM Post-Processing | 0 | February 5, 2010 13:12 |
Courant utility does not always use correct deltat | schmidt_d | OpenFOAM Bugs | 0 | June 5, 2007 12:45 |