CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] pyFoamPotentialRunner error (https://www.cfd-online.com/Forums/openfoam-community-contributions/120213-pyfoampotentialrunner-error.html)

Tensian July 2, 2013 13:39

pyFoamPotentialRunner error
 
Hi Foamers,

I am trying to initialize my solution with potentialFoam to use it as input to simpleFoam. For that purpose, I use pyFoamPotentialRunner.py. I get this error:


Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
Using dynamicCode for functionObject difference at line 47 in "/home/cfd2/OpenFOAM/Isma-2.1.0/Pruebaconvelocidadpyfoampotentialrunner/system/controlDict::functions::difference"
Creating new library in "dynamicCode/error/platforms/linux64GccDPOpt/lib/liberror_e92448da6ae10bc777e0869670f72a48fd0673f1. so"
Invoking "wmake -s libso /home/cfd2/OpenFOAM/Isma-2.1.0/Pruebaconvelocidadpyfoampotentialrunner/dynamicCode/error"
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file functionObjectTemplate.C
Making dependency list for source file FilterFunctionObjectTemplate.C
'/home/cfd2/OpenFOAM/Isma-2.1.0/Pruebaconvelocidadpyfoampotentialrunner/dynamicCode/error/../platforms/linux64GccDPOpt/lib/liberror_e92448da6ae10bc777e0869670f72a48fd0673f1. so' is up to date.
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.000398875, No Iterations 1001
DICPCG: Solving for p, Initial residual = 0.330204, Final residual = 9.96235e-07, No Iterations 889
DICPCG: Solving for p, Initial residual = 0.0439428, Final residual = 9.91653e-07, No Iterations 859
DICPCG: Solving for p, Initial residual = 0.01177, Final residual = 9.80963e-07, No Iterations 764
DICPCG: Solving for p, Initial residual = 0.00360687, Final residual = 9.96712e-07, No Iterations 552
DICPCG: Solving for p, Initial residual = 0.00127418, Final residual = 9.77746e-07, No Iterations 470
DICPCG: Solving for p, Initial residual = 0.000491449, Final residual = 9.96479e-07, No Iterations 569
DICPCG: Solving for p, Initial residual = 0.000205181, Final residual = 9.37787e-07, No Iterations 50
DICPCG: Solving for p, Initial residual = 9.0933e-05, Final residual = 9.92036e-07, No Iterations 18
DICPCG: Solving for p, Initial residual = 4.31694e-05, Final residual = 9.47567e-07, No Iterations 8
DICPCG: Solving for p, Initial residual = 2.18469e-05, Final residual = 9.85357e-07, No Iterations 8
continuity error = 0.00402446
Interpolated U error = 1.21676e-09
Looking up field U

Reading inlet velocity uInfX

#0 Foam::error::printStack(Foam::Ostream&) in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::errorFunctionObject::write() at system/controlDict::functions::difference:62
#4 Foam::OutputFilterFunctionObject<Foam::errorFuncti onObject>::end() at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/OutputFilterFunctionObject.C:191
#5 Foam::functionObjectList::end() in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6
in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/potentialFoam"
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8
in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/potentialFoam"
Segmentation fault (core dumped)
PyFoam WARNING on line 213 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PotentialRunner.py : Trigger called: Resetting fvSchemes and fvSolution
Killing PID 3288
PyFoam WARNING on line 247 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 3288 was already dead
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/3288/status'

Anyone knows what's happening? How can I correct it?
And in the case that pyFoamPotentialRunner doesn give an error, should I run simpleFoam later or pyFoam just do it automatically? I have never seen a simulation like this, so I have no idea in how to proceed.

All kind of help (ideas, tutorials, links...) will be really much apreciated. The beginnings are always hard...

gschaider July 2, 2013 15:05

Quote:

Originally Posted by Tensian (Post 437373)
Hi Foamers,

I am trying to initialize my solution with potentialFoam to use it as input to simpleFoam. For that purpose, I use pyFoamPotentialRunner.py. I get this error:


Reading inlet velocity uInfX

#0 Foam::error::printStack(Foam::Ostream&) in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::errorFunctionObject::write() at system/controlDict::functions::difference:62
#4 Foam::OutputFilterFunctionObject<Foam::errorFuncti onObject>::end() at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/OutputFilterFunctionObject.C:191
#5 Foam::functionObjectList::end() in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6
in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/potentialFoam"
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8
in "/home/cfd2/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/potentialFoam"
Segmentation fault (core dumped)
PyFoam WARNING on line 213 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PotentialRunner.py : Trigger called: Resetting fvSchemes and fvSolution
Killing PID 3288
PyFoam WARNING on line 247 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 3288 was already dead
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/3288/status'

Anyone knows what's happening? How can I correct it?

The problem is with one of the function-objects in your controlDict. Somehow it doesn't work inside of potentialFoam. So the best thing would be to disable the functionObjects as long as you run potentialFoam (for instance by renaming the functions-entry in the controlDict) and afterwards reinstate it

Quote:

Originally Posted by Tensian (Post 437373)
And in the case that pyFoamPotentialRunner doesn give an error, should I run simpleFoam later or pyFoam just do it automatically? I have never seen a simulation like this, so I have no idea in how to proceed.

pyFoamPotentialRunner.py only runs potentialFoam. The actual solver has to be run separately (pyFoam has no way of telling which is the "real" solver).

Quote:

Originally Posted by Tensian (Post 437373)
All kind of help (ideas, tutorials, links...) will be really much apreciated. The beginnings are always hard...

For a tutorial on PyFoam see the first part of the training presentation at this years workshop (it is linked from the PyFoam-page on the Wiki). Mind: there is no example on pyFoamPotentialRunner.py in that

Tensian July 3, 2013 10:31

Hi Bernhard,

First of all, thanks for your fast reply. I am not sure if I am understanding. I post my controlDIct file:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom startTime;
startTime 0;
stopAt endTime;
endTime 1000;
deltaT 1;
writeControl timeStep;
writeInterval 5;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;

// ************************************************** *********************** //

I can't see any function-entry in the file. Do you refer at the controlDict of my case or in the generic source code of controlDict?What's the path to this file?
And other question, how can I tell OF to take the potentialFoam solution as initial solution for simpleFoam?

Thanks in advance for suggestions!

gschaider July 3, 2013 12:33

Quote:

Originally Posted by Tensian (Post 437587)
Hi Bernhard,

First of all, thanks for your fast reply. I am not sure if I am understanding. I post my controlDIct file:

I can't see any function-entry in the file. Do you refer at the controlDict of my case or in the generic source code of controlDict?What's the path to this file?
And other question, how can I tell OF to take the potentialFoam solution as initial solution for simpleFoam?

Thanks in advance for suggestions!

After I wrote the posting I checked it (because I got an idea for a feature to add). The problem is that the utility uses stuff from the potentialFoam-tutorial as a "template" and temporarily copies it into the case. Since 2.0 that tutorial has a functionObject and THAT functionObject is causing the problem.

Strange as it may seem: do exactly the opposite of what I said before. Add an empty list of functionObjects to the controlDict. Something like
Code:

functions
{
}

That should replace the tutorial FOs

gschaider July 3, 2013 12:35

Quote:

Originally Posted by Tensian (Post 437587)
And other question, how can I tell OF to take the potentialFoam solution as initial solution for simpleFoam?

simpleFoam is extremely simple-minded (like all OF-solvers). Whatever U it finds in the 0-directory it uses as the initial condition. So if 0/U was generated by potentialFoam it uses that. You don'T have to tell it anything

Tensian July 3, 2013 12:58

Thanks Bernhard, now it Works!
But I think this is not a good initial solution for my simpleFoam simulation. Do you know why pressure driven flows explodes when specifying a fixedValue both on inlet and outlet?

Anyway thank you so much, I have learned how to use pyFoamPotentialRunner, so this is great!

Congratulations for your knowledge and thanks for share it!


All times are GMT -4. The time now is 14:10.