CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

[OpenFOAM] Unable to obtain samples at specified writeInterval

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2022, 05:57
Default [OpenFOAM] Unable to obtain samples at specified writeInterval
  #1
New Member
 
Nishant
Join Date: Feb 2011
Posts: 4
Rep Power: 15
nishant.kumar is on a distinguished road
Hello all. I am trying to obtain values of pressure and velocity at certain time interval but the output time directories are not created at the specified writeInterval.

Here is the controlDict that I am using (based on the motorBike tutorial):
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libincompressibleRASModels.so"
);

application     simpleFoam;

startTime       0;

stopAt          endTime;

endTime         100;

deltaT          1;

writeControl    timeStep;

writeInterval   50;

purgeWrite      1;

writeFormat     binary;

writePrecision  6;

writeCompression compressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{   
    internalField
    {
        type            sets;
        libs            ("libsampling.so");
        enabled         true;

        interpolationScheme cellPoint;
        setFormat           raw;

        writeControl    adjustableRunTime;
        writeInterval   20;

        timeStart       20;
        timeEnd         80;

        fields  ( p U );
        points
        (
            #include "pointCloud.dat" // List of xyz coordinates
        );

        sets
        (
            cloud
            {
                type         cloud;
                axis         xyz;
                points       $points;
            }
        );
    }
}


// ************************************************************************* //
For this example, the output time directories are created as follows:

Code:
>> ls postProcessing/internalField/
20  21  22  23  24  25  26  27  28  29  
30  31  32  33  34  35  36  37  38  39  
40  41  42  43  44  45  46  47  48  49  
50  51  52  53  54  55  56  57  58  59  
60  61  62  63  64  65  66  67  68  69  
70  71  72  73  74  75  76  77  78  79  
80 100
As you can see, the interval of 20 is only applied when the two last time steps are saved (80 and 100). For the rest, the data is written every 1 time step.
This behavior remains the same for different values of writeInterval, timeStart and timeEnd that I played with.

How can I obtain the data only at the time periods defined by the writeInterval, that is at time steps 20,40,60... ?
nishant.kumar is offline   Reply With Quote

Old   January 13, 2022, 06:13
Default
  #2
New Member
 
Nishant
Join Date: Feb 2011
Posts: 4
Rep Power: 15
nishant.kumar is on a distinguished road
The issue is resolved by modifying the sampling function as:

Code:
outputControl    adjustableRunTime;
outputInterval   20;
nishant.kumar is offline   Reply With Quote

Reply

Tags
controldict, openfoam, point cloud, sampling, writeinterval


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to obtain the actual velocity profile of a sinusoidal udf Gourabc FLUENT 0 March 4, 2017 05:49
How to make a code parallel? Bruno Machado Fluent UDF and Scheme Programming 15 May 27, 2016 10:18
unable to obtain residual and lift coefficient convergence in SU2 deeps SU2 3 December 27, 2013 02:58
OpenFOAM 1.6.x - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 68 April 22, 2013 12:03
[Commercial meshers] ST_Malloc: out of memory.malloc_storage: unable to malloc Velocity SA, cfdproject OpenFOAM Meshing & Mesh Conversion 0 April 14, 2009 16:45


All times are GMT -4. The time now is 11:19.