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/)
-   -   I just can't make this solver run (https://www.cfd-online.com/Forums/openfoam-solving/152279-i-just-cant-make-solver-run.html)

kickflipin April 28, 2015 01:11

I just can't make this solver run
 
I just can't make this solver run

I have received a code on the basis to develop further.

I am pretty much new to OpenFOAM environment.

the error saids segmentation failure, which seems it's accessing empty fields.

I am thinking that my setups for the initialization folder 0 could be wrong posed or the solver that I am trying to get it work is not the final version.

Please help. I just want to make this work to compare how it will be with further modification at the code.

Link to my case and the code
https://www.dropbox.com/s/b2anjuxc9i...er.tar.gz?dl=0

Solver Received
https://www.dropbox.com/sh/xp685ojin...rCyBqXWxa?dl=0

wyldckat April 30, 2015 13:06

A few quick questions:
  1. For which OpenFOAM version was the solver originally designed for?
  2. Based on which solver was the custom solver designed?
  3. In which OpenFOAM version are you trying to run this custom solver?

kickflipin April 30, 2015 19:11

For which OpenFOAM version was the solver originally designed for?
-> I don't have answer for this question. But it seems to be the problem..

Based on which solver was the custom solver designed?
-> It seems it's based on 'compressibleInterFoam' modified comparing interPhaseChangeFoam. the energy calculating sections from compressibleInterFoam and phase changes from interPhaseChangeFoam but, not working in same class of 'mixture' but seperate mixture classes.

In which OpenFOAM version are you trying to run this custom solver?
-> I have 2.3.1... I should try other versions...

wyldckat May 1, 2015 11:19

Quote:

Originally Posted by kickflipin (Post 544563)
For which OpenFOAM version was the solver originally designed for?
-> I don't have answer for this question. But it seems to be the problem..

It's possible to deduce the version from the header section in the "*.C" files, based on the date written there.
For example, this:
Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    |
    \\  /    A nd          | Copyright (C) 2011-2015 OpenFOAM Foundation
    \\/    M anipulation  |
-------------------------------------------------------------------------------

Implies that it's either OpenFOAM 2.3.x or OpenFOAM-dev, due to the date. Or at the very least, narrow down the possible versions.

---------------

edit: I've looked into your file "compressibleCavFoam.C" and it has this:
Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    |
    \\  /    A nd          | Copyright (C) 2011-2013 OpenFOAM Foundation
    \\/    M anipulation  |
-------------------------------------------------------------------------------

Therefore, it's either been coded with OpenFOAM 2.2.1, 2.2.2 or 2.2.x.

kickflipin May 5, 2015 05:11

Quote:

Originally Posted by wyldckat (Post 544647)
Therefore, it's either been coded with OpenFOAM 2.2.1, 2.2.2 or 2.2.x.

I tried 2.2.1, 2.2.2, 2.2.x following openfoamwiki.net's installation guide,
All three of them on Ubuntu 14.04

NONE of those versions could compile the solver.. i get errors saying as below..

Any help?? wrong compatibility with ubuntu 14.04?

Code:


+ wmake libso twoPhaseMixtureThermo
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file twoPhaseMixtureThermo.C
SOURCE=twoPhaseMixtureThermo.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/transportModels/compressible/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/thermophysicalModels/basic/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/transportModels/twoPhaseMixture/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64Gcc45DPOpt/twoPhaseMixtureThermo.o
twoPhaseMixtureThermo.C: In constructor ‘Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo(const Foam::fvMesh&)’:
twoPhaseMixtureThermo.C:52:27: error: ‘groupName’ is not a member of ‘Foam::IOobject’
        volScalarField T1(IOobject::groupName("T", phase1Name()), T_);
                          ^
twoPhaseMixtureThermo.C:57:27: error: ‘groupName’ is not a member of ‘Foam::IOobject’
        volScalarField T2(IOobject::groupName("T", phase2Name()), T_);
                          ^
make: *** [Make/linux64Gcc45DPOpt/twoPhaseMixtureThermo.o] error 1
+ wmake
Making dependency list for source file compressibleCavFoam.C
could not open file alphaControls.H for source file compressibleCavFoam.C
SOURCE=compressibleCavFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -ItwoPhaseMixtureThermo -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/transportModels/compressible/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/thermophysicalModels/basic/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/transportModels/twoPhaseMixture/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/transportModels/interfaceProperties/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/turbulenceModels/compressible/turbulenceModel -IphaseChangeTwoPhaseMixtures/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/home/eric/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64Gcc45DPOpt/compressibleCavFoam.o
In file included from compressibleCavFoam.C:99:0:
alphaEqnsSubCycle.H:2:31: fatal error: alphaControls.H: no such file or directory
    #include "alphaControls.H"
                              ^
compilation terminated.
make: *** [Make/linux64Gcc45DPOpt/compressibleCavFoam.o] error 1


alexeym May 5, 2015 06:07

Hi,

IObject::groupName method appeared in 2.3.x (at least I wasn't able to find the method in 2.2.x, 2.1.x, and 2.0.x repositories).

Also there is no src/finiteVolume/cfdTools/general/include/alphaControls.H file in 2.2.x and earlier. Again it is available in 2.3.x.

So I guess compressibleCavFoam.C was started in 2.2.x era, while the rest somehow was updated for 2.3.x branch.

kickflipin May 5, 2015 06:10

Thx... still far from the original purpose... I just can't get it work.... feel like it was a problem of wrong problem settings for the case, not the problem of the solution itself @_@

alexeym May 5, 2015 08:15

Well,

If you try to build the solver (did you?), fix certain errors in Make/options (like missing -I$(LIB_SRC)/meshTools/lnInclude in EXE_INC or redefinition of rhoPhiSum in alphaEqnsSubCycle.H (lines 12 and 15)), build the solver with debug symbols, execute it in the case folder, you will get similar output :

Code:

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
#0  Foam::error::printStack(Foam::Ostream&) at printStack.C:277
#1  Foam::sigSegv::sigHandler(int) at sigSegv.C:53
#2  _sigtramp in /usr/lib/system/libsystem_platform.dylib
#3  (unresolved) in /usr/lib/system/libsystem_platform.dylib
#4  Foam::Field<double>::Field(Foam::Field<double> const&) at Field.C:201
#5  Foam::DimensionedField<double, Foam::volMesh>::DimensionedField(Foam::word const&, Foam::DimensionedField<double, Foam::volMesh> const&) at DimensionedField.C:207
#6  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::word const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at GeometricField.C:519
#7  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::word const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at GeometricField.C:535
#8  Foam::compressible::laminar::muEff() const at laminar.H:103
#9  Foam::compressible::laminar::divDevRhoReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at laminar.C:223
#10  main at UEqn.H:6
#11  start in /usr/lib/system/libdyld.dylib

Now it you look inside laminar.H ($FOAM_SRC/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H), you will find that line 103 is:

Code:

return tmp<volScalarField>(new volScalarField("muEff", mu()))
where mu() is a method of compressible::turbulenceModel, which is just a call to mu method of thermophysicalModel_:

Code:

        const volScalarField& mu() const
        {
            return thermophysicalModel_.mu();
        }

in your case thermophysicalModel_ is mixture

Code:

    autoPtr<compressible::turbulenceModel> turbulence
    (
        compressible::turbulenceModel::New(rho, U, rhoPhi, mixture)
    );

and finally mixture is

Code:

    autoPtr<phaseChangeTwoPhaseMixture> mixture =
        phaseChangeTwoPhaseMixture::New(U, phi);

At this point I have decided to stop. You have got two variants of phaseChangeTwoPhaseMixture, which one is used... well, this is what you need to find out.


All times are GMT -4. The time now is 03:43.