CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   wrong token type - expected word, found on line 80 the punctuation token '(' (https://www.cfd-online.com/Forums/openfoam-pre-processing/217591-wrong-token-type-expected-word-found-line-80-punctuation-token.html)

hasha May 17, 2019 12:01

wrong token type - expected word, found on line 80 the punctuation token '('
 
1 Attachment(s)
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

guin May 17, 2019 13:39

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.

hasha May 17, 2019 14:12

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


guin May 17, 2019 17:19

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,

hasha May 18, 2019 05:40

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 :confused::confused::confused::mad:, 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)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



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