|
[Sponsors] |
December 22, 2017, 16:09 |
Index 512472272 out of range 0 ... 4
|
#1 |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Hello everyone,
I have changed the thermophysicalModels in openfoam 4.1 and added new equations of state and thermo psi model. There is no compilation error in the new library and the solver code, however when I want to run the case I get the following error: diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 PIMPLE: iteration 1 --> FOAM FATAL ERROR: index 512472272 out of range 0 ... 4 From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::fvPatchField<double>*; Foam::label = int] in file /home/salar/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/UListI.H at line 106. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OSspecific/POSIX/printStack.C:218 #1 Foam::error::abort() at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/error.C:249 #2 Foam::Ostream& Foam:perator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 3) #3 Foam::UList<Foam::fvPatchField<double>*>::checkInd ex(int) const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/UListI.H:110 #4 Foam::UList<Foam::fvPatchField<double>*>:perator[](int) const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/UListI.H:201 #5 Foam::UPtrList<Foam::fvPatchField<double> >:perator[](int) const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/UPtrListI.H:105 #6 Foam:siThermo::rho(int) const at ~/OpenFOAM/salar-4.1/NewTry/basic/psiThermo/psiThermo.C:101 #7 Foam::fluidThermo::nu(int) const at ~/OpenFOAM/salar-4.1/NewTry/basic/fluidThermo/fluidThermo.C:85 #8 Foam::TurbulenceModel<Foam::geometricOneField, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::compressibleTurbulenceModel, Foam::fluidThermo>::nu() const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/TurbulenceModels/compressible/../turbulenceModels/lnInclude/TurbulenceModel.H:164 #9 Foam::laminar<Foam::ThermalDiffusivity<Foam::Compr essibleTurbulenceModel<Foam::fluidThermo> > >::nuEff() const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/TurbulenceModels/compressible/../turbulenceModels/lnInclude/laminar.C:157 (discriminator 2) #10 Foam::linearViscousStress<Foam::ThermalDiffusivity <Foam::CompressibleTurbulenceModel<Foam::fluidTher mo> > >::divDevRhoReff(Foam::GeometricField<Foam::Vector <double>, Foam::fvPatchField, Foam::volMesh>&) const at ~/OpenFOAM/OpenFOAM-4.1/OpenFOAM-4.1/src/TurbulenceModels/compressible/../turbulenceModels/lnInclude/linearViscousStress.C:101 #11 ? at ~/OpenFOAM/salar-4.1/Solver/PIMPLESolver/UEqn.H:4 #12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #13 ? at ??:? Aborted (core dumped) I compiled the debug version of 4.1 and used gdb to find the source of this problem. I do not understand in which step patchi becomes 512472272 and why? Any guidance is appreciated. Thanks, Salar |
|
December 23, 2017, 14:51 |
|
#2 |
Senior Member
|
Hi,
Could you at least post line 101 of ~/OpenFOAM/salar-4.1/NewTry/basic/psiThermo/psiThermo.C? It would be great to see context also (i.e. post your loop code). |
|
December 23, 2017, 15:43 |
|
#3 | |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Quote:
Alexeym, I have not changed the psiThermo.C file. In this file code returns the density on the patchi but since the value of the patchi is out of range (0-4) It gives error and this function is needed for fluidthermo.C line 85 to return the viscosity (nu) on the patchi. I have not changed these files at all. line 101 of ~/OpenFOAM/salar-4.1/NewTry/basic/psiThermo/psiThermo.C 98 Foam::tmp<Foam::scalarField> Foam:siThermo::rho(const label patchi) 99 const 100 { 101 return p_.boundaryField()[patchi]*psi_.boundaryField()[patchi]; 102 } Regarding the solver it is the original rhoPimpleFoam with changed pathes in option file under Make folder to access new thermophysical models. Regards, Salar |
||
December 23, 2017, 17:03 |
|
#4 | |
Senior Member
|
OK.
Quote:
|
||
December 26, 2017, 21:36 |
|
#5 | |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Quote:
There are changes in numerous files. I have uploaded My thermo libraries below. Modifications are based on the real gas EOS that is implemented in OpenFoam 2.1 and foam-extend-4.0. I am trying to implement the libraries in OpenFoam 4.1. Any help and guidance in debugging the code is appreciated. This is the link that, the code for previous versions of OF is discussed: Real Gas EOS Regards, Salar |
||
December 27, 2017, 03:42 |
|
#6 |
Senior Member
|
OK.
You have posted code, yet it seems error happens, when you run certain case. Could you post the case also? |
|
December 27, 2017, 11:40 |
|
#7 | |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Quote:
Here is the solver which uses the new libraries and a test case. Yes, the solver and library codes compile without error, however index out of range error happens when running the test Case. There is something wrong in the libraries that I could not find it. Regards, Salar |
||
December 28, 2017, 14:17 |
|
#8 |
Senior Member
|
Hi,
I have taken a look and decided to stop after seeing several things: 1. Do not ignore compiler warnings. In case of messed up member initialisation it is not so important, while in heRealThermo.C:466 you have decided to return from forAll loop. 2. Why do you need to move around original OpenFOAM files? 3. Your test case is not runnable. First there is a problem with thermophysicalProperties (mess with curly brackets and as a result, transport sub dictionary is lost). Then Code:
--> FOAM FATAL ERROR: incompatible dimensions for operation [U[1 -2 -2 0 0 0 0] ] + [U[0 1 -2 0 0 0 0] ] I will try to clean-up things a little bit (get rid of duplicate files, clean up the code), when I have time. Quite often you make errors due to wrong placement of curly brackets, what editor do you use? |
|
December 28, 2017, 18:33 |
|
#9 | ||
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Hi Alexey,
Quote:
In OpenFoam2.1 this code has changed the way of getting Temp. from enthalpy and it provides the density in the newton iteration procedure as well (look at realThermoI.H:75) and all the parameters like Cp, S, e, ... originally was just function of T (in OF2.1), but this library reads these parameters as a function of both T and rho. Quote:
Thank you, I am just using the default Ubuntu's text editor. Do you have better suggestion ? |
|||
December 30, 2017, 06:44 |
|
#10 |
Senior Member
|
Hi,
With OpenFOAM 4.x I was able to reproduce the error, you have posted. And it happens during creation of nu field, though still need to figure out why. As a side-notes: - You have got problems with the library due to duplicate symbols. - The first number in the error message is quite random (I have already got 5 and -2109800512), so, I guess, the error is caused by non-initialised value. And could be linked to error during library loading. - Still do not get why you need original OpenFOAM files, which cause duplicate symbols error, in your library. "diff -r ..." shows, you have LOTS of files IDENTICAL to original OpenFOAM. "default Ubuntu's text editor" is something vague. You configure defaults, so under GNOME it can be gedit (which can highlight matching brackets), in console it can be nano (which can match open and closing bracket), or vi (which can match and insert closing brackets automatically), or mcedit. I would suggest a editor, you can use, and that do certain routine tasks for you automatically (like closing brackets). |
|
January 3, 2018, 15:25 |
|
#11 |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Hi,
Yes the numbers in Index error are quite random. I am new to programming with OF, can you please send me one of those duplicate symbols or how can I use "diff -r " to see the similarities? I am changing the definition of functions in this library. I am using vi or gedit when I am editing a file on the cluster where there is no graphical interface. Regards, Salar Last edited by salar; January 3, 2018 at 18:16. |
|
January 3, 2018, 21:31 |
|
#12 |
New Member
Salar
Join Date: Apr 2013
Location: USA
Posts: 9
Rep Power: 13 |
Hi,
How can I see those duplicate symbols and how I can define them in a different way? |
|
January 4, 2018, 07:31 |
|
#13 |
Senior Member
|
To see duplicate symbols errors, you just run your compiled solver. You will get something like:
Code:
$ realFluidPIMPLESolver #0 $FOAM_LIBBIN/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7fc9c3fa80ed] #1 $FOAM_USER_LIBBIN/libfluidThermophysicalModels20.so(_ZN4Foam12fvPatchFieldIdE26addpatchConstructorToTableINS_29fixedEnergyFvPatchScalarFieldEEC1ERKNS_4wordE+0xae) [0x7fc9c88896b8] ... Duplicate entry energyJumpAMI in runtime selection table fvPatchField #0 $FOAM_LIBBIN/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7fc9c3fa80ed] #1 $FOAM_USER_LIBBIN/libfluidThermophysicalModels20.so(_ZN4Foam12fvPatchFieldIdE31adddictionaryConstructorToTableINS_31energyJumpAMIFvPatchScalarFieldEEC2ERKNS_4wordE+0xae) [0x7fc9c8897eb2] #2 $FOAM_USER_LIBBIN/libfluidThermophysicalModels20.so(+0x98b52) [0x7fc9c8896b52] #3 $FOAM_USER_LIBBIN/libfluidThermophysicalModels20.so(+0x98b88) [0x7fc9c8896b88] #4 /lib64/ld-linux-x86-64.so.2(+0x10e23) [0x7fc9c8cfce23] #5 /lib64/ld-linux-x86-64.so.2(+0xf0a) [0x7fc9c8cecf0a] To use "diff -r ..." you just run "diff -r". "man diff" could be helpful. As I have written, vi and gedit are quite capable of highlighting matching bracket, so you can easily see your bracketing errors. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 07:15 |
AMI memory leak? | MichiB | OpenFOAM Programming & Development | 14 | August 1, 2015 18:18 |
[OpenFOAM] Paraview 3.98 - errors when saving geometry file | pajot | ParaView | 1 | September 28, 2013 10:45 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 01:27 |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 05:48 |