CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Segmentation Fault 11 Running simpleFoam with new turbulence model (https://www.cfd-online.com/Forums/openfoam-solving/154997-segmentation-fault-11-running-simplefoam-new-turbulence-model.html)

Jack001 June 23, 2015 13:14

gammaReThetatSST Turbulence Model Segmentation Fault 11 (simpleFoam)
 
Hello,

I am attempting to run a new turbulence model that can be found here https://github.com/langfeldt/gammaReThetatSST

and a test case directory for this setup should be found on the in one of the authors posts in this thread: http://www.cfd-online.com/Forums/ope...l-flows-3.html

Scroll down and find the link to: T3A.tar.gz

Once I have compiled the library in my OpenFoam-2.3.x directory, I move to the case folder and run
Code:

blockMesh
and
Code:

simpleFoam
I get the following output from the terminal:

Code:

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

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model gammaReThetatSST
#0  Foam::error::printStack(Foam::Ostream&)An admin user name and password is required to enter Developer Mode.
Admin user name (ow222): ow222
Password:
 in "libOpenFOAM.dylib"
#1  0x0 in "/Users/ow222/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64GccDPOpt/bin/simpleFoam"
Segmentation fault: 11

I have no idea where to even start with this error. I am also confused why OF prompted me for a password and entered developer mode...

I am running OF on my Mac 10.10

alexeym June 24, 2015 03:01

Hi,

Unfortunately I was not able to reproduce the error.

1. Since I do not know state of your sources gammaReThetatSST, I have forked (https://github.com/mrklein/gammaReThetatSST) original repo and pushed changes so model can be built on OS X without error. Maybe these changes will be accepted in original repo later.

2. In T3A example case name of the library is misspelled in contolDict, so it is not loaded upon simulation start. Hence the error about unknown model.

3. Except omega and gamma oscillations case runs OK:

Code:

...
Time = 618

smoothSolver:  Solving for Ux, Initial residual = 3.79197e-05, Final residual = 2.84441e-06, No Iterations 4
smoothSolver:  Solving for Uy, Initial residual = 0.000158096, Final residual = 1.35206e-05, No Iterations 2
DICPCG:  Solving for p, Initial residual = 0.0011912, Final residual = 1.15046e-05, No Iterations 66
time step continuity errors : sum local = 1.06433e-06, global = -3.52455e-08, cumulative = 3.87611e-06
smoothSolver:  Solving for omega, Initial residual = 2.56117e-08, Final residual = 1.07464e-10, No Iterations 2
bounding omega, min: -1147.25 max: 4.34125e+07 average: 624133
smoothSolver:  Solving for k, Initial residual = 0.00016988, Final residual = 1.58541e-05, No Iterations 2
smoothSolver:  Solving for ReThetatTilda, Initial residual = 7.34867e-05, Final residual = 7.00917e-06, No Iterations 2
smoothSolver:  Solving for gamma, Initial residual = 6.8332e-05, Final residual = 1.48126e-06, No Iterations 2
bounding gamma, min: -0.0221621 max: 1.02595 average: 0.728239
ExecutionTime = 42.58 s  ClockTime = 43 s
...

4. Concerning Developer Mode: https://discussions.apple.com/thread...art=0&tstart=0. It is necessary for generation of stack backtrace.

Jack001 June 24, 2015 09:27

Thanks for your efforts @ alexeym. Could the fact that I get the error be due my changing the source file gammaReThetatSST.C in terms of changing class assignments to class constructors? Should I experiment with changing the source file and then remaking the library? Also in terms of compilers, Im sure I have g++ compiler on my system. Is there a way to use this compiler instead of clang which might circumvent the error?

I updated my source to the one you have uploaded on github, and when I compile the library I still get 23 warnings. Since I'm not confident understanding exactly what is going on under the surface, I am tempted to think that perhaps the reason I later get a segmentation fault is that the compiler does not like the way the source is written?

alexeym June 24, 2015 14:29

Well, if you execute g++ --version command, you get

Code:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

So it is basically clang++ with another set of include files.

Post your warnings, since when I build the library I only get single warning about unused corrID_ variable.


All times are GMT -4. The time now is 05:11.