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

Problem with setFields: "wrong token type - expected word"

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By hooman.es
  • 3 Post By Islem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2010, 10:22
Default Problem with setFields: "wrong token type - expected word"
  #1
New Member
 
Tommaso Massai
Join Date: Jun 2010
Location: Florence
Posts: 1
Rep Power: 0
svevo is on a distinguished road
Hi everybody,

I'm a new user of OpenFoam on a MacBookPro. I've installed OpenFOAM v.1.5 with ParaView v.3.8.

Only two words to understand the case.

I'm trying to run the "sloshingTank3D6DoF" tutorial because I think is a very close case respect to that I have to develop. I have to model a rigid tank (Dimensions: 60x30x20 cm) partially filled by water subjected to a time history of acceleration. About that I've received the suggest to employ a:

"VOF free surface
flow solver with a moving mesh"

available in OpenFOAM.

Well, every time that I try to run "setFields" to set the liquid phase fraction to 1 I get back from the program this strings of error:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading setFieldsDict

Setting field default values
--> FOAM Warning :
From function void setFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 100
Field gamma not found


wrong token type - expected word found on line 19 the label 0

file: /Users/tommasomassai/OpenFOAM/tommasomassai-1.5/run/tutorials/interDyMFoam/sloshingTank3D6DoF/system/setFieldsDict::defaultFieldValues at line 19.

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

FOAM exiting
-------------------

but there's nothing wrong because I merely run the preset tutorial.

Am I wrong ?

Have you any suggest about that, but also about the simulation that I describe before ?

Every answer is appreciated

thanks to all,
cheers,

svevo
svevo is offline   Reply With Quote

Old   July 11, 2011, 18:21
Default
  #2
Member
 
Sarah
Join Date: Apr 2011
Location: Eastern US
Posts: 31
Rep Power: 15
SMesser is on a distinguished road
You might check your directories and version numbers. I had a similar problem crop up when I was switching between 1.7.1 and 1.6-ext versions of OpenFOAM. It looks to me like 1.7.1 creates the "0" subdirectory based on the "0.org", while 1.6-ext expects the "0" to be there already. Because of the different assumptions, the Allclean script is slightly different between the two versions.
SMesser is offline   Reply With Quote

Old   November 9, 2011, 21:45
Default
  #3
New Member
 
Join Date: Jul 2010
Posts: 4
Rep Power: 15
gsingle is on a distinguished road
did you figure this out?
gsingle is offline   Reply With Quote

Old   November 10, 2011, 07:31
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
the error says:
"Field gamma not found"
so look at directory 0, is there any gamma file there?
becareful
if there is gamma.org change into gamma
but if you use a higher version of openFoam, it
uses alpha1 instead of gamma so you should change in setFields gamma to alpha1
nimasam is offline   Reply With Quote

Old   December 13, 2015, 13:01
Default
  #5
New Member
 
hooman
Join Date: Dec 2015
Posts: 1
Rep Power: 0
hooman.es is on a distinguished road
Hi, i have the same problem
I'm a new user of OpenFoam. I've installed OpenFOAM 3.0.0
would you please help me fix it?
Setting field default values
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field alpha.water not found

Setting field region values
Adding cells with center within boxes 1((0 0 -1) (0.1461 0.292 1))
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field alpha.water not found
deepak.mishra likes this.
hooman.es is offline   Reply With Quote

Old   December 14, 2015, 01:16
Default
  #6
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Hi,

have you changed alpha.water.org to alpha.water? In the interFoam tutorial there is no alpha.water field present.
Just execute
Code:
cp ./0/alpha.water.org ./0/alpha.water
in the case directory.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   April 22, 2016, 06:30
Default
  #7
New Member
 
AW
Join Date: Mar 2016
Posts: 17
Rep Power: 10
Andy_Wang is on a distinguished road
Hi, i have the same problem with setFields. I have changed the alpha.water.org in alpha.water. But the setFields is still not working und give the same warning. I really dont know how to slove it. Could anybody give me a hint? Thanks a lot!

Andy
Andy_Wang is offline   Reply With Quote

Old   April 24, 2017, 21:21
Default
  #8
New Member
 
Join Date: Mar 2017
Posts: 28
Rep Power: 9
saatt is on a distinguished road
Quote:
Originally Posted by Andy_Wang View Post
Hi, i have the same problem with setFields. I have changed the alpha.water.org in alpha.water. But the setFields is still not working und give the same warning. I really dont know how to slove it. Could anybody give me a hint? Thanks a lot!

Andy
did you solve the problem? i had the same one
saatt is offline   Reply With Quote

Old   May 3, 2017, 13:12
Default
  #9
New Member
 
Islem Megdiche
Join Date: Feb 2016
Location: Liverpool
Posts: 7
Rep Power: 10
Islem is on a distinguished road
Quote:
Originally Posted by saatt View Post
did you solve the problem? i had the same one
You need to check the controlDict, the start time has to be set to 0. For my case that was the problem. If this doesn't work for you, you can copy your mesh in dam break case, run the setField from there and then take the alpha.water file or whatever you name it to your case folder.
Islem is offline   Reply With Quote

Old   May 3, 2017, 21:27
Default
  #10
New Member
 
Join Date: Mar 2017
Posts: 28
Rep Power: 9
saatt is on a distinguished road
When i do this(cp ./0/alpha.water.org ./0/alpha.water) and rewrite the words "alpha.water" in setFieldDict, the case can run again. But i don't know the reason.
saatt is offline   Reply With Quote

Old   May 4, 2017, 00:18
Default
  #11
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
> and rewrite the words "alpha.water" in setFieldDict

This is a ascii file, the cannot be any magic. Most probably you misspelled something.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   September 26, 2020, 04:02
Question Field alpha1 not found
  #12
Member
 
Deutschland
Join Date: Sep 2020
Posts: 69
Rep Power: 5
vava10 is on a distinguished road
Hey

I am new to openfoam. I am working with wigley hull case (https://github.com/OpenFOAM/OpenFOAM...oam/wigleyHull)

when I run setFields I get the following error


/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : _b45f8f6f58-20200629 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : setFields
Date : Sep 26 2020
Time : 09:53:10
Host : LAPTOP-A0NOGRUJ
PID : 731
I/O : uncollated
Case : /home/sam/OpenFOAM/OpenFOAM-v2006/tutorials/wigleyHull
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning :
From static Foam::IOstreamOption::compressionType Foam::IOstreamOption::compressionEnum(const Foam::word&, Foam::IOstreamOption::compressionType)
in file db/IOstreams/IOstreams/IOstreamOption.C at line 115
Unknown compression specifier 'compressed', using compression off
Create mesh for time = 0

Reading setFieldsDict

Setting field default values
--> FOAM Warning :
From bool Foam::IOobject::readHeader(Foam::Istream&)
in file db/IOobject/IOobjectReadHeader.C at line 111
Reading "/home/sam/OpenFOAM/OpenFOAM-v2006/tutorials/wigleyHull/0/alpha1" at line 1
First token could not be read or is not the keyword 'FoamFile'

Check header is of the form:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class IOobject;
location "0";
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

--> FOAM Warning :
From bool setCellFieldType(const Foam::word&, const Foam::fvMesh&, const labelList&, Foam::Istream&) [with Type = double; Foam::labelList = Foam::List<int>]
in file setFields.C at line 125
Field alpha1 not found

Setting field region values
Adding cells with centre within boxes 1((-100 -100 -100) (100 100 0))
--> FOAM Warning :
From bool Foam::IOobject::readHeader(Foam::Istream&)
in file db/IOobject/IOobjectReadHeader.C at line 111
Reading "/home/sam/OpenFOAM/OpenFOAM-v2006/tutorials/wigleyHull/0/alpha1" at line 1
First token could not be read or is not the keyword 'FoamFile'

Check header is of the form:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class IOobject;
location "0";
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

--> FOAM Warning :
From bool setCellFieldType(const Foam::word&, const Foam::fvMesh&, const labelList&, Foam::Istream&) [with Type = double; Foam::labelList = Foam::List<int>]
in file setFields.C at line 125
Field alpha1 not found
Adding faces with centre within boxes 1((-100 -100 -100) (100 100 0))
--> FOAM Warning :
From bool Foam::IOobject::readHeader(Foam::Istream&)
in file db/IOobject/IOobjectReadHeader.C at line 111
Reading "/home/sam/OpenFOAM/OpenFOAM-v2006/tutorials/wigleyHull/0/alpha1" at line 1
First token could not be read or is not the keyword 'FoamFile'

Check header is of the form:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class IOobject;
location "0";
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

--> FOAM Warning :
From bool setFaceFieldType(const Foam::word&, const Foam::fvMesh&, const labelList&, Foam::Istream&) [with Type = double; Foam::labelList = Foam::List<int>]
in file setFields.C at line 322
Field alpha1 not found

End



I have changed the name to alpha1 in 0 folder.

can anyome help me to solve it?
I would really appreciate it.

kind regards
vava10
vava10 is offline   Reply With Quote

Reply

Tags
free surface model, setfields, sloshing, tank, vof model


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
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Meshing & Mesh Conversion 2 March 8, 2018 01:47
boundary conditions for simpleFoam calculation foam_noob OpenFOAM Running, Solving & CFD 8 July 1, 2015 08:07
interFoam/kOmegaSST tank filling with printStackError/Mules simpomann OpenFOAM Running, Solving & CFD 3 February 17, 2014 17:06
T Junction Stability ignacio OpenFOAM Running, Solving & CFD 5 May 2, 2013 10:44
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 14:16


All times are GMT -4. The time now is 19:38.