CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   simpleFoam crash fast! (https://www.cfd-online.com/Forums/openfoam-solving/122009-simplefoam-crash-fast.html)

izna August 10, 2013 02:16

simpleFoam crash fast!
 
Hi..

after meshing my case successfully, I run simpleFoam, to obtain the following error.

can anyone tell me what should i do?


Quote:

> FOAM Warning :
From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/Field.C at line 262
Reading "/home/izna/Desktop/Askervein/0/U.boundaryField.inlet" from line 35 to line 43
expected keyword 'uniform' or 'nonuniform', assuming deprecated Field format from Foam version 2.0.
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 log in "/lib/i386-linux-gnu/libm.so.6"
#4 Foam::incompressible::atmBoundaryLayerInletVelocit yFvPatchVectorField::atmBoundaryLayerInletVelocity FvPatchVectorField(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#5 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::incompres sible::atmBoundaryLayerInletVelocityFvPatchVectorF ield>::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#6 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#7 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::readField( Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#8 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields() in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#10 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#11
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#12 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#13
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)



Pat84 August 10, 2013 12:21

Looks like you forgot the word "uniform" for your velocity inlet boundary condition

izna August 12, 2013 00:46

hi

this is my file for U.. I have not forgotten the word uniform..:(

Quote:

#include "include/initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform $flowVelocity;

boundaryField
{
#include "include/ABLConditions"

outlet
{
type zeroGradient;
}

inlet
{
type atmBoundaryLayerInletVelocity;
Uref $Uref;
Href $Href;
n $windDirection;
z $zDirection;
z0 $z0;
value $internalField;
zGround $zGround;
kappa 0.4;
}


terrain_patch0
{
type uniformFixedValue;
value uniform (0 0 0);
}

ground
{
type fixedValue;
value uniform (0 0 0);
}

top
{
type atmBoundaryLayerInletVelocity;
Uref $Uref;
Href $Href;
n $windDirection;
z $zDirection;
z0 $z0;
value $internalField;
zGround $zGround;
kappa 0.4;
}

#include "include/sideAndTopPatches"
}


-mAx- August 12, 2013 01:56

all your "$"-parameters are not set.
I assume you should run a script which replaces all the $-parameters with right value

izna August 12, 2013 03:02

dear Max,

can you please elaborate...:(

where to define those parameters? i mean which folders?

-mAx- August 12, 2013 03:18

I am not experienced with atmBoundaryLayerInletVelocity, but for sure the third line of your U file should look like "internalField uniform (0 0 0);"
where (0 0 0) is the velocity vector for domain initialization.
But you have "internalField uniform $flowVelocity;"
$flowVelocity is a parameter for a script, which should automatically set the velocity vector (understand replace $flowVelocity with the right vector).
So either you get this script, and you run it, or you replace all the "$-parameters" with their right values.
The script is not a part of OF.

izna August 13, 2013 03:52

hi thanks for the reply dear max

can you tell me what does the followingh error means? I get this when i run ./Allrun

Quote:

running 500,000 cells mesh
Traceback (most recent call last):
File "./runAskervein.py", line 26, in <module>
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
ImportError: No module named PyFoam.RunDictionary.SolutionDirectory
running 5,000,000 cells
Traceback (most recent call last):
File "./runAskervein.py", line 26, in <module>
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
ImportError: No module named PyFoam.RunDictionary.SolutionDirectory


-mAx- August 13, 2013 03:57

edit "Allrun" file and check what it is supposed to do.

izna August 13, 2013 04:03

Quote:

echo running 500,000 cells mesh
./runAskervein.py . Askervein_SHM_200 598167.367 6339602.511 10000 10000 30 200 1000 120
echo running 5,000,000 cells
./runAskervein.py . Askervein_SHM_75 598167.367 6339602.511 10000 10000 30 75 1000 120

it is supposed to do the above..

izna August 13, 2013 04:09

i got that case from the net and each i am geting the same error..

-mAx- August 13, 2013 04:12

check this script runAskervein.py

Pat84 August 13, 2013 04:14

Have you installed pyFoam?

izna August 13, 2013 05:00

On installing the pyFOam and again running ./Allrun.. i obtain the foll error..

Quote:

Traceback (most recent call last):
File "./runAskervein.py", line 114, in <module>
template = TemplateFile(bmName+".template")
File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/TemplateFile.py", line 381, in __init__
escape=None
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 1190, in __init__
parsetree = p.parse(tmpl)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 547, in parse
return self._parse(template)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 755, in _parse
self._parse_sub(parsetree, template[curr:], fpos)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 578, in _parse_sub
self._testexpr(match.group("sub"), fpos+start)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 560, in _testexpr
raise TemplateSyntaxError(err, self._errpos(fpos))
PyFoam.ThirdParty.pyratemp.TemplateSyntaxError: line 2, col 1: invalid syntax (, line 1)
running 5,000,000 cells
Traceback (most recent call last):
File "./runAskervein.py", line 114, in <module>
template = TemplateFile(bmName+".template")
File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/TemplateFile.py", line 381, in __init__
escape=None
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 1190, in __init__
parsetree = p.parse(tmpl)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 547, in parse
return self._parse(template)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 755, in _parse
self._parse_sub(parsetree, template[curr:], fpos)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 578, in _parse_sub
self._testexpr(match.group("sub"), fpos+start)
File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/pyratemp.py", line 560, in _testexpr
raise TemplateSyntaxError(err, self._errpos(fpos))
PyFoam.ThirdParty.pyratemp.TemplateSyntaxError: line 2, col 1: invalid syntax (, line 1)



izna August 13, 2013 05:10

Quote:

Originally Posted by -mAx- (Post 445358)
check this script runAskervein.py


Max when i do the command its says:
Quote:

runAskervein.py: command not found

EVen after i installed the pyFoam it says same things.

-mAx- August 13, 2013 06:59

with check I meant edit the file and check what it is executing...
For running it, you have to know which arguments etc... you have to enter.
But I don't know exactly what does this script and I suggest you to ignore it and go back to basics: set your BC properly and run simpleFoam.

izna August 20, 2013 05:51

simpleFoam error due to atmBoundaryLayerInletVelocity
 
Each time same error.. I need help badly
Quote:

Create time

Create mesh for time = 0

Reading field p

Reading field U

--> FOAM Warning :
From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.1/src/OpenFOAM/lnInclude/Field.C at line 262
Reading "/home/izna/Desktop/AskerveinM/0/U.boundaryField.inlet" from line 35 to line 16
expected keyword 'uniform' or 'nonuniform', assuming deprecated Field format from Foam version 2.0.
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 log in "/lib/i386-linux-gnu/libm.so.6"
#4 Foam::incompressible::atmBoundaryLayerInletVelocit yFvPatchVectorField::atmBoundaryLayerInletVelocity FvPatchVectorField(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#5 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::incompres sible::atmBoundaryLayerInletVelocityFvPatchVectorF ield>::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#6 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#7 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::readField( Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#8 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields() in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#10 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#11
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#12 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#13
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)



Bernhard August 20, 2013 06:12

Quote:

Originally Posted by -mAx- (Post 445089)
$flowVelocity is a parameter for a script, which should automatically set the velocity vector (understand replace $flowVelocity with the right vector).
So either you get this script, and you run it, or you replace all the "$-parameters" with their right values.
The script is not a part of OF.

This is not correct as
Code:

#include "include/initialConditions"
would probably contain
Code:

flowVelocity (10 0 0);
this should work fine.

-mAx- August 20, 2013 06:26

Quote:

Originally Posted by Bernhard (Post 446852)
This is not correct as
Code:

#include "include/initialConditions"
would probably contain
Code:

flowVelocity (10 0 0);
this should work fine.

But all the $-parameters should remain in the U-file, or they will be replaced with their rihgt values?
I never used "include/initialConditions

Bernhard August 20, 2013 06:29

The correct values will be used. Pretty handy if you need variables at multiple places. You can include any file that you wish. For example, sometimes I include the blockMeshDict in the setFieldsDict, works perfectly fine.

Especially in OF 2.2, there are some advanced possibilities, see: http://www.openfoam.org/version2.2.0/pre-processing.php

izna August 20, 2013 06:37

Hi Bernard Below is my ABL file.. I have configured everyhting step by step and all my $ have been already initialised.. still i get error..:(

Quote:

#include "include/initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform $flowVelocity;

boundaryField
{
#include "include/ABLConditions"

outlet
{
type zeroGradient;
}

inlet
{
type atmBoundaryLayerInletVelocity;
Uref $Uref;
Href $Href;
n $windDirection;
z $zDirection;
z0 $z0;
value $internalField;
zGround $zGround;
//kappa 0.4;
}


terrain_patch0
{
type fixedValue;
value uniform (0 0 0);
}

ground
{
type fixedValue;
value uniform (0 0 0);
}

top
{
type atmBoundaryLayerInletVelocity;
Uref $Uref;
Href $Href;
n $windDirection;
z $zDirection;
z0 $z0;
value $internalField;
zGround $zGround;
//kappa 0.4;
}

#include "include/sideAndTopPatches"
}


-mAx- August 20, 2013 06:42

Quote:

Originally Posted by Bernhard (Post 446859)
The correct values will be used. Pretty handy if you need variables at multiple places. You can include any file that you wish. For example, sometimes I include the blockMeshDict in the setFieldsDict, works perfectly fine.

Ok I was focused on a script which replaced those parameters automatically.
Thanks for the refresh-session, I need vacation...

Bernhard August 20, 2013 06:47

What is in "include/initialConditions"? Any zero-values accidentally? Please check with implementation.

izna August 20, 2013 06:52

no zero value..:(

Quote:

flowVelocity (0 0 0);
pressure 0.01;
turbulentKE 1.0822;
turbulentEpsilon 0.01;


Bernhard August 20, 2013 06:54

Where did you define these variable? I assumed they were in this include file?
Uref $Uref;
Href $Href;
n $windDirection;
z $zDirection;
z0 $z0;
zGround $zGround;

izna August 20, 2013 06:55

Quote:


Ustar 0.6110;
Uref 18.767;
Href 6500;
z0 0.03;
turbulentKE 1.0822;
windDirection (1 0 0);
zDirection (0 0 1);
zGround uniform 0.02;

these are in ABL conditions

Sunxing November 27, 2013 20:22

Hi izna,

Have you solved the problem? I‘m trying to do the same case with you and I also find the error:

PyFoam.ThirdParty.pyratemp.TemplateSyntaxError: line 2, col 1: invalid syntax (, line 1)

If you have made any progress, please tell me.

Best regards

sunxing

bfigueroae October 27, 2015 14:27

pyfoam, templates, error
 
Hello. Newbie on this pyfoam automation thing.

Anybody knows why pyfoam crashes when trying to invoke template.writeToFile?

template.writeToFile(bmName,{'z0':z0,'us':us})
gets the following error:


Traceback (most recent call last):
File "./run_z0.py", line 113, in <module>
main(template0, template, orig, target0, withBlock, z0)
File "./run_z0.py", line 73, in main
template = TemplateFile(bmName+".template")
File "/usr/local/lib/python2.7/site-packages/PyFoam/Basics/TemplateFile.py", line 381, in __init__
escape=None
File "/usr/local/lib/python2.7/site-packages/PyFoam/ThirdParty/pyratemp.py", line 1190, in __init__
parsetree = p.parse(tmpl)
File "/usr/local/lib/python2.7/site-packages/PyFoam/ThirdParty/pyratemp.py", line 547, in parse
return self._parse(template)
File "/usr/local/lib/python2.7/site-packages/PyFoam/ThirdParty/pyratemp.py", line 755, in _parse
self._parse_sub(parsetree, template[curr:], fpos)
File "/usr/local/lib/python2.7/site-packages/PyFoam/ThirdParty/pyratemp.py", line 578, in _parse_sub
self._testexpr(match.group("sub"), fpos+start)
File "/usr/local/lib/python2.7/site-packages/PyFoam/ThirdParty/pyratemp.py", line 560, in _testexpr
raise TemplateSyntaxError(err, self._errpos(fpos))


:(



Quote:

Originally Posted by Sunxing (Post 463828)
Hi izna,

Have you solved the problem? I‘m trying to do the same case with you and I also find the error:

PyFoam.ThirdParty.pyratemp.TemplateSyntaxError: line 2, col 1: invalid syntax (, line 1)

If you have made any progress, please tell me.

Best regards

sunxing


ZenCFD April 17, 2016 12:22

Quote:

Originally Posted by Sunxing (Post 463828)
Hi izna,

Have you solved the problem? I‘m trying to do the same case with you and I also find the error:

PyFoam.ThirdParty.pyratemp.TemplateSyntaxError: line 2, col 1: invalid syntax (, line 1)

If you have made any progress, please tell me.

Best regards

sunxing

I've been having the same problem for a week now but finally I solved it. simply add the following arg to the call of TemplateFile:

Code:

expressionDelimiter="$"
wich makes a line like this:

Code:

template = TemplateFile( bmName + ".template",expressionDelimiter="$")
It seems that newer versions of pyFoam (0.6.5) have different expression delimiters than the old ones.
I know its too late to post this but I do it to help others having this problem since it was hard to find a solution for me.

khedar February 3, 2017 13:24

Thanks ZenCFD for the solution. But how did you locate the error?


All times are GMT -4. The time now is 02:05.