CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   I cannot apply Openfoam file's (http://www.cfd-online.com/Forums/openfoam-installation/117656-i-cannot-apply-openfoam-files.html)

Mirage12 May 13, 2013 05:01

I cannot apply Openfoam file's
 
1 Attachment(s)
Hello World :)

I try to run my first simulation using the tutorial cavity and unfortunately i can see only the mesh and i cannot apply the file cavity in paraview.

After writing the command paraFoam i became an Error( 7 lines ) at the end of terminal :

QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action

I use Ubuntu 12.04, paraview 3.14.1 64-bit and Openfoam 2.2.0

How can i solve the problem?

Thanks .

Mirage12 May 14, 2013 06:46

1 Attachment(s)
Hi everyone,

i have the same problem and i cannot apply the openfoam file's in paraview, i installed paraview from the openfoam website http://www.openfoam.org/download/ubuntu.php and i added an alias command to my "~/.bashrc" file the code
alias paraFoam='paraFoam -builtin' but i couldn't solve the problem...

I use Ubuntu 12.04, paraview 3.14.1 64-bit and Openfoam 2.2.0

Thanks for your help!

wyldckat May 14, 2013 15:56

Greetings Amin and welcome to the forum!

I moved the second post from the thread http://www.cfd-online.com/Forums/ope...r-message.html, because this first one you created on this current thread has got some additional information that comes in handy.

OK, according to your description, you have 2 ParaView versions installed:
  • The one that Ubuntu provides, which is ParaView 3.14.
  • The one that OpenFOAM provides, which is ParaView 3.12.
Given your current set-up, I advise you to choose one to keep and remove the other one:
  • If you want to keep Ubuntu's ParaView version, run:
    Code:

    sudo apt-get remove paraviewopenfoam3120
  • But if you want to keep OpenFOAM's ParaView version, run:
    Code:

    sudo apt-get remove paraview
I say this because they might be getting into conflict between them, where one is using the other one's libraries.

Best regards,
Bruno

Mirage12 May 15, 2013 06:59

Thanks a lot !
i removed paraview and i tried to installed from the website of Openfoam, but i couldn't. that is why i dowloaded it from the paraview website..and iT is working !:)
Thanks a lot ! Thanks a lot ! Thanks a lot ! Thanks a lot ! Thanks a lot ! Thanks a lot ! :p

Mirage12 May 15, 2013 08:03

2 Attachment(s)
i can launch paraview by typing "paraFoam" in your terminal,but i cannot see the mesh or the file to apply:confused::confused::confused: why :confused:

i tried to execute the tutorial cavity... after building the Mesh with blockMesh and typing icoFoam... the file cavity.foam was not created.
will the file cavity.foam be created after typing paraFoam or after typing icoFoam and blockMesh ?
Thanks

wyldckat May 15, 2013 19:10

Hi Amin,

Quoting from the official instructions for the Ubuntu deb packages - http://www.openfoam.org/download/ubuntu.php - the steps are:
Code:

cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
blockMesh
icoFoam
paraFoam

It's paraFoam that creates the "cavity.foam" file. If you want to keep the file for later using it again, you can run:
Code:

paraFoam -touch
For more information:
Code:

paraFoam -help
Best regards,
Bruno

Mirage12 May 16, 2013 05:50

hello Bruno :)

when i type paraFoam, paraview is opened but i cannot see the file cavity.foam
in paraview.

I think, in my case....the paraFoam command can only open paraView, without creating the file .Foam

the two commands are not working. The output of paraview for paraFoam -help is

Cannot open data file " -help "

I followed also the same instructions to run Openfoam and paraview, but it seams to, that i have a problem on the liaison between paraview and openfoem. maybe..i have to change something in the parafoam file in the Folder bin of openfoam.... :confused:
here is my parafoam file in Openfoam.

Code:

#!/bin/sh
#------------------------------------------------------------------------------
# =========                |
# \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
#  \\    /  O peration    |
#  \\  /    A nd          | Copyright (C) 2011-2012 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
#    paraFoam
#
# Description
#    start paraview with the OpenFOAM libraries
#
# Note
#    combining -block or -builtin options with the -region option yields
#    undefined behaviour
#------------------------------------------------------------------------------
usage() {
    exec 1>&2
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

Usage: ${0##*/} [OPTION] [PARAVIEW_OPTION]
options:
  -block            use blockMesh reader  (uses .blockMesh extension)
  -builtin          use VTK builtin OpenFOAM reader  (uses .foam extension)
  -case <dir>      specify alternative case directory, default is the cwd
  -region <name>    specify alternative mesh region
  -touch            only create the file  (eg, .blockMesh, .OpenFOAM, etc)
  -touchAll        create .blockMesh, .OpenFOAM files (and for all regions)
  -help            print the usage


paraview options start with a double dashes

* start paraview $ParaView_VERSION with the OpenFOAM libraries

USAGE
    exit 1
}

# We want to do nice exit when running paraview to give paraview opportunity
# to clean up
unset FOAM_ABORT

unset regionName optTouch

# Hack: change all locale to 'C' i.e. using '.' for decimal point. This is
# only needed temporarily until paraview is locale aware. (git version is
# already 2010-07)
export LC_ALL=C

# reader extension
extension=OpenFOAM

requirePV=1

# parse options
while [ "$#" -gt 0 ]
do
    case "$1" in
    -h | -help)
        usage
        ;;
    -block | -blockMesh)
        extension=blockMesh
        shift
        ;;
    -builtin)
        extension=foam
        requirePV=0
        shift
        ;;
    -case)
        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
        cd "$2" 2>/dev/null || usage "directory does not exist:  '$2'"
        shift 2
        ;;
    -region)
        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
        regionName=$2
        shift 2
        ;;
    -touch)
        optTouch=true
        requirePV=0
        shift
        ;;
    -touchAll)
        optTouch=all
        requirePV=0
        shift
        ;;
    --)
        shift
        break    # stop here, treat balance as paraview options
        ;;
    --*)
        break    # stop here, treat this and balance as paraview options
        ;;
    *)
        usage "unknown option/argument: '$*'"
        ;;
    esac
done


#
# check that reader module has been built
#
if [ $requirePV -eq 1 -a ! -f $PV_PLUGIN_PATH/libPV3FoamReader_SM.so ]
then
    cat<< BUILDREADER

FATAL ERROR: ParaView reader module libraries do not exist

Please build the reader module before continuing:
cd \$FOAM_UTILITIES/postProcessing/graphics/PV3Readers
./Allwclean
./Allwmake

BUILDREADER
    exit 1
fi

#
# check for --data=... argument
#
hasDataArg()
{
    hasData=false
    while [ "$#" -gt 0 ]
    do
        case "$1" in
        (--data=*)
            hasData=true
            break
            ;;
        esac
        shift
    done
}

hasDataArg $@


# get a sensible caseName from the directory name
caseName=${PWD##*/}
caseFile="$caseName.$extension"
fvControls="system"

if [ -n "$regionName" ]
then
    if [ ! -d constant/$regionName ]
    then
        echo "FATAL ERROR: Region $regionName does not exist"
        exit 1
    else
        caseFile="$caseName{$regionName}.$extension"
        fvControls="$fvControls/$regionName"
    fi
fi

case "${optTouch:-false}" in
all)
    extension=OpenFOAM
    if [ -f constant/polyMesh/blockMeshDict ]
    then
        touch "$caseName.blockMesh"
        echo "created '$caseName.blockMesh'"
    fi
    touch "$caseName.$extension"
    echo "created '$caseName.$extension'"
    # discover probable regions
    for region in constant/*
    do
        if [ -d $region -a -d $region/polyMesh ]
        then
            regionName=${region##*/}
            touch "$caseName{$regionName}.$extension"
            echo "created '$caseName{$regionName}.$extension'"
        fi
    done
    exit 0
    ;;
true)
    touch "$caseFile"
    echo "created '$caseFile'"
    exit 0
    ;;
esac


# parent directory for normal or parallel results
case "$caseName" in
    processor*) parentDir=".." ;;
    *)          parentDir="."  ;;
esac


if [ "${hasData:-false}" = true ]
then

    # has --data=.., send directly to paraview
    exec paraview "$@"

else

    # check existence of essential files
    warn="WARN file does not exist:"
    case $extension in
    blockMesh)
        for check in \
            system/controlDict \
            constant/polyMesh/blockMeshDict \
            ;
        do
            [ -s "$parentDir/$check" ] || {
                [ -n "$warn" ] && echo "$warn" 1>&2
                echo "    $parentDir/$check" 1>&2
                unset warn
            }
        done
        ;;

    builtin | OpenFOAM)
        for check in \
            system/controlDict \
            $fvControls/fvSchemes \
            $fvControls/fvSolution \
            ;
        do
            [ -s "$parentDir/$check" ] || {
                [ -n "$warn" ] && echo "$warn" 1>&2
                echo "    $parentDir/$check" 1>&2
                unset warn
            }
        done
        ;;
    esac

    # only create/remove caseFile if it didn't already exist
    [ -e $caseFile ] || {
        trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
        touch "$caseFile"
        echo "created temporary '$caseFile'"
    }

    # For now filter out any ld.so errors. Caused by non-system compiler?
    paraview --data="$caseFile" "$@" 2>&1 | fgrep -v 'Inconsistency detected by ld.so'
fi


#------------------------------------------------------------------------------

the file of paraview is saved in home ..maybe i have to move it in the file system...:confused:
the file name of paraview in home is not "Paraview" but "ParaView-3.12.0-Linux-x86_64", maybe i have to change the name of the file...:confused:


:confused::confused::confused:

wyldckat May 16, 2013 17:02

Hi Amin,

From your description, it looks like you also have a ParaView version that you got from www.paraview.org.
Please tell me what does the following command show you:
Code:

alias paraFoam
If it says something like:
Code:

alias paraFoam='~/Desktop/ParaView-3.12.0-Linux-x86_64/bin/paraview'
then edit the file "~/.bashrc" and change the respective line to:
Code:

alias paraFoam='paraFoam -builtin'
Start a new terminal and try again to run paraFoam inside the cavity folder.


If it still doesn't work, edit the file "~/.bashrc" once again and go to the line that has the alias for paraFoam, and change it to this:
Code:

alias paraFoam='touch case.foam; ~/Desktop/ParaView-3.12.0-Linux-x86_64/bin/paraview --data=case.foam'
Keep in mind to adapt the path to the "ParaView-3.12.0-Linux-x86_64" folder accordingly to what you have got.

Best regards,
Bruno

PS: sorry I edited your post, but it was only to move the code you had placed with paraFoam's script, into the "[CODE]" markers.

Mirage12 May 17, 2013 00:54

:)Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !Thanks ! Thanks !:)


All times are GMT -4. The time now is 20:17.