CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

Problems with extracting data

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 25, 2010, 09:54
Question Problems with extracting data
  #1
New Member
 
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 8
Alicelin is on a distinguished road
Hi everyone,

I got a problem when extracting values from a specific time step, the following is my code:

Code:
#include "fvCFD.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{

#   include "addTimeOptions.H"
#   include "setRootCase.H"

#   include "createTime.H"

    // Get times list
    instantList Times = runTime.times();

    // set startTime and endTime depending on -time and -latestTime options
#   include "checkTimeOptions.H"

    runTime.setTime(Times[startTime], startTime);

#   include "createMesh.H"

    for (label i=startTime; i<endTime; i++)
    {
        runTime.setTime(Times[i], i);

        Info<< "Time = " << runTime.timeName() << endl;
        Info<< "Start Time = " << startTime << endl;
        Info<< "End Time = " << endTime << endl;
        
    volScalarField UMeanNorm
    (
        IOobject
        (
           "UMeanNorm",
           runTime.timeName(endTime), 
           mesh,
           IOobject::MUST_READ
        ),
        mesh
    );
As I want to extract UMeanNorm from the last time step (that is Time = 5), I set runTime.timeName(endTime) for UMeanNorm, but it turned out that the time that was chosen was 52 not 5 (but Time=52 doesn't exist!). I wonder how can I re-set the things so that the time chosen for extracting the data is the last time step
The following is the controlDict code:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application turbFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.001;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;
It would be great if anyone could help me

Thanks!

Alice
Alicelin is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D data extracting from Fluent simulation unknown FLUENT 0 October 11, 2009 13:15
2D data extracting from Fluent simulation unknown FLUENT 0 October 11, 2009 13:14
Extracting data. Sham FLUENT 2 August 16, 2005 10:39
Problems saving graph registers data Julie Polyakh CD-adapco 4 August 6, 2003 13:32
Data Base Problems Richard Harrison CFX 1 January 11, 2001 18:44


All times are GMT -4. The time now is 09:04.