CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   chtMultiRegionFoam Tutorial (http://www.cfd-online.com/Forums/openfoam/76923-chtmultiregionfoam-tutorial.html)

m.nichols19 June 8, 2010 13:21

chtMultiRegionFoam Tutorial
 
While attempting the multiRegionHeater chtMultiRegionFoam tutorial I encountered an error that I cannot resolve.

After running the Allrun file, the log.changeDictionary.bottomAir file displays the following:
Quote:

Create time

Create mesh bottomAir for time = 0



Cannot find file "points" in directory "constant/bottomAir/polyMesh"

From function Time::findInstance(const fileName&, const word&, const IOobject::readOption)
in file db/Time/findInstance.C at line 148.

FOAM exiting
Any help would be greatly appreciated.

m.nichols19 June 8, 2010 18:23

I solved the error by replacing line 18 of the Allrun script:

Quote:

changeDictionary -region $i >& log.changeDictionary.$i
should be replaced with

Quote:

changeDictionary -region $i > log.changeDictionary.$i 2>&1
I hope that helps if you encounter the same problem.

Now I have a new dilemma. The various volume fields will not show up in ParaView. Suggestions?

wyldckat June 8, 2010 19:14

Greetings Matt,

Quick solution: on the first line of the Allrun script, change "/bin/sh" to "/bin/bash".

Long explanation - The problem you are facing is quite simple: all of the tutorial scripts use "/bin/sh", but in each Linux distro, sh is linked to bash, dash, ash, ksh or any other shell. But unfortunately, the Linux distro where the tutorials were prepared, sh points to bash, thus the scripts respect mostly the bash syntax, while other systems that use another shell can't handle that same syntax; e.g.: Ubuntu that has dash as default sh.

If you want to change all tutorial scripts to use bash instead of sh, you can run this code in a terminal with OpenFOAM environment activated:
Quote:

Originally Posted by http://code.google.com/p/openfoam-ubuntu/
Code:

cd $FOAM_TUTORIALS
find $FOAM_TUTORIALS/ -name "All*" | \
while read file
do
    mv "$file" "$file.old"
    sed '/^#!/ s/\/bin\/sh/\/bin\/bash/' "$file.old" > "$file"
    rm -f "$file.old"
done
echo "Fix up bash done"


Best regards,
Bruno

m.nichols19 June 9, 2010 12:10

Thank you for your reply, Bruno

I am still having the same problem. The solver - chtMultiRegionHeater - runs, but when I try to view the volume fields in ParaView they disappear after the initial time.

m.nichols19 June 9, 2010 15:54

I figured it out. Hooray.

ronaldo June 10, 2010 06:07

use foamTovtk to view the result

Cyp June 11, 2010 05:35

I have the same problem that m.nichols19. I use OpenFOAM 1.6 and I don't have the foamTovtk application. Is it normal ?

wyldckat June 11, 2010 18:18

Greetings Cyp,
Quote:

Originally Posted by Cyp (Post 262584)
I have the same problem that m.nichols19. I use OpenFOAM 1.6 and I don't have the foamTovtk application. Is it normal ?

The correct name is foamToVTK. Linux is case sensitive by default, so if you miss just one character's case, it's an invalid command ;)

As for not seeing the fields:
  1. can you see the fields in the cavity tutorial? You know, the first one from the user guide?
  2. how are you running the chtMultiRegionFoam case tutorial? Are you using the Allrun inside the case folder script? Does it create 5 files with the named regions and do they end with ".OpenFOAM"?
If the answer is no for the first point, then follow the instructions from this post: ParaView Stopped Working post #4

Best regards,
Bruno

Cyp June 12, 2010 05:55

Hi wyldckat, thank you for your answer.

Indeed, I have the foamToVTK application. When I run it,

Code:

cyp@cyp-laptop:~/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater$ foamToVTK
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-f802ff2d6c5a
Exec  : foamToVTK
Date  : Jun 12 2010
Time  : 10:43:46
Host  : cyp-laptop
PID    : 1766
Case  : /home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Deleting old VTK files in "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK"

Time: 0
    volScalarFields            : K rho p cp k T epsilon
    volVectorFields            : U

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_0.vtk"
    Original cells:3000 points:3751  Additional cells:0  additional points:0

    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_0.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_0.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_0.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_0.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_0.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_0.vtk"
Time: 0.001

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_1.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_1.vtk"
Time: 50.001

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_2176.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_2176.vtk"
Time: 100.001

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_4417.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_4417.vtk"
Time: 150.001

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_6591.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_6591.vtk"
Time: 200.001

    Internal  : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/multiRegionHeater_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxY/maxY_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minX/minX_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxX/maxX_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minY/minY_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/minZ/minZ_8719.vtk"
    Patch    : "/home/cyp/OpenFOAM/cyp-1.6/run/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/VTK/maxZ/maxZ_8719.vtk"
End

That seems ok. However, then, when I attempt to see my field with paraFoam, as previously, nothing more happens...

paraFoam successfully runs the cavity tutorial case and I have the 5 files you mentioned above:
Code:

multiRegionHeater{bottomAir}.OpenFOAM
multiRegionHeater{heater}.OpenFOAM
multiRegionHeater{leftSolid}.OpenFOAM
multiRegionHeater{rightSolid}.OpenFOAM
multiRegionHeater{topAir}.OpenFOAM

I also noticed that my paraFoam shut down with the following message :

Code:

QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::begin: Paint device returned engine == 0, type: 2


Cannot find file "points" in directory "constant/bottomAir/polyMesh"

    From function Time::findInstance(const fileName&, const word&, const IOobject::readOption)
    in file db/Time/findInstance.C at line 148.

FOAM exiting

Regards,
Cyp

PS : I execute the Allrun script

marval September 9, 2010 10:31

Vtk
 
Hi, everyone!

I don't find the VTK folder in chtMultiRegionSimpleFoam but I do find it in chtMultiRegionFoam. Can I copy this one to the other one? Or is there a huge difference between the two?

Regards
Marco

m.nichols19 September 9, 2010 12:14

I will need a few more details before I can answer your question, marval. Does running foamToVTK not create the VTK directory in your chtMultiRegionSimpleFoam case directory? Did you run the same case using both chtMultiRegionFoam and chtMultiRegionSimpleFoam?

marval September 9, 2010 12:21

Hmmm, I really don't know how this works but when I use the Allrun script the VTK folder appears.
It doesn't look that I need to use foamToVTK to view my results, do the Allrun script do it? Because I don't see anything in the script though.

I hope I'm not too confusing.

Regards
Marco

m.nichols19 September 9, 2010 12:56

The VTK directory created by the Allrun script is irrelevant. You will need to run
Code:

foamToVTK -region
for each region.


All times are GMT -4. The time now is 08:59.