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

foamMonitor after writeNow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2019, 08:58
Default foamMonitor after writeNow
  #1
Member
 
Philipp Conen
Join Date: Apr 2019
Location: GER, NRW
Posts: 35
Blog Entries: 2
Rep Power: 7
pconen is on a distinguished road
Greetings to All!

I have a question and hope this is not asked until now.
foamMonitor works perfectly. But when I write the case für the next time step with "writeNow", the simulation ends. When I start the simulation from this point a new folder with the latest saved time steps will be created. When I want to run foamMonitor again I have to change the path to the new folder. But then I could not see all residuals. Only the ones from the latest time step are shown.
Can I use a trick to plot all? Maybe something ling -overwrite?
__________________
Greetings

Philipp Conen
pconen is offline   Reply With Quote

Old   August 5, 2019, 09:49
Default
  #2
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
Hello,
the functionObject will create a new folder and gives it a name of the start time in
Code:
postProcessing/residuals/<startTimeFolder>/residuals.dat
I don't think there is a way to force it to append to the 0 folder of postProcessing/residuals/0 (If I am mistaken, I am curious to know how to do that). But you can try this trick using bash commands:

Code:
startTimeFolder=<type the name of the folder e.g: 0.5, don't make spaces between = and the name>

postPath=postProcessing/residuals

cp $postPath/0/residuals.dat $postPath/0/residuals_bak.dat

cat $postPath/$startTimeFolder/residuals.dat >> $postPath/0/residuals.dat

sort $postPath/0/residuals | uniq > $postPath/0/residuals.dat

foamMonitor -l $postPath/0/residuals.dat
Edit: the last line changed to foamMonitor -l $postPath/0/residuals.dat

Last edited by anon_q; August 5, 2019 at 11:15.
anon_q is offline   Reply With Quote

Old   August 5, 2019, 11:04
Default
  #3
Member
 
Philipp Conen
Join Date: Apr 2019
Location: GER, NRW
Posts: 35
Blog Entries: 2
Rep Power: 7
pconen is on a distinguished road
Dear Linda,

thank you really much for your fast reply!

I think I understand what these codes are going to do. But I am completly new in OpenFOAM and the hole IT environment. Also I am claculating on a cluster so I am not quite sure how to use ur code. As I know I am working with the bash. So I tryed this:
Code:
#!/bin/bash
#PBS -o Channel_PBS_out02.dat
#PBS -j oe
#PBS -q scc-queue3
#PBS -N OpenFoam
#PBS -l nodes=1:ppn=40,walltime=240:00:00
#ulimit -l
cat $PBS_NODEFILE

module unuse /srv/software/modules:/srv/software/modules/all:/srv/software/modules/base:/srv/software/modules/cae:/srv/software/modules/chem:/srv/software/modules/compiler:/srv/software/modules/data:/srv/software/modules/devel:/srv/software/modules/lang:/srv/software/modules/lib:/srv/software/modules/math:/srv/software/modules/mpi:/srv/software/modules/numlib:/srv/software/modules/phys:/srv/software/modules/system:/srv/software/modules/toolchain:/srv/software/modules/tools:/srv/software/modules/vis

module use /srv/software/SCC02/modules/all


module add OpenFOAM/6-foss-2017b
export CORES=96

set -o allexport
source /srv/software/SCC02/software/OpenFOAM/6-foss-2017b/OpenFOAM-6/etc/bashrc WM_COMPILER_TYPE=system WM_COMPILER=Gcc WM_MPLIB=MPI FOAMY_HEX_MESH=yes
set +o allexport

cd /home/ms/p/pc196535/OpenFOAM/Offen/DCLMischer

export LD_PRELOAD=/srv/software/SCC02/software/GCCcore/6.4.0/lib64/libstdc++.so.6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/srv/software/SCC02/software/GCCcore/6.4.0/lib64/libstdc++.so.6

echo $LD_PRELOAD $WM_PROJECT $WM_PROJECT_DIR $WM_PROJECT_VERSION $FOAM_INST_DIR $WM_COMPILER $WM_MPLIB $FOAM_BASH $FOAM_CSH $WM_LABEL_SIZE
which gcc

startTimeFolder=0.72

postPath=postProcessing/residuals

cp $postPath/0/residuals.dat $postPath/0/residuals_bak.dat

cat $postPath/$startTimeFolder/residuals.dat >> $postPath/0/residuals.dat

sort $postPath/0/residuals | uniq > $postPath/0/residuals.dat

foamMonitor -l $postPath/0/residuals


#-x LD_PRELOAD
But it does not work.
I tryed to use the Terminal too, but now I dont have my 0 Data anymore.

I would be very thankfull if you can give me some hints on this. Sorry for my missing knowledge.
__________________
Greetings

Philipp Conen
pconen is offline   Reply With Quote

Old   August 5, 2019, 11:11
Default
  #4
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
sorry
there was a typo in the last line, it should be corrected to:
Code:
foamMonitor -l $postPath/0/residuals.dat
and make sure before executing those bash commands that the following folders exist:
  • postProcessing/residuals/0
  • postProcessing/residuals/<your starttime folder>

I guess you can easily understand what the commands above really do: backup the residuals.dat in postProcessing/residuals/0/ folder and try to append to it the residuals.dat from postProcessing/residuals/<startTimeFolder>/residuals.dat and remove the duplicate lines, then you can use that file with foamMonitor
anon_q is offline   Reply With Quote

Old   August 6, 2019, 03:33
Default
  #5
Senior Member
 
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 7
Krao is on a distinguished road
Quote:
Originally Posted by pconen View Post
Greetings to All!

I have a question and hope this is not asked until now.
foamMonitor works perfectly. But when I write the case für the next time step with "writeNow", the simulation ends. When I start the simulation from this point a new folder with the latest saved time steps will be created. When I want to run foamMonitor again I have to change the path to the new folder. But then I could not see all residuals. Only the ones from the latest time step are shown.
Can I use a trick to plot all? Maybe something ling -overwrite?
Hi Philipp Conen

You can use pyFoamPlotWatcher.py to monitor the residuals. Just write a logfile, and whenever you start the simulation from latest time step, update this log file.

Example:

'simpleFoam >> log.logSimple' this writes the log file, which can be visualized by using 'pyFoamPlotWatcher.py log.logSimple', during the runtime

After you execute the write now and later start with the new time step, again write files using simpleFoam >> log.logSimple, this starts to update the log file, which you can visualise using pyFoamPlotWatcher.py log.logSimple again. Be careful when writing the log file. '>' overwrites the existing logfile and '>>' this updates the existing logfile, therefore use '>>'. I hope you are trying to monitor logs during runtime.

Krao
Krao is offline   Reply With Quote

Reply

Tags
foammonitor, writenow


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
DieselFoam does not restart from latestTime lord_kossity OpenFOAM Bugs 8 February 21, 2009 13:54


All times are GMT -4. The time now is 10:12.