|
[Sponsors] |
[OpenFOAM.org] Need basic help with compiling OF 5.x for debugging |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 9, 2018, 16:14 |
Need basic help with compiling OF 5.x for debugging
|
#1 |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Hi,
I am trying to get to the core of this error caused at the beginning of sonicFoam Code:
[3] [3] [3] --> FOAM FATAL ERROR: [3] Negative initial temperature T0: -315.342 [3] [3] From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>] [3] in file /home/ubuntu/OpenFOAM/OpenFOAM-5.x/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54. [3] FOAM parallel run aborting [3] [3] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [3] #1 Foam::error::abort() at ??:? [3] #2 Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::TEs(double, double, double) const at ??:? [3] #3 Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:? [3] #4 Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:? [3] #5 ? at ??:? [3] #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" [3] #7 ? at ??:? When I change the bashrc option to Debug for fulldebugging and lookup the path to any solver as this chalmers pdf suggests (http://www.tfd.chalmers.se/~hani/kur.../debugging.pdf) by which sonicFoam, it doesn't show me anything and goes to new line (no blank line output either). This suggests probably debug mode isn't activated but if I check with echo $WM_COMPILATION_OPTION it does show me Debug. So what is going on? Can anyone please help? |
|
March 10, 2018, 09:39 |
|
#2 |
Member
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15 |
As its name says, $WM_COMPILATION_OPTION is a flag for compilation. Changing it to Debug is not enough. You need to compile the whole OF to create the Debug version binaries.
You don't have to make a new compilation though. There is another option: Overriding debug switches. Take a look at the ..../OF-5.x/etc/controlDict file. There you will find a block DebugSwitches which can be overridden in your case system/controlDict. Nilsson explains it very nicely. I find this method very handy as well. The option "3 Top-Level debugging" in the link you gave simply says:
|
|
March 10, 2018, 11:20 |
|
#3 | |||||
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Thanks for quick reply. Yes, I have been through that but didn't quiet understand that. If I may trouble you a bit more, I've added specifically what I'm not following below, could you please elaborate a little more?
Quote:
Quote:
1. How is that related to the following instructions? 2. When you say, it can be overridden...how? Can you please show me an example? Quote:
2. Copy these folders to where?? I have my installation in /opt/openfoam5 folder. Does it mean I should copy those to my current working directory? Quote:
1. Change the source name to what !? Absolutely no idea what this statement means. 2. What is Make/files ? A location? I can't find it anywhere in my openfoam installation directory. Quote:
I'm sorry, my questions might seem very basic but I'd really appreciate help. |
||||||
March 12, 2018, 15:16 |
|
#4 |
Member
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15 |
Hi there!
1- You should change the compiler option, and probably the project name as well to (OF-5x_debug for instance) then yes you will run ./Allwmake which is going to create new binaries into a new location according to the names you provide in etc/bashrc 2- Yes, I agree that list is very long but you can find the interesting ones for your need. I don't any know source that explains each of them, so you might have to go through the code to extract them. 3- You can copy them anywhere using any name you want. Natural way of doing that is to create, e.g a work directory located in your user directory in OpenFOAM folder. For instance; if you're using version 5.x then OpenFOAM/username-5.x/work/sonicFoam_debug can contain the modified sonicFoam. You can read Nilsson's documents that explain implementation of a new solver and new BC to understand how that works, especially Make/files and Make/options. By the way, this is what you do if you do NOT compile the debug version of OpenFOAM. If you compile a whole new debug version then for sure you don't need to compile a particular solver. 4- By defining a debugSwitch block in your case/system/controlDict you can override default switches. So it will look like: Code:
debugSwitches { someDebugSwitch debugLevel; } 5- You are right, just compiling the solver might not be enough. Then of course it becomes pointless and might require too much effort. That's why I would either use debug switching or using a debugger like gdb. Good luck! // Fatih |
|
March 26, 2018, 11:04 |
|
#5 |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Thanks. This helped. Am still not where I want to be but getting there.
Just needed some hints. Have a nice day. |
|
April 15, 2018, 19:10 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick question @Deep: Have you solved your problem here? If not, please let us know. Preferably, please let us also know how to reproduce the error message you are getting, so that it's easier to figure out which debug mode/level is needed.
In the meantime, you can also try running: Code:
export FOAM_ABORT=1
__________________
|
|
April 16, 2018, 07:04 |
|
#7 | ||
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Quote:
Quote:
However, I suspect it had to do with keeping the porous inlet patch defined as "patch" rather than "wall" (which I have just figured out and that's exactly how it should have been and I didn't know how to effect it). If I encounter similar negative temperature error, I'll definitely come back to this thread and update. Thanks for looking this up for me! |
|||
Tags |
debug, debug mode, debugging, openfoam 5.x, sonicfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Error when compiling OF 5.x in RedHat 6.5 | agustinvo | OpenFOAM Installation | 2 | May 31, 2018 09:47 |
[OpenFOAM.org] Error compiling OF 5.x | marluc | OpenFOAM Installation | 4 | November 2, 2017 10:39 |
Is there a relation between version of fluent and visual basic in compiling? | 4asino | Fluent UDF and Scheme Programming | 1 | October 31, 2015 07:03 |
Basic question regarding compiling a UDF | A.Jalal | Fluent UDF and Scheme Programming | 2 | August 6, 2015 14:57 |
Help with KIVA4 source code compiling | geothokar | Main CFD Forum | 0 | September 3, 2010 06:40 |