How to Plot Forces in OpenFOAM

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 33

  • @yiannis.3623
    @yiannis.3623 Рік тому

    Hello there! Many thanks for this! Your efford has helped many people! kind Regards

  • @avianhanggliders1985
    @avianhanggliders1985 2 роки тому +1

    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

  • @a1e5i9ou
    @a1e5i9ou 5 років тому

    Thanks for your efforts to make OF easy for users. Thanks also for the github link with files that viewers can use. Great job!

  • @brandonjohnson8880
    @brandonjohnson8880 6 років тому

    Great code! Implementing your python force reading script as a part of my evolutionary wing optimization algorithm!

  • @riddhideepbiswas1895
    @riddhideepbiswas1895 5 років тому +3

    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?

  • @Jwil3743
    @Jwil3743 8 років тому

    Great vid. self explanatory along with your commentary and instruction! What is your text editor you're using??

  • @deeptipandey6156
    @deeptipandey6156 Рік тому

    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.

  • @건강덕후-e2v
    @건강덕후-e2v 7 років тому +1

    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?

  • @rayansoppi2380
    @rayansoppi2380 3 роки тому

    Thanks for sharing !!

  • @iranshad9081
    @iranshad9081 6 років тому

    Thank you bro, that was a beautiful videoclip...

  • @joseyovanygalindodiaz4767
    @joseyovanygalindodiaz4767 5 років тому +1

    Hi Friend, How you are sure that openFoam impress the force and the moment with this unit (N) and (Nm)?

  • @ahmetkirhan5896
    @ahmetkirhan5896 11 місяців тому

    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.

  • @foadsf
    @foadsf 6 років тому

    Great. thanks a lot. but why not using matplotlib right in python?!

  • @jadechantrell5496
    @jadechantrell5496 8 років тому

    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...

    • @OpenFOAMTutorials
      @OpenFOAMTutorials  8 років тому

      +Jade Chantrell You can simply run './script.sh'. If you get a permissions error, grant executable permissions by 'chmod +x script.sh'.

  • @tagorecoversbysetuhaque5038
    @tagorecoversbysetuhaque5038 9 років тому +2

    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

    • @OpenFOAMTutorials
      @OpenFOAMTutorials  9 років тому +1

      +setu haque run: ' chmod +x your_script ', then try to run the script again.

  • @pl2321
    @pl2321 8 років тому +1

    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
      @pl2321 8 років тому

      +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

    • @mohanadmaarouf8107
      @mohanadmaarouf8107 8 років тому

      Dear pl2321, which directory did you put the python file in for it to work? I seem to have the same problem as you.

    • @pl2321
      @pl2321 8 років тому

      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

    • @mohanadmaarouf8107
      @mohanadmaarouf8107 8 років тому

      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?

  • @dimts2701
    @dimts2701 7 років тому

    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 :)

  • @Arzed23
    @Arzed23 8 років тому +1

    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!

    • @amremad4801
      @amremad4801 8 років тому +1

      Arzed23 I also has this error but I cannot find available solution for it :(

    • @joaobomfim5688
      @joaobomfim5688 8 років тому +7

      +Arzed23 you must change "rhoName" to "rho" in file controlDict, in the folder system. Sorry my bad english =)

    • @eugenieb.8268
      @eugenieb.8268 6 років тому

      i try this but now , it says "keyword rhoInf is undefined in dictionary " please help me

  • @eugenieb.8268
    @eugenieb.8268 6 років тому

    hi i tried your method but i have this message
    rhoInf is undefined in the disctionnary. i don't know what to do

  • @albrechtalbrecht6118
    @albrechtalbrecht6118 7 років тому

    Does it work with python3? I habe troubles. For example:
    >>os.system("./gnuplot_script.sh")
    256

  • @EduardoFirvida
    @EduardoFirvida 5 років тому

    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