|
[Sponsors] |
October 25, 2012, 14:49 |
Programming in OpenFoam.. help!
|
#1 |
New Member
Adriana Vargas
Join Date: Jul 2011
Posts: 8
Rep Power: 15 |
Good morning!
I have some problems programming in OpenFoam.. I'm trying to modify a program to resolve PBE (population balances equations), but I have a problem with createfields.H file in this part: //- Calculating the Sauter diameter scalar twoDivThree = 2.0/3.0; volScalarField num(eta[0]); volScalarField den(pow(absc[0],twoDivThree)*weight[0]); dimensionedScalar small("small", den.dimensions(), SMALL); volScalarField ds("ds",CC * num/(den + small)); volScalarField alpha("alpha", Vo*num); volScalarField beta("beta",scalar(1)-alpha); surfaceScalarField phi = fvc::interpolate(alpha)*phia + fvc::interpolate(beta) *phib; The program compiles well but when I try to simulate a specific case appear this error: Reading abscissas Reading field ABSC1 Reading field ABSC2 Reading field ABSC3 Reading field ABSC4 Constructing matrix for DQMOM #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 in "/lib/x86_64-linux-gnu/libc.so.6" #4 std::string::append(std::string const&) in "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" #5 std::basic_string<char, std::char_traits<char>, std::allocator<char> > std:perator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /usr/include/c++/4.6/bits/basic_string.h:2311 #6 Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam:perator*<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::tmp<Foam::GeometricField< double, Foam::fvsPatchField, Foam::surfaceMesh> > const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricScalarField.C:113 #7 at ~/Documents/OpenFoam/24_10_2012/pbeDev/fields/fields2/createFields.H:227 #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 in "/home/adriana/OpenFOAM/adriana-2.1.1/platforms/linux64GccDPOpt/bin/fields2" Segmentation fault (core dumped) I did different tests and I have found that the error is when I try to define surfacialScalarField phi. If I delete this part of the code, the case runs without problem, but I can't do it because I need to define this variable to continue with the algorithm.. some suggestions?? thanks Adriana |
|
October 26, 2012, 15:23 |
|
#2 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi Adriana,
A Segmentation fault or a "sigSegv" error is issued when one tries to access invalid memory. Most likely trying to access a non existing element in a field. To try to figure out what is wrong you can make output of the fields that may have caused the error to see what is wrong with them (e.g.) Code:
Info << "Alpha Field: " << alpha << endl; Best regards, Hisham |
|
October 29, 2012, 12:49 |
|
#3 |
New Member
Adriana Vargas
Join Date: Jul 2011
Posts: 8
Rep Power: 15 |
Thanks Hisham, I have checked output of the phia field and appears this error:
phia Field: dimensions [1.67997141555e-316 6.91767529931e-310 6.91767529931e-310 6.91767529931e-310 6.95321237182e-310 4.94065645841e-324 0]; internalField nonuniform 0(); boundaryField { #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::OSstream::write(Foam::word const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #4 Foam:perator<<(Foam::Ostream&, Foam::word const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #5 Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField::writeE ntry(Foam::word const&, Foam::Ostream&) const at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:461 #6 Foam::Ostream& Foam:perator<< <double, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::Ostream&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:1237 #7 at ~/Documents/OpenFoam/24_10_2012/pbeDev/fields/fields2/createFields.H:228 #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 I defined phia and phib as is defined in twoPhaseEulerFoam: surfaceScalarField& phia = phasea->phi(); Any idea about that?? I'm confused! |
|
October 29, 2012, 12:59 |
|
#4 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi
It seems that this field is (among) the one(s) causing trouble. It is clear that it is not filled with any values or dimensions and hence the error occurs. I guess you have to post more of your code to get better ideas! Best regards, Hisham |
|
October 29, 2012, 13:18 |
|
#5 |
New Member
Adriana Vargas
Join Date: Jul 2011
Posts: 8
Rep Power: 15 |
Thanks! I'm attaching the file createfields.h, I'm sure that here is the problem..
Regards, |
|
October 29, 2012, 13:54 |
|
#6 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Maybe you should try to register the phi surfaceField as in the original solver:
Code:
00109 surfaceScalarField phi 00110 ( 00111 IOobject 00112 ( 00113 "phi", 00114 runTime.timeName(), 00115 mesh 00116 ), 00117 fvc::interpolate(alpha)*phia + fvc::interpolate(beta)*phib 00118 ); 00119 Hisham |
|
October 29, 2012, 14:44 |
|
#7 |
New Member
Adriana Vargas
Join Date: Jul 2011
Posts: 8
Rep Power: 15 |
I tried to do it but doesn't work..
|
|
October 29, 2012, 15:38 |
|
#8 |
New Member
Adriana Vargas
Join Date: Jul 2011
Posts: 8
Rep Power: 15 |
Hi Hisham!
you are right! I found the error, it was in "Phase Model" file.. It was by difference between version 1.6 and 2.1. I put the updated file and works perflecty!! thanks very much!!, P.S I found the error using Info << "Phia Field: " << phia << endl; |
|
Tags |
programming, surfacescalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 1.6.x, 1.7.0 and 1.7.x are not fully prepared to work with gcc-4.5.x | wyldckat | OpenFOAM Bugs | 18 | October 21, 2010 06:51 |
OpenFoam programming | prapanj | OpenFOAM | 10 | March 18, 2010 08:23 |
Programming in OpenFOAM | vinu | OpenFOAM | 2 | July 11, 2009 11:16 |
Modified OpenFOAM Forum Structure and New Mailing-List | pete | Site News & Announcements | 0 | June 29, 2009 06:56 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |