So it seems like there's been some changes made to Openfoam, so to get this working now (with OpenFoam9) you need to do the following in the controlDict function: * Add a line "libs ("libforces.so");" -- or you get fatal error "Unknown function type forces" * Change "rhoName" to "rho" -- or you get fatal error "Can't find rho" *Change "outputControl" and "outputInterval" to "writeControl" and "writeInterval" -- Not essential yet, but you get a deprecated function warning
bash: ./plot_forces.py: /usr/bin/python: bad interpreter: No such file or directory This is my error when i executed ./plot_forces.py can u suggest me anything?
Hi, many thanks for this tutorial, it's indeed very helpful and informative. I am just wondering if is it possible to get the force that we are applying through fvoptions? Thanks again for your work.
Thanks a lot. In my case, I tried plot_forces.py after running my simulation. But, Nothing come up... I couldn't see the gnuplot.. what's wrong with my work. I am using OpenFOAM v4.1. The different version cause error? maybe?
Thank you for this tutorial. I have question because I get an error while trying to plot: File "./plot_forces.py", line 45, in moment += [data_dict['moment']['pressure'][2] + data_dict['moment']['viscous IndexError: list index out of range Should I delete moment related lines? Thanks in advance.
Hello, nice video and your scripts are very useful. I do have a question, which I can't seem to find online: what is the command for running a simple script.sh file like the one you have from the terminal window in gnuplot? I have tried many things already but nothing has worked...
Hi there, Thanks for your video tutorial. I was actually searching for this kind of tutorial. I was trying to plot and for this I ran the script file in terminal. But is is showing that access is denied. Could you please tell me that why this is showing. N.B: I am using the same script file of yours
Hi, this is a brilliant tutorial, when I try to run the python script however, I get the error notification that the forces file is not found in the directory. The file is there and the spelling/directory etc is definitely correct, so I cannot figure out why it cannot find the forces.dat file, if you have any ideas it would be hugely appreciated?
Hey Mohanad, in the directory that the simulation files are located. I.e. not is the system, contant or initial time directory, but the directory that these folders are located
Thanks! I managed to find it. I was also trying to do a similar python script to plot the coefficients which were present in the motorBike tutorial's controlDict file (it outputs forceCoeffs). Do you know how to do this?
Hello and thanks for the tutorial. I have a question: how can i export the forces at each node so i can import them in a FEM program? Because in this tutorial it integrates the forces in the whole patch. Thank you very much :)
Thanks for the tutorials, has been making the learning curve for OpenFOAM significantly less steep. I've been trying to implement this script for a simulation of mine, but I get this error: --> FOAM FATAL ERROR: Could not find rho From function void Foam::functionObjects::forces::initialise() in file forces/forces.C at line 197. FOAM exiting Would you know why this happening? Cheers!
Hello thanks for your video, a few days ago I was looking for a method to process an OpenFOAM probes files which look similar to this file but can be much bigger than this one and reading it line by line was impossible to me, so at the end I figure it out how to load the full file in one run using "numpy" with this code. gist.github.com/efirvida/96f8bf8456ec57cc2dc1ae189e1e890a which basically replace all the parenthesis on the text file using command line tool "sed" then you can load the text file using"numpt.loadtxt" and work with it using matrix operations and save the data in numpy binary format for fastest post-process. But following your video I start to understand what should I do with my data, and that why I want to share my script here
Hello there! Many thanks for this! Your efford has helped many people! kind Regards
So it seems like there's been some changes made to Openfoam, so to get this working now (with OpenFoam9) you need to do the following in the controlDict function:
* Add a line "libs ("libforces.so");" -- or you get fatal error "Unknown function type forces"
* Change "rhoName" to "rho" -- or you get fatal error "Can't find rho"
*Change "outputControl" and "outputInterval" to "writeControl" and "writeInterval" -- Not essential yet, but you get a deprecated function warning
Thanks for your efforts to make OF easy for users. Thanks also for the github link with files that viewers can use. Great job!
Great code! Implementing your python force reading script as a part of my evolutionary wing optimization algorithm!
bash: ./plot_forces.py: /usr/bin/python: bad interpreter: No such file or directory
This is my error when i executed ./plot_forces.py
can u suggest me anything?
Great vid. self explanatory along with your commentary and instruction! What is your text editor you're using??
Hi, many thanks for this tutorial, it's indeed very helpful and informative. I am just wondering if is it possible to get the force that we are applying through fvoptions? Thanks again for your work.
Thanks a lot. In my case, I tried plot_forces.py after running my simulation. But, Nothing come up... I couldn't see the gnuplot.. what's wrong with my work.
I am using OpenFOAM v4.1. The different version cause error? maybe?
Thanks for sharing !!
Thank you bro, that was a beautiful videoclip...
Hi Friend, How you are sure that openFoam impress the force and the moment with this unit (N) and (Nm)?
Thank you for this tutorial. I have question because I get an error while trying to plot:
File "./plot_forces.py", line 45, in
moment += [data_dict['moment']['pressure'][2] + data_dict['moment']['viscous
IndexError: list index out of range
Should I delete moment related lines?
Thanks in advance.
Same....
@@alexandrealmeidaalves8913sir i deleted moment related lines and plot only forces🤷
Great. thanks a lot. but why not using matplotlib right in python?!
Hello, nice video and your scripts are very useful. I do have a question, which I can't seem to find online: what is the command for running a simple script.sh file like the one you have from the terminal window in gnuplot? I have tried many things already but nothing has worked...
+Jade Chantrell You can simply run './script.sh'. If you get a permissions error, grant executable permissions by 'chmod +x script.sh'.
Hi there,
Thanks for your video tutorial. I was actually searching for this kind of tutorial. I was trying to plot and for this I ran the script file in terminal. But is is showing that access is denied. Could you please tell me that why this is showing.
N.B: I am using the same script file of yours
+setu haque run: ' chmod +x your_script ', then try to run the script again.
Hi, this is a brilliant tutorial, when I try to run the python script however, I get the error notification that the forces file is not found in the directory. The file is there and the spelling/directory etc is definitely correct, so I cannot figure out why it cannot find the forces.dat file, if you have any ideas it would be hugely appreciated?
+pl2321 I've actually solved this problem since. It was a simple mistake, the python file in the incorrect directory, many thanks again for this video
Dear pl2321, which directory did you put the python file in for it to work? I seem to have the same problem as you.
Hey Mohanad, in the directory that the simulation files are located. I.e. not is the system, contant or initial time directory, but the directory that these folders are located
Thanks! I managed to find it. I was also trying to do a similar python script to plot the coefficients which were present in the motorBike tutorial's controlDict file (it outputs forceCoeffs). Do you know how to do this?
Hello and thanks for the tutorial. I have a question: how can i export the forces at each node so i can import them in a FEM program? Because in this tutorial it integrates the forces in the whole patch. Thank you very much :)
Thanks for the tutorials, has been making the learning curve for OpenFOAM significantly less steep. I've been trying to implement this script for a simulation of mine, but I get this error:
--> FOAM FATAL ERROR:
Could not find rho
From function void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 197.
FOAM exiting
Would you know why this happening? Cheers!
Arzed23 I also has this error but I cannot find available solution for it :(
+Arzed23 you must change "rhoName" to "rho" in file controlDict, in the folder system. Sorry my bad english =)
i try this but now , it says "keyword rhoInf is undefined in dictionary " please help me
hi i tried your method but i have this message
rhoInf is undefined in the disctionnary. i don't know what to do
Does it work with python3? I habe troubles. For example:
>>os.system("./gnuplot_script.sh")
256
and some screenshots-files appear in my working directory.
Hello thanks for your video, a few days ago I was looking for a method to process an OpenFOAM probes files which look similar to this file but can be much bigger than this one and reading it line by line was impossible to me, so at the end I figure it out how to load the full file in one run using "numpy" with this code. gist.github.com/efirvida/96f8bf8456ec57cc2dc1ae189e1e890a which basically replace all the parenthesis on the text file using command line tool "sed" then you can load the text file using"numpt.loadtxt" and work with it using matrix operations and save the data in numpy binary format for fastest post-process. But following your video I start to understand what should I do with my data, and that why I want to share my script here