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)   

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