CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

simpleFoam crash fast!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2013, 06:42
Default
  #21
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41
-mAx- will become famous soon enough
Quote:
Originally Posted by Bernhard View Post
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...
izna likes this.
__________________
In memory of my friend Hervé: CFD engineer & freerider
-mAx- is offline   Reply With Quote

Old   August 20, 2013, 06:47
Default
  #22
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
What is in "include/initialConditions"? Any zero-values accidentally? Please check with implementation.
Bernhard is offline   Reply With Quote

Old   August 20, 2013, 06:52
Default
  #23
Senior Member
 
izna O'connor
Join Date: Jun 2013
Posts: 143
Rep Power: 12
izna is on a distinguished road
no zero value..

Quote:
flowVelocity (0 0 0);
pressure 0.01;
turbulentKE 1.0822;
turbulentEpsilon 0.01;
izna is offline   Reply With Quote

Old   August 20, 2013, 06:54
Default
  #24
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
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;
Bernhard is offline   Reply With Quote

Old   August 20, 2013, 06:55
Default
  #25
Senior Member
 
izna O'connor
Join Date: Jun 2013
Posts: 143
Rep Power: 12
izna is on a distinguished road
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
izna is offline   Reply With Quote

Old   November 27, 2013, 20:22
Default
  #26
Member
 
sqing
Join Date: Sep 2012
Location: Dalian
Posts: 77
Rep Power: 13
Sunxing is on a distinguished road
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
Sunxing is offline   Reply With Quote

Old   October 27, 2015, 14:27
Default pyfoam, templates, error
  #27
New Member
 
bernardo
Join Date: Apr 2012
Posts: 2
Rep Power: 0
bfigueroae is on a distinguished road
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 View Post
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 is offline   Reply With Quote

Old   April 17, 2016, 12:22
Default
  #28
New Member
 
Join Date: Oct 2014
Posts: 1
Rep Power: 0
ZenCFD is on a distinguished road
Quote:
Originally Posted by Sunxing View Post
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.
ZenCFD is offline   Reply With Quote

Old   February 3, 2017, 13:24
Default
  #29
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 9
khedar is on a distinguished road
Thanks ZenCFD for the solution. But how did you locate the error?
khedar is offline   Reply With Quote

Reply


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
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 15:26
Laminar simpleFoam and inviscid simpleFoam herenger OpenFOAM Running, Solving & CFD 7 July 11, 2013 06:27
Trying to run a benchmark case with simpleFoam spsb OpenFOAM 3 February 24, 2012 09:07
simpleFoam crash -> How to solve tH3f0rC3 OpenFOAM 4 May 12, 2011 07:07
Naca0012 k-e mpirun gives fpe whereas simpleFoam not Pierpaolo OpenFOAM 1 May 8, 2010 03:08


All times are GMT -4. The time now is 13:50.