CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   FOAM FATAL IO ERROR: Wrong token type (https://www.cfd-online.com/Forums/openfoam/254252-foam-fatal-io-error-wrong-token-type.html)

francedisab January 30, 2024 05:08

FOAM FATAL IO ERROR: Wrong token type
 
Hello,
I'm running some simulations for my thesis with openfoam. I started with the motorbike file (simpleFoam simulation) and I changed geometry with mine. There are two different geometry files.
I didn't find any problem with the snappyHexMesh command but now I'm trying to run the simulation and I have this error message:


[4] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[4] Wrong token type - expected word or string, found on line 0: punctuation '{'
[4]
[4] file: stream.functions.near.patches at line 0.
[4]
[4] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[4] in file primitives/strings/wordRe/wordRe.C at line 121.
[4]
FOAM parallel run exiting
[4]
[5]
[5]
[5] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[5] Wrong token type - expected word or string, found on line 0: punctuation '{'
[5]
[5] file: stream.functions.near.patches at line 0.
[5]
[5] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[5] in file primitives/strings/wordRe/wordRe.C at line 121.
[5]
FOAM parallel run exiting
[5]
[0]
[0]
[0] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[0] Wrong token type - expected word or string, found on line 32: punctuation '{'
[0]
[0] file: system/controlDict.functions.near.patches at line 32.
[0]
[0] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[0] in file primitives/strings/wordRe/wordRe.C at line 121.
[0]
FOAM parallel run exiting
[0]
[1]
[1]
[1] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[1] Wrong token type - expected word or string, found on line 0: punctuation '{'
[1]
[1] file: stream.functions.near.patches at line 0.
[1]
[1] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[1] in file primitives/strings/wordRe/wordRe.C at line 121.
[1]
FOAM parallel run exiting
[1]
[2]
[2]
[2] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[2] Wrong token type - expected word or string, found on line 0: punctuation '{'
[2]
[2] file: stream.functions.near.patches at line 0.
[2]
[2] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[2] in file primitives/strings/wordRe/wordRe.C at line 121.
[2]
FOAM parallel run exiting
[2]
[3]
[3]
[3] --> FOAM FATAL IO ERROR: (openfoam-2212 patch=230612)
[3] Wrong token type - expected word or string, found on line 0: punctuation '{'
[3]
[3] file: stream.functions.near.patches at line 0.
[3]
[3] From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::wordRe&)
[3] in file primitives/strings/wordRe/wordRe.C at line 121.
[3]
FOAM parallel run exiting


I checked every file and I didn't find anything wrong for what i know. Where should I check?


Hope someone can help me! Thank you!

Yann January 30, 2024 05:25

Hello,

Your error seems to be related to the function objects used in controlDict, and more specifically the patches parameter of the function near:

Code:

[4] Wrong token type - expected word or string, found on line 0: punctuation '{'
[4]
[4] file: stream.functions.near.patches at line 0.

If you have updated this parameter, make sure there is no syntax issue with it.

Regards,
Yann

francedisab January 30, 2024 05:42

Thank you for your reply!
I think I found the mistake in system/wallBoundedStreamLines, where I define the near function. I wrote:


near
{
type nearWallFields;
libs (fieldFunctionObjects);

writeControl writeTime;

executeControl writeTime;

fields
(
(U UNear)
);

patches
(
{
name wheelGroup;
}

{
name alaanterioreGroup;
}
);

distance 0.001;
}


The problem should be with the brackets in patches, am I right? But what's the correct way to write it?

Yann January 30, 2024 05:47

This is it indeed, this is not the proper way to write it, you just need to give a list of patches or groups:

Code:

patches (wheelGroup alaanterioreGroup);
You can have a look at the documentation for more details: https://doc.openfoam.com/2306/tools/...earWallFields/

Cheers,
Yann

francedisab January 30, 2024 06:09

It's running! I'll check the link, it'll be very helpfull.
Thank you very much!


Cheers,
Francesca


All times are GMT -4. The time now is 00:25.