|
[Sponsors] |
January 5, 2022, 09:57 |
Problems with PyFoam and batch file!
|
#1 |
New Member
Alfonso Giancola
Join Date: Nov 2021
Posts: 4
Rep Power: 5 |
Hello everyone! I am working with pyFoam to try to automize some of the processes that are necessary to run an OF simulation. With my team we decided to implement some pyfoam commands in a batch file. All run smooth but pyFoamCreateBoundaryPatches.py gives us errors. The commands written in the batch works properly if written in the terminal one by one, so I do not think that it is a pyfoam syntax problem. Here there are the lines of the batch till the incriminated one:
#!/bin/bash #_________________________________________________ _____________________________________ #Cleaning the folder from the previous run rm -rf *[1-9]* rm -f log.* #_________________________________________________ __________________________________________________ __________________________________________________ ___________ #"0 FOLDER" SETUP #Setting of internal field. NOTE THAT IF ONE OR MORE OF THE FIELDS ARE NOT NECESSARIES, PUT A "#" BEFORE THE "pyFoamWriteDictionary.py" STRING pyFoamWriteDictionary.py --strip-quotes-from-value 0/U "internalField" "uniform (13.89 0 0)" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/p "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/k "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/omega "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/nut "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/nuTilda "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY pyFoamWriteDictionary.py --strip-quotes-from-value 0/epsilon "internalField" "uniform 0" #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY #Define boundary patches: prepared U, p, nuTilda, nut, omega, k, epsilon file REQUIRED!! #CHANGE THE VALUES TO ADAPT AT THE CASE OF STUDY #U pyFoamCreateBoundaryPatches.py --default="{ ' type ':'noSlip'}" 0/U pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform (0 0 0) '}" 0/U pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform (0 0 0) '}" 0/U #p pyFoamCreateBoundaryPatches.py 0/p pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/p pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/p #epsilon pyFoamCreateBoundaryPatches.py 0/epsilon pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/epsilon pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/epsilon #k pyFoamCreateBoundaryPatches.py 0/k pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/k pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/k #nuTilda pyFoamCreateBoundaryPatches.py 0/nuTilda pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/nuTilda pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/nuTilda #omega pyFoamCreateBoundaryPatches.py 0/omega pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/omega pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/omega #nut pyFoamCreateBoundaryPatches.py 0/nut pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="inlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/nut pyFoamCreateBoundaryPatches.py --verbose --overwrite --filter="outlet+" --default="{ ' type ':' fixedValue ','value ':' uniform 0 '}" 0/nut While here the errors during the run of the batch file: Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/U\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/U\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/U\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/p\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/p\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/p\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/epsilon\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/epsilon\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/epsilon\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/k\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/k\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/lib/python2.7/site-packages/PyFoam/Applications/CreateBoundaryPatches.py: Problem wi : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/k\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nuTilda\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nuTilda\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nuTilda\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/omega\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/omega\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/omega\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nut\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nut\r.gz'' in Application-class: CreateBoundaryPatches Error in /home/alfogianco/.local/bin/pyFoamCreateBoundaryPatches.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 93 of file /home/alfogianco/.local/l : [Errno 2] No such file or directory: '/home/alfogianco/OpenFOAM/alfogianco-9/run/airFoil2D/0/nut\r.gz'' in Application-class: CreateBoundaryPatches Thank you for your help, and wish you a happy new year! |
|
Tags |
batch, linux, openfoam, pyfoam, python |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[PyFoam] modifying Dictionary | ashkan | OpenFOAM Community Contributions | 8 | September 14, 2021 14:50 |
[PyFoam] batch set up for OF 1.7 | eelcovv | OpenFOAM Community Contributions | 3 | January 19, 2011 09:38 |