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

Sampling error "Attempt to return dictionary entry as a primitive"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2021, 08:58
Default Sampling error "Attempt to return dictionary entry as a primitive"
  #1
New Member
 
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5
RichardKelly is on a distinguished road
I am following the three week tutorial series for openfoam. I am a newbie to openFOAM and these forums so please be kind . I am running openFOAM8 on ubuntu 20.04. The tutorial I am following can be found here: https://www.cfd.at/downloads/FoamTut...leFourteen.pdf



Following the tutorial I get to page 7 where it askes me to run the following commands:


>blockMesh

>setFields

>sonicFoam



Instead of running sonicFoam I run rhoPimpleFoam as I am running openFOAM8


I get the following error:
Code:
file: /home/richard/shockTube/system/controlDict/functions/linesample/sets from line 65 to line 69. From function virtual Foam::ITstream& Foam::dictionaryEntry::stream() const in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 83.


Here is what my controlDict looks like:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     rhoPimpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.007;

deltaT          1e-05;

writeControl    runTime;

writeInterval   0.001;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
    #includeFunc mag(U)
    linesample
    {
        type                    sets;
        functionObjectLibs      ("libsampling.so");
        writeControl            timeStep;
        outputInterval          1;
        
        interpolationScheme     cellPoint;
        
        setFormat   raw;
        sets
        {
            data
            {
                  type                uniform;
                  axis                x;
                  start               (-4.995 0 0);
                  end                 (4.995 0 0);
                  nPoints             1000;
            }
        };
        fields      (T mag(U) p);
}
// *


From the debugger it looks like there is an error in the data dict, but from reading the documentation I am inputting the right variables.... I think.. the only missing from the tutorial is points according to the documentation:
https://www.openfoam.com/documentati...hp#x30-1331084




RichardKelly is offline   Reply With Quote

Old   February 28, 2021, 11:59
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
I think you want "sets (..) ;" instead of "sets {...}".
Any particular reason you took the openfoam.org version instead of the openfoam.com one?
olesen is offline   Reply With Quote

Old   March 1, 2021, 18:24
Default
  #3
New Member
 
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5
RichardKelly is on a distinguished road
Thanks for that! Foiled by a bracket once again!.



Only reason I took the "openfoam.org" version is that is what installed when I installed using apt-get on Ubuntu. I did not compile myself.


Getting further along in the tutorials I am noticing I do not have cfmesh... wondering if that is a version thing or not.
RichardKelly is offline   Reply With Quote

Old   March 1, 2021, 18:53
Default
  #4
New Member
 
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5
RichardKelly is on a distinguished road
Install cfmesh after ...
RichardKelly is offline   Reply With Quote

Reply


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
No matching function error: Phase change source term added to interMixingFoam wavefunction OpenFOAM Programming & Development 2 February 4, 2022 07:46
[pimpleDyMFoam][dynamicMeshDict] "Attempt to return dictionary entry as a primitive" Sorabh OpenFOAM 5 July 19, 2019 06:57
Creating a new field from terms of the turbulence model HaZe OpenFOAM Programming & Development 15 November 24, 2014 13:51
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


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