CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [Other] CFDSupport's port for Windows: gnuplot 'command not found' (https://www.cfd-online.com/Forums/openfoam-installation/167737-cfdsupports-port-windows-gnuplot-command-not-found.html)

Paul Fionn March 7, 2016 15:53

CFDSupport's port for Windows: gnuplot 'command not found'
 
Hi Guys

Apologies in advance if this question stems from my own ignorance. I am using the Windows application of OpenFOAM from CFD support. For several terminal commands (Cygwin) I receive the following 'command not found' if I attempt to implement the following commands:

mpirun
gnuplot
nano

mpiexec works fine however. I thought initially that Cygwin was not able to access gnuplot as it wasn't installed in the Cygwin directory, after reinstalling however, there was no difference. Following the guide at the link to install gnuplot on Cygwin, I found that it wasn't included in the list of install options.
http://www2.warwick.ac.uk/fac/sci/mo.../cygwin/part5/

After searching for hours online and trying various things myself I've hit a wall, has anybody else encountered a similar problem? My gut feeling tells me that its Windows related possibly.

Paul Fionn March 15, 2016 07:01

If anybody else has encountered similar problems with gnuplot, I get around by using the windows install of gnuplot, changing the directory to where OpenFOAM leaves its outputs, and plotting directly from there from within gnuplot, not the cygwin terminal.

I haven't managed to get nano to work, however it's not something essential as you can view/edit files using notepad++ or sublime text

mqsim March 21, 2016 06:43

Hi Paul,

I have the same problem and so I use the gnuplot application. Have you tried to plot residuals? I can't plot residuals, it seems that some gnuplot commands are not known... I can plot Cd and Cl but not my residuals.

For mpirun you can check one allrun file from the tutorials (like the motorbike).

Paul Fionn March 21, 2016 11:09

Hi mqsim

Yep residuals plot fine for me, could you post your error and method for plotting?

Regards
Paul

mqsim March 22, 2016 04:17

Hi,

I am trying to use a script given in a topic to plot residuals. The script is the following:

set title "Convergence process"
set xlabel "Iterations"
set ylabel "Residuals"
set logscale y;
plot "< cat log.all | grep 'Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' w lines,\
"< cat log.all | grep Uy | cut -d' ' -f9 | tr -d ','" title 'Uy' w lines,\
"< cat log.all | grep Uz | cut -d' ' -f9 | tr -d ','" title 'Uz' w lines,\
"< cat log.all | grep ' p,' | cut -d' ' -f9 | tr -d ','" title 'p' w lines,\
"< cat log.all | grep ' k,' | cut -d' ' -f9 | tr -d ','" title 'k' w lines,\
"< cat log.all | grep ' omega,' | cut -d' ' -f9 | tr -d ','" title 'omega' w lines
pause mouse
reread

The error message I have is:
Skipping data file with no valid points
x range is invalid

I have tried to use foamLog too but without any success which is weird because it is similar to Cd and Cl plots.

mqsim March 22, 2016 07:46

I've found how to plot residuals. It was a problem with gnuplot installation. If someone is interested in the solution I can make a post to explain how to fix this issue.

Paul Fionn March 22, 2016 09:10

Hi mqsim

The above method which you tried does not work for me either due to the gnuplot problem.
My workaround is to manually open gnuplot, run <foamLog log> and simply plot the resulting residuals from the gnuplot terminal.
<set logscale y>
<plot './p_0' with lines> ..etc
after every 40 iterations or so, I run <foamLog log> again and update the graph to check its progress

If you could post your solution to the gnuplot installation it would be greatly appreciated by myself and many others

Cheers
Paul

mqsim March 22, 2016 09:50

No worries, hopefully it would be useful for lots of users.

Step 1: Uninstall gnuplot
Step 2: Download gnuplot from this link https://sourceforge.net/projects/gnu...e=typ_redirect
Step 3: Install gnuplot ticking the box 'Add application directory to your PATH environment variable'

After you have done that, run OpenFoam case as usual and open a new OpenFoam terminal. Go to your case directory and run the following command if your file script is called Residuals: gnuplot Residuals -

Let me know if you have successfully plotted your residuals.

mqsim

Carno September 16, 2016 01:16

Quote:

Originally Posted by Paul Fionn (Post 588534)
Hi Guys

Apologies in advance if this question stems from my own ignorance. I am using the Windows application of OpenFOAM from CFD support. For several terminal commands (Cygwin) I receive the following 'command not found' if I attempt to implement the following commands:

mpirun
gnuplot
nano

mpiexec works fine however. I thought initially that Cygwin was not able to access gnuplot as it wasn't installed in the Cygwin directory, after reinstalling however, there was no difference. Following the guide at the link to install gnuplot on Cygwin, I found that it wasn't included in the list of install options.
http://www2.warwick.ac.uk/fac/sci/mo.../cygwin/part5/

After searching for hours online and trying various things myself I've hit a wall, has anybody else encountered a similar problem? My gut feeling tells me that its Windows related possibly.

Did you get the 'mpirun' command running? I am also riding the same boat. :rolleyes:

Paul Fionn September 16, 2016 03:23

Hi Carno,
It was explained to be a few months ago as to why mpirun does not operate on a windows build but I can't remember the exact details. Essentially, mpiexec works for this windows build and mpirun works with any version of OpenFOAM compiled on linux.
All the best
Paul

VIJAYA KUMAR September 30, 2016 05:04

Quote:

Originally Posted by mqsim (Post 591065)
I've found how to plot residuals. It was a problem with gnuplot installation. If someone is interested in the solution I can make a post to explain how to fix this issue.

Hi can u give a step by step procedure
I am stuck

Paul Fionn September 30, 2016 05:44

Quote:

Originally Posted by mqsim (Post 591099)
No worries, hopefully it would be useful for lots of users.

Step 1: Uninstall gnuplot
Step 2: Download gnuplot from this link https://sourceforge.net/projects/gnu...e=typ_redirect
Step 3: Install gnuplot ticking the box 'Add application directory to your PATH environment variable'

After you have done that, run OpenFoam case as usual and open a new OpenFoam terminal. Go to your case directory and run the following command if your file script is called Residuals: gnuplot Residuals -

Let me know if you have successfully plotted your residuals.

mqsim

You will find that mqsim has already kindly provided a step by step solution to this problem

VIJAYA KUMAR September 30, 2016 05:49

Quote:

Originally Posted by Paul Fionn (Post 619851)
You will find that mqsim has already kindly provided a step by step solution to this problem

I am not getting step 3
I am not from Computer Science background. Please help

Paul Fionn September 30, 2016 05:58

Hi Vijaya,

This step is not as complicated as it might first appear. As you install gnuplot, various installation windows will pop up as per the norm of any software installation on windows. You select the install parameters that you want, some softwares let you customise the install procedures more than others. For most however, you simply click 'Next' and 'Finish' untill the software installs. If you read each popup window carefully before clicking next, you will find a check box for'Add application directory to your Path environment variable'. You simply tick this box and continue with the installation.

I hope this solves your problem
All the best
Paul

VIJAYA KUMAR September 30, 2016 06:15

Running gnuplot in cygwin for Openfoam for Windows
 
1 Attachment(s)
Quote:

Originally Posted by Paul Fionn (Post 619856)
Hi Vijaya,

This step is not as complicated as it might first appear. As you install gnuplot, various installation windows will pop up as per the norm of any software installation on windows. You select the install parameters that you want, some softwares let you customise the install procedures more than others. For most however, you simply click 'Next' and 'Finish' untill the software installs. If you read each popup window carefully before clicking next, you will find a check box for'Add application directory to your Path environment variable'. You simply tick this box and continue with the installation.

I hope this solves your problem
All the best
Paul



Thanks a lot. Life saviour...
I found that option after scrolling down.

For future users.
Running gnuplot in cygwin for Openfoam for Windows

Steps
1) Uninstall gnuplot.
2) Install from https://sourceforge.net/projects/gnu...e=typ_redirect
3) Click Next Next until you appear at few check boxes, you will find 'Add application directory to your Path environment variable' after scrolling little down.
4) Complete your installation.

To use gnuplot
Step1: Create a script file called 'Residuals' (i'll attach it here).

Step2: Commands:
buoyantBossinesqSimpleFoam > log &
gnuplot Residuals -


Commands Explanation:
Running my simulation and appending it to a log file and then plotting residuals

lynncheng January 15, 2017 22:20

Hi Vijaya, I am just a new Openfoamer. I followed your instructions on plotting the residuals. However, I met an error saying
$ gnuplot Residuals -
"Residuals", line 0: Cannot open script file 'Residuals'
what is the possible problem for this?

Hope anybody could give me some suggestion.
thanks


A_Payne723 September 10, 2017 22:34

Has anyone figured out lynncheng's most recent question? I am having the same issue after following the instructions above as well. Was just trying to get residuals on an airfoil, but also tried and failed with plotting for the motorBike tutorial as well.

kamilb December 13, 2017 10:26

1 Attachment(s)
I had similar problem.

In my case other format of text file resolved the problem.

daniyalaltaf May 15, 2021 08:11

Quote:

Originally Posted by lynncheng (Post 633395)
Hi Vijaya, I am just a new Openfoamer. I followed your instructions on plotting the residuals. However, I met an error saying
$ gnuplot Residuals -
"Residuals", line 0: Cannot open script file 'Residuals'
what is the possible problem for this?

Hope anybody could give me some suggestion.
thanks


Just rename the "Residual.txt" file to "Residuals" only i.e. without any extension. In case you want to edit the file later, simply use Notepad++.


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