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

trying to run OpenFOAM using python sending commmand lines

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2021, 15:02
Question trying to run OpenFOAM using python sending commmand lines
  #1
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 9
Ash Kot is on a distinguished road
Hello Foamers,

how to run follwing command:
Code:
mpirun -np 4 interFoam -parallel > log & tail -f log
using python as command line in terminal?

My perpose is to run the command, simlutaniouly show the running log in terminal, as well as read the 'log' file using the python script and once it read the message ''Finalising Parallel run" in that log file then run follwing command:
Code:
pkill interFoam
Ash Kot is offline   Reply With Quote

Old   February 23, 2021, 17:02
Default
  #2
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 9
Ash Kot is on a distinguished road
Hello All,

How to write PyFoam equivalent script for the above defined command, which is:
Code:
mpirun -np 4 interFoam -parallel > log & tail -f log
Ash Kot is offline   Reply With Quote

Old   February 25, 2021, 19:30
Default
  #3
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 9
Ash Kot is on a distinguished road
Hello,

Anyone know how to use PyFoam and convrt above mentioned command and make OpenFOAM simulation run through PyFoam?

Essntially, I'm trying to run PyFoam code which will equivalantly execute the below given code:

Code:
 mpirun -np 4 interFoam -parallel > log & tail -f log
Ash Kot is offline   Reply With Quote

Reply

Tags
automation, openfoam 7, python script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
big difference between clockTime and executionTime LM4112 OpenFOAM Running, Solving & CFD 21 February 15, 2019 03:05
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 19:00
Python for openfoam Divyaprakash OpenFOAM Programming & Development 1 August 22, 2014 09:05


All times are GMT -4. The time now is 17:44.