|
[Sponsors] |
August 14, 2017, 07:20 |
How Coorectly Run sampleDict
|
#1 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Hello to all,
i have to run a post-processing extration of the U and P value. I decided to use for the first time the sampleDict. I put it in the system folrder, run the simulation and finally type the command "sample" which gives me this message Code:
sample has been superceded by the postProcess utility: postProcess -func sample To re-use existing 'sampleDict' files simply add the following entries: type sets; libs ("libsampling.so"); and run postProcess -func sampleDict Code:
postProcess -func sampleDict Code:
Create time Create mesh for time = 0 Time = 0 Reading fields: volVectorFields: U Executing functionObjects Time = 0.001 Reading fields: volVectorFields: U Executing functionObjects End Here my sampleDict file. Code:
type sets; libs ("libsampling.so"); setFormat raw; // Surface output format. Choice of // null : suppress output // foamFile : separate points, faces and values file // dx : DX scalar or vector format // vtk : VTK ascii format // raw : x y z value format for use with e.g. gnuplot 'splot'. // // Note: // other formats such as obj, stl, etc can also be written (by proxy) // but without any values! // surfaceFormat vtk; // interpolationScheme. choice of // cell : use cell-centre value only; constant over cells (default) // cellPoint : use cell-centre and vertex values // cellPointFace : use cell-centre, vertex and face values. // 1] vertex values determined from neighbouring cell-centre values // 2] face values determined using the current face interpolation scheme // for the field (linear, gamma, etc.) interpolationScheme cellPointFace; // Fields to sample. fields ( U ); // Set sampling definition: choice of // uniform evenly distributed points on line // face one point per face intersection // midPoint one point per cell, inbetween two face intersections // midPointAndFace combination of face and midPoint // // curve specified points, not nessecary on line, uses // tracking // cloud specified points, uses findCell // // axis: how to write point coordinate. Choice of // - x/y/z: x/y/z coordinate only // - xyz: three columns // (probably does not make sense for anything but raw) // - distance: distance from start of sampling line (if uses line) or // distance from first specified sampling point // // type specific: // uniform, face, midPoint, midPointAndFace : start and end coordinate // uniform: extra number of sampling points // curve, cloud: list of coordinates sets ( ); // Surface sampling definition: choice of // plane : values on plane defined by point, normal. // patch : values on patch. // // 1] patches are not triangulated by default // 2] planes are always triangulated // 3] iso-surfaces are always triangulated surfaces ( hello { type patch; // always triangulated // make plane relative to the coordinateSystem (Cartesian) // coordinateSystem // { // origin (0.05 0 0); // } patches ("outlet"); interpolate false; triangulate false; } ); |
|
September 13, 2017, 01:54 |
|
#2 |
New Member
Kai Schüller
Join Date: Jun 2015
Location: Germany
Posts: 8
Rep Power: 11 |
I have the same problem. Did you find a solution?
|
|
September 13, 2017, 02:31 |
Re
|
#3 |
Senior Member
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10 |
I think you are missing the name of your sample, and some curly braces. Try this:
my_sample { <your previously posed dict here> } It when you post process, it should put a folder called "my_sample" in the postProcessing folder. If that doesn't work, try the template below (just change the point (1 1 1) to something in your domain). Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // volume_sample { type sets; libs ("libsampling.so"); interpolationScheme cellPoint; setFormat csv; sets ( data { type cloud; axis xyz; points ( ( 1 1 1 ) ); } ); fields ( U p ); } // ************************************************************************* // |
|
September 13, 2017, 02:56 |
|
#4 |
New Member
Kai Schüller
Join Date: Jun 2015
Location: Germany
Posts: 8
Rep Power: 11 |
Thanks for your help. Unfortunately, when I do this, I get the error
Code:
--> FOAM FATAL IO ERROR: keyword type is undefined in dictionary ".functions.sampleDict" file: .functions.sampleDict from line 20 to line 324. From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const in file db/dictionary/dictionary.C at line 566." Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // my_sample { type surfaces; libs ("libsampling.so"); interpolationScheme cellPoint; setFormat csv; surfaces ( interface { type isoSurface; isoField gamma_L; isoValue 0.5; interpolate true; } ); fields ( gamma_L ); } // ************************************************************************* // |
|
September 13, 2017, 03:44 |
|
#5 |
Senior Member
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10 |
Try running the solver. For example:
simpleFoam -postProcess Some of the function objects don't work if the required fields are not loaded (works with the -parallel option and mpi too). Check out the motorbike tutorial in tutorials/incompressible/simpleFoam/motorbike for an example of how to use some of the simple function objects. If you paste your function object in place of one of the ones used there and it doesn't run properly, the problem is in your function object. If you just run the motorbike tutorial, the function objects execute at run time because they are #include at the bottom of the controlDict. |
|
September 13, 2017, 05:01 |
|
#6 |
New Member
Kai Schüller
Join Date: Jun 2015
Location: Germany
Posts: 8
Rep Power: 11 |
Thanks. It works!
Here is what I did: 1) created a file in the system folder named surfaces Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ surfaces { type surfaces; libs ("libsampling.so"); writeControl writeTime; surfaceFormat raw; fields (gamma_L); interpolationScheme cellPoint; surfaces ( interface { type isoSurface; isoField gamma_L; isoValue 0.5; interpolate true; } ); } // ************************************************************************* // Code:
postProcess -func surfaces |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fatal overflow error in the FINMES subroutine for CHT run | prashant79_ss | CFX | 5 | September 27, 2014 05:54 |
Cannot run phoenix on linux opensuse 13.1 kde | mabal | Phoenics | 0 | June 15, 2014 07:16 |
[mesh manipulation] Cannot get refineMesh to run in parallel | smschnob | OpenFOAM Meshing & Mesh Conversion | 2 | June 3, 2014 12:20 |
First Parallel Run - need some help | Gian Maria | OpenFOAM | 3 | June 17, 2011 13:08 |
Windows 64-bit, Distributed Parallel Run Issues... | Erich | CFX | 3 | March 28, 2006 17:36 |