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

wrong token type - expected word, found on line 80 the punctuation token '('

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2019, 12:01
Default wrong token type - expected word, found on line 80 the punctuation token '('
  #1
New Member
 
Sri harsha Revu
Join Date: Apr 2019
Posts: 4
Rep Power: 7
hasha is on a distinguished road
Hello,
I am trying to create 2 blocks in a wedge of 5 deg, wedge radius of 7 mm and width of 5 mm. I have written my blockMeshDict when i am running this in openFoam 6 i am getting an error like this

wrong token type - expected word, found on line 80 the punctuation token '(' .


I have attached my blockMeshDict zip file, please help me i got stuck with this from a week.
I have 2 questions to you guys
1. Do the trailing spaces in blockMeshDict file causes any problem?
2. How should i define a interface boundary condition in case of multiple blocks?

Thanks a lot.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     6.0;
    format      binary;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

w_rmin 0;    // In y direction
w_rmax 7;
n_rmin 0;
n_rmax 0.3;
xmin 0;                                                                    
xmax 5;
theta 5;

//delta_x 6E-3;
//delta_y 6E-3;

//xcells #calc "($xmax-$xmin)/$delta_x";
//n_ycells #calc "($n_rmax-$n_rmin)/$delta_y";
//w_ycells #calc "($w_rmax-$w_rmin)/$delta_y";

vertices
(
    //Block 0
    (0 0 0)                                        //0
    (0 #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")        //1
    (0 #calc "$n_rmax*cos($theta/2.0)" #calc "-$n_rmax*sin($theta/2.0)")        //2
    ($xmax 0 0)                                    //3    
    ($xmax #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")        //4    
    ($xmax #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")        //5
    //Block 1
    (0 #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")        //6
    (0 #calc "$n_rmax*cos($theta/2.0)" #calc "-$n_rmax*sin($theta/2.0)")        //7
    ($xmax #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")      //8
    ($xmax #calc "$n_rmax*cos($theta/2.0)" #calc "$n_rmax*sin($theta/2.0)")        //9
    ($xmax #calc "$w_rmax*cos($theta/2.0)" #calc "$w_rmax*sin($theta/2.0)")        //10
    ($xmax #calc "$w_rmax*cos($theta/2.0)" #calc "-$w_rmax*sin($theta/2.0)")    //11
    (0 #calc "$w_rmax*cos($theta/2.0)" #calc "$w_rmax*sin($theta/2.0)")        //12
    (0 #calc "$w_rmax*cos($theta/2.0)" #calc "-$w_rmax*sin($theta/2.0)")        //13
);

blocks
(
hex (0 3 5 2 0 3 4 1) (100 100 1) simpleGrading(1 1 1)      //block 0
hex (9 11 13 7 8 10 12 6) (100 100 1) simpleGrading(1 1 1)    //blcok 1
);

edges
(
);

boundary
(
    front
    {
        type wedge;
    faces
        (
        (3 0 5 2)
        (9 7 13 11)
    )
    }
    back
    {
    type wedge;
    faces
        (
        (4 1 0 3)
        (10 12 6 8)
    );
    }

    inlet
    {
    type wall;
    faces
    (
        (0 1 2 0)
        (6 12 13 7)
    );
    }

    outlet
    {
        type wall;
    faces
    (
        (3 5 4 3)
        (9 11 10 8)
    );
    }

    wedgewall
    {
    type wall;
    faces
    (
        (10 11 13 12)
    );
    }
    needlwall1
    {
    type wall;
    faces
    (
        (4 1 2 5)
    );
    }

    needlwall2
    {
    type wall;
    faces
    (
        (8 6 7 9)
    );
    }

    axis
    {
        type symmetry;
        faces
        (
            (0 3 3 0)
        );
     }       
);

mergePatchPairs
(
    (needlwall1 needlwall2)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
PFA
Attached Files
File Type: zip blockMeshDict.zip (1,015 Bytes, 8 views)

Last edited by hasha; May 18, 2019 at 02:19.
hasha is offline   Reply With Quote

Old   May 17, 2019, 13:39
Default
  #2
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Just a hint

Ensure to leave an empty space before every $-sign in order to avoid the combination of signs to be interpreted as whole. For instance:

*$ - > * $
/$ -> / $
+$ -> + $
-$ -> - $
($ -> ( $

Except for:
"$ .... this should be fine.
guin is offline   Reply With Quote

Old   May 17, 2019, 14:12
Default
  #3
New Member
 
Sri harsha Revu
Join Date: Apr 2019
Posts: 4
Rep Power: 7
hasha is on a distinguished road
Hello guin,
Thanks for writing back, I have done the same as you said but the error was same. please find the modified blockMeshDict and error reported.
The error it was showing at line 80 but i dont find any extra parenthesis there(highlighted line 80) . could you please help me out.



Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     6.0;
    format      binary;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

w_rmin 0;    // In y direction
w_rmax 7;
n_rmin 0;
n_rmax 0.3;
xmin 0;                                                                    
xmax 5;
theta 5;

//delta_x 6E-3;
//delta_y 6E-3;

//xcells #calc "($xmax-$xmin)/$delta_x";
//n_ycells #calc "($n_rmax-$n_rmin)/$delta_y";
//w_ycells #calc "($w_rmax-$w_rmin)/$delta_y";

vertices
(
    //Block 0
    (0 0 0)                                        //0
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //1
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //2
    ( $xmax 0 0)                                    //3    
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //4    
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //5
    //Block 1
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //6
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //7
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")      //8
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //9
    ( $xmax #calc "$w_rmax*cos( $theta/2.0)" #calc "$w_rmax*sin( $theta/2.0)")        //10
    ( $xmax #calc "$w_rmax*cos( $theta/2.0)" #calc "- $w_rmax*sin( $theta/2.0)")    //11
    (0 #calc "$w_rmax*cos( $theta/2.0)" #calc "$w_rmax*sin( $theta/2.0)")        //12
    (0 #calc "$w_rmax*cos( $theta/2.0)" #calc "- $w_rmax*sin( $theta/2.0)")        //13
);

blocks
(
hex (0 3 5 2 0 3 4 1) (100 100 1) simpleGrading(1 1 1)      //block 0
hex (9 11 13 7 8 10 12 6) (100 100 1) simpleGrading(1 1 1)    //blcok 1
);

edges
(
);

boundary
(
    front
    {
        type wedge;
    faces
        (
        (3 0 5 2)
        (9 7 13 11)
    )
    }
    back
    {
    type wedge;
    faces
        (
        (4 1 0 3)
        (10 12 6 8)
    );
    }

    inlet
    {
    type wall;
    faces
    (
        (0 1 2 0)
        (6 12 13 7)
    );
    }

    outlet
    {
        type wall;
    faces
    (
        (3 5 4 3)
        (9 11 10 8)
    );
    }

    wedgewall
    {
    type wall;
    faces
    (
        (10 11 13 12)
    );
    }
    needlwall1
    {
    type wall;
    faces
    (
        (4 1 2 5)
    );
    }

    needlwall2
    {
    type wall;
    faces
    (
        (8 6 7 9)
    );
    }

    axis
    {
        type symmetry;
        faces
        (
            (0 3 3 0)
        );
     }       
);

mergePatchPairs
(
    (needlwall1 needlwall2)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
error copied from the terminal
Code:
--> FOAM FATAL IO ERROR: 
wrong token type - expected word, found on line 80 the punctuation token '('

file: /home/harsha/Desktop/test_blockmesh/system/blockMeshDict.faces at line 80.

    From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&)
    in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting
hasha is offline   Reply With Quote

Old   May 17, 2019, 17:19
Default
  #4
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
The error is due to a a missing semicolon at line 74 right at the end of "faces"-list, from "front" patch.
Nevertheless, you will get further errors. Take a look at the order of the points for the generation of the hex-blocks https://cfd.direct/openfoam/user-guide/v6-blockMesh/
Best,
guin is offline   Reply With Quote

Old   May 18, 2019, 05:40
Default
  #5
New Member
 
Sri harsha Revu
Join Date: Apr 2019
Posts: 4
Rep Power: 7
hasha is on a distinguished road
I have checked the blocks the numbering is righthanded every where in the block i even changed it to another style but the error wont change. some body help me , is it a bug why it is showing a wrong token type - expected word, found on line 71 the punctuation token '(' .
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     6.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

w_rmin 0;    // In y direction
w_rmax 7;
n_rmin 0;
n_rmax 0.3;
xmin 0;                                                                    
xmax 5;
theta 5;

//delta_x 6E-3;
//delta_y 6E-3;

//xcells #calc "($xmax-$xmin)/$delta_x";
//n_ycells #calc "($n_rmax-$n_rmin)/$delta_y";
//w_ycells #calc "($w_rmax-$w_rmin)/$delta_y";

vertices
(
    //Block 0
    (0 0 0)                                        //0
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //1
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //2
    ( $xmax 0 0)                                    //3    
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //4    
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //5
    //Block 1
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")        //6
    (0 #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //7
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "$n_rmax*sin( $theta/2.0)")      //8
    ( $xmax #calc "$n_rmax*cos( $theta/2.0)" #calc "- $n_rmax*sin( $theta/2.0)")        //9
    ( $xmax #calc "$w_rmax*cos( $theta/2.0)" #calc "$w_rmax*sin( $theta/2.0)")        //10
    ( $xmax #calc "$w_rmax*cos( $theta/2.0)" #calc "- $w_rmax*sin( $theta/2.0)")    //11
    (0 #calc "$w_rmax*cos( $theta/2.0)" #calc "$w_rmax*sin( $theta/2.0)")        //12
    (0 #calc "$w_rmax*cos( $theta/2.0)" #calc "- $w_rmax*sin( $theta/2.0)")        //13
);

blocks
(
hex (0 2 1 0 3 5 4 3) (100 100 1) simpleGrading(1 1 1)      //block 0
hex (7 13 12 6 9 11 10 8) (100 100 1) simpleGrading(1 1 1)    //blcok 1
);

edges
(
);

boundary
(
    frontAndBack
    {
        type wedge;
    faces
        (
(3 0 5 2)
(9 7 13 11)
(4 1 0 3)
(10 12 6 8)
    );
    }
    /*back
    {
    type wedge;
    faces
        (
        (4 1 0 3)
        (10 12 6 8)
    );
    }
*/
    inlet
    {
    type wall;
    faces
    (
        (0 1 2 0)
        (6 12 13 7)
    );
    }

    outlet
    {
        type wall;
    faces
    (
        (3 5 4 3)
        (9 11 10 8)
    );
    }

    wedgewall
    {
    type wall;
    faces
    (
        (10 11 13 12)
    )
    }
    needlwall1
    {
    type wall;
    faces
    (
        (4 1 2 5)
    );
    }

    needlwall2
    {
    type wall;
    faces
    (
        (8 6 7 9)
    );
    }

    axis
    {
        type symmetry;
        faces
        (
            (0 3 3 0)
        );
     }       
);

mergePatchPairs
(
    (needlwall1 needlwall2)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
hasha is offline   Reply With Quote

Old   March 31, 2022, 07:53
Default
  #6
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 97
Rep Power: 5
saicharan662000@gmail.com is on a distinguished road
Hello hasha,
did you find the solution?
saicharan662000@gmail.com is offline   Reply With Quote

Reply

Tags
blockmeshdict, openfaom-6


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
MPI error in parallel application usv001 OpenFOAM Programming & Development 2 September 14, 2017 12:30
[snappyHexMesh] Problem with Sanpper, surface still Rough Zephiro88 OpenFOAM Meshing & Mesh Conversion 7 November 5, 2014 13:05
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 05:26
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 12:15.