View Issue Details

IDProjectCategoryView StatusLast Update
0003378OpenFOAMBugpublic2019-11-11 08:49
ReporterHTauber Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version18.04
Product Versiondev 
Fixed in Versiondev 
Summary0003378: foamMonitor: Error message at live monitoring of probes
DescriptionThe live plot of probes produces an error message
- my input: $ foamMonitor postProcessing/probes/0/p


"postProcessing/probes/0/p" using 1:6 with lines title "data4"
^
"/tmp/tmp.Ua3yQn", line 12: invalid command

/opt/openfoam-dev/bin/foamMonitor: 211: kill: No such process
Steps To Reproducetutorials/incompressible/pimpleFoam/RAS/TJunction
TagsNo tags attached.

Activities

henry

2019-10-31 12:11

manager   ~0010857

Can you provide a patch which resolves this problem?

HTauber

2019-10-31 12:17

reporter   ~0010858

I'm sorry, but I have little experience with C++

henry

2019-10-31 13:09

manager   ~0010859

foamMonitor is a script, not C++, it is in the bin directory:

#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamMonitor
#
# Description
# Monitor data with Gnuplot from time-value(s) graphs written by OpenFOAM
# e.g. by functionObjects
# - requires gnuplot
#
#------------------------------------------------------------------------------
.
.
.

HTauber

2019-10-31 15:47

reporter   ~0010860

I'll take a look at it

HTauber

2019-11-04 14:53

reporter   ~0010861

The problem is caused by having more spaces between "#" and "Time" as you see in file postProcessing/probes/0/p

# Probe 0 (1e-06 0 0.01)
# Probe 1 (0.21 -0.20999 0.01)
# Probe 2 (0.21 0.20999 0.01)
# Probe 3 (0.21 0 0.01)
# Probe 0 1 2 3
# Time

The cut command in the foamMonitor script (row 181 and 182) causes this problem as described in the following link
https://stackoverflow.com/questions/816820/use-space-as-a-delimiter-with-cut-command

The following modification in the foamMonitor script would resolve this problem:
-181: xlabel=$(echo "$keys" | cut -d " " -f2)
+181: xlabel=$(echo "$keys" | tr -s " " | cut -d " " -f2)
-182: keys=$(echo "$keys" | cut -d " " -f3-)
+182: keys=$(echo "$keys" | tr -s " " | cut -d " " -f3-)

HTauber

2019-11-04 15:18

reporter   ~0010862

This is the correct postProcessing file:

# Probe 0 (1e-06 0 0.01)
# Probe 1 (0.21 -0.20999 0.01)
# Probe 2 (0.21 0.20999 0.01)
# Probe 3 (0.21 0 0.01)
# Probe 0 1 2 3
# Time
  ^^^^

HTauber

2019-11-04 15:27

reporter   ~0010863

When copying the spaces will be removed. Therefore the file is attached to see the right positions.
p (1,314 bytes)   
# Probe 0 (1e-06 0 0.01)
# Probe 1 (0.21 -0.20999 0.01)
# Probe 2 (0.21 0.20999 0.01)
# Probe 3 (0.21 0 0.01)
#       Probe             0             1             2             3
#        Time
            0             0             0             0             0
          0.1       11.7973       9.58197     0.0326543       8.24089
          0.2       12.5477       9.83546     0.0234738       9.74499
          0.3       12.7871       10.0145     0.0217672       10.8369
          0.4       12.5753       10.0147     0.0197989       12.3694
          0.5       12.4009       10.0152     0.0198759       14.1458
          0.6       12.4989       10.0124     0.0217179       15.9655
          0.7       12.7469       10.0129     0.0228538        17.653
          0.8       13.0004        10.014     0.0279833       19.3327
          0.9       13.3219       10.0146     0.0254675       21.0187
            1       13.6769       10.0159     0.0309527       22.7177
          1.1       12.1287       10.0133     0.0286169       23.3342
          1.2       11.5891        10.013     0.0271566       23.5288
          1.3       11.4032       10.0122     0.0271987       23.6253
          1.4       11.3372       10.0126     0.0270596       23.6431
          1.5       11.3138       10.0119     0.0272527       23.6699
p (1,314 bytes)   

will

2019-11-05 09:31

manager   ~0010866

The problem isn't foamMonitor, the problem is the output of probes. All other data output of this kind that I can find (residuals, forces, interfaceHeight) has the following format:

# Arbitrary number of lines of header
# ...
# ...
# ...
# x-name y0-name y1-name y2-name
  1 2 3 4
  5 6 7 8

Whether as probes has this:

# Arbitrary number of lines of header
# ...
# ...
# ...
# y-name y0-subName y1-subName y2-subName
# x-name
  1 2 3 4
  5 6 7 8

Probes predates everything else, so the difference is probably just historic.

FoamMonitor can't be expected to be compatible with a variety of inconsistent input formats. Probes needs fixing so it matches the formatting of the other functions.

henry

2019-11-05 15:23

manager   ~0010870

Try with this:

commit 19c03e4dd044ad47e2d03e45c4da74f889d556a3
Author: Henry Weller <http://openfoam.org>
Date: Tue Nov 5 15:19:03 2019 +0000

    sampling::probes: Improved the output table format to be more consistent with logFiles
    
    Columns are now fixed width, left justified and the column headings are on one
    line.
    
    Resolves bug-report https://bugs.openfoam.org/view.php?id=3378#c10866

HTauber

2019-11-11 08:41

reporter   ~0010877

Thanks, it works now.

henry

2019-11-11 08:49

manager   ~0010878

Resolved by commit 19c03e4dd044ad47e2d03e45c4da74f889d556a3

Issue History

Date Modified Username Field Change
2019-10-31 12:00 HTauber New Issue
2019-10-31 12:11 henry Note Added: 0010857
2019-10-31 12:17 HTauber Note Added: 0010858
2019-10-31 13:09 henry Note Added: 0010859
2019-10-31 15:47 HTauber Note Added: 0010860
2019-11-04 14:53 HTauber Note Added: 0010861
2019-11-04 15:18 HTauber Note Added: 0010862
2019-11-04 15:27 HTauber File Added: p
2019-11-04 15:27 HTauber Note Added: 0010863
2019-11-05 09:31 will Note Added: 0010866
2019-11-05 15:23 henry Note Added: 0010870
2019-11-11 08:41 HTauber Note Added: 0010877
2019-11-11 08:49 henry Assigned To => henry
2019-11-11 08:49 henry Status new => resolved
2019-11-11 08:49 henry Resolution open => fixed
2019-11-11 08:49 henry Fixed in Version => dev
2019-11-11 08:49 henry Note Added: 0010878