|
[Sponsors] |
August 5, 2019, 09:58 |
foamMonitor after writeNow
|
#1 |
Member
|
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 |
|
August 5, 2019, 10:49 |
|
#2 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Hello,
the functionObject will create a new folder and gives it a name of the start time in Code:
postProcessing/residuals/<startTimeFolder>/residuals.dat 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 Last edited by anon_q; August 5, 2019 at 12:15. |
|
August 5, 2019, 12:04 |
|
#3 |
Member
|
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 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 |
|
August 5, 2019, 12:11 |
|
#4 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
sorry
there was a typo in the last line, it should be corrected to: Code:
foamMonitor -l $postPath/0/residuals.dat
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 |
|
August 6, 2019, 04:33 |
|
#5 | |
Senior Member
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8 |
Quote:
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 |
||
Tags |
foammonitor, writenow |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DieselFoam does not restart from latestTime | lord_kossity | OpenFOAM Bugs | 8 | February 21, 2009 14:54 |