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/)
-   -   Problem with setFields: "wrong token type - expected word" (https://www.cfd-online.com/Forums/openfoam-pre-processing/77064-problem-setfields-wrong-token-type-expected-word.html)

svevo June 11, 2010 10:22

Problem with setFields: "wrong token type - expected word"
 
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

SMesser July 11, 2011 18:21

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.

gsingle November 9, 2011 22:45

did you figure this out?

nimasam November 10, 2011 08:31

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

hooman.es December 13, 2015 14:01

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

fabian_roesler December 14, 2015 02:16

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

Andy_Wang April 22, 2016 06:30

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

saatt April 24, 2017 21:21

Quote:

Originally Posted by Andy_Wang (Post 596270)
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

Islem May 3, 2017 13:12

Quote:

Originally Posted by saatt (Post 646370)
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.

saatt May 3, 2017 21:27

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.

piu58 May 4, 2017 00:18

> and rewrite the words "alpha.water" in setFieldDict

This is a ascii file, the cannot be any magic. Most probably you misspelled something.


All times are GMT -4. The time now is 23:27.