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

How to monitor a simulation with cli-only access practically

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By anttiad9000
  • 1 Post By LVDH

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2016, 05:07
Default How to monitor a simulation with cli-only access practically
  #1
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Dear all,

Currently I am trying to set up an OpenFOAM environment on Amazon EC2. As with many other computing servers, I am accessing it via cli only. So how do you monitor your simulation (e.g. Residuals) on line?

I hope I could make the problem clear, if not feel free to ask.

Best regards, and thanks in advance,

Kate
KateEisenhower is offline   Reply With Quote

Old   October 14, 2016, 05:48
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Kate,

I am not sure but can you access via ssh in a terminal? Then it should be possible to plot the residuals on your computer with common tools like gnuplot, the new foam function (residuals) or pyFoamPlotWatcher.py. I did this on my own cluster a while ago.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 14, 2016, 07:39
Default
  #3
New Member
 
Antti Heino
Join Date: Mar 2014
Location: Finland
Posts: 9
Rep Power: 12
anttiad9000 is on a distinguished road
Hello Kate,

If I understood correctly you do not have access to graphical utilies so you cannot use the GUI for gnuplot. Here is another way you can do it.

The most important thing is that you are logging the simulation to a file with >, e.g. :

Code:
icoFoam > log.icoFoam
Then a very straight forward and kind of manual way to do this without using pyFoam is to use 'grep' and combination of grep and cut to get the essential numbers and save them again to a new file, e.g. (this is for foam-extend):

Code:
grep "p, Initial residual" log.icoFoam | cut -d ' ' -f 9 | sed 's/,//g' > p_residuals
sed is used to remove the comma after the value, -f 9 means the 9th field from left which will be printed, you can also replace cut with: awk '{print $8}'. It uses a bit different delimiters and for that reason the number in this case is 8. Just change the values to get out what you want. To get residuals for different variable just change the grep argument. Finally if you want, you can just combine all your files to a single file with paste, e.g.:

Code:
paste p_residuals Ux_residuals Uy_residuals Uz_residuals > residuals
now you can copy the residuals-file to your local computer and use a spreadsheet tool of your choice to plot the residuals. To make it work faster you can create a bash script to do it all. This might sound a bit complex way to do it but this way you have all the raw data for the residuals. I hope this helps.

-Antti
Tobi likes this.

Last edited by anttiad9000; October 14, 2016 at 07:49. Reason: adding code tags
anttiad9000 is offline   Reply With Quote

Old   October 18, 2016, 05:47
Default
  #4
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi Kate,

I am not sure but can you access via ssh in a terminal? Then it should be possible to plot the residuals on your computer with common tools like gnuplot, the new foam function (residuals) or pyFoamPlotWatcher.py. I did this on my own cluster a while ago.
Hi Tobi,

Thanks for your answer. Yes, I have access using ssh in a terminal window. I think my question was a bit missleading. I am not even sure if my OS has any GUI. Nethertheless I tried your approach again and got:

Code:
QXcbConnection: Could not connect to display
Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   October 18, 2016, 05:57
Default
  #5
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Dear antti,

Thank you. I was trying to emphasize the with cli-only access part of my question. So your last paragraph was the most useful for me. To write a custom bash script, was also my first idea. I only thought I was missing something.
Again thanks for your answer.

Best regards,

Kate

Quote:
Originally Posted by anttiad9000 View Post
Hello Kate,

If I understood correctly you do not have access to graphical utilies so you cannot use the GUI for gnuplot. Here is another way you can do it.

The most important thing is that you are logging the simulation to a file with >, e.g. :

Code:
icoFoam > log.icoFoam
Then a very straight forward and kind of manual way to do this without using pyFoam is to use 'grep' and combination of grep and cut to get the essential numbers and save them again to a new file, e.g. (this is for foam-extend):

Code:
grep "p, Initial residual" log.icoFoam | cut -d ' ' -f 9 | sed 's/,//g' > p_residuals
sed is used to remove the comma after the value, -f 9 means the 9th field from left which will be printed, you can also replace cut with: awk '{print $8}'. It uses a bit different delimiters and for that reason the number in this case is 8. Just change the values to get out what you want. To get residuals for different variable just change the grep argument. Finally if you want, you can just combine all your files to a single file with paste, e.g.:

Code:
paste p_residuals Ux_residuals Uy_residuals Uz_residuals > residuals
now you can copy the residuals-file to your local computer and use a spreadsheet tool of your choice to plot the residuals. To make it work faster you can create a bash script to do it all. This might sound a bit complex way to do it but this way you have all the raw data for the residuals. I hope this helps.

-Antti
KateEisenhower is offline   Reply With Quote

Old   October 24, 2016, 04:14
Default
  #6
Member
 
LVDH's Avatar
 
Andre Z
Join Date: Dec 2009
Posts: 75
Rep Power: 16
LVDH is on a distinguished road
http://stackoverflow.com/questions/1...-plotting-tool
KateEisenhower likes this.
__________________
www.MantiumCAE.com
LVDH is offline   Reply With Quote

Reply


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
Is there a way to access the gradient limiter in Fluent ? CFDYourself FLUENT 1 February 16, 2016 05:49
FSI TWO-WAY SIMULATION Smagmon CFX 1 March 6, 2009 13:24
Overflow problem in steady simulation ReeKo CFX 11 October 8, 2008 17:57
How to access the mesh quality before simulation? Cheng CFX 2 November 17, 2006 23:56
3-D Contaminant Dispersal Simulation Apple L S Chan Main CFD Forum 1 December 23, 1998 10:06


All times are GMT -4. The time now is 04:27.