CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem with dieselFoam and themophysical properties (http://www.cfd-online.com/Forums/openfoam-solving/93950-problem-dieselfoam-themophysical-properties.html)

mturcios777 October 31, 2011 17:32

Problem with dieselFoam and themophysical properties
 
I just did a pull from the repository and can no longer run anything in dieselFoam. Even the tutorial crashes with the following:

Code:

--> FOAM FATAL ERROR:
Tcommon 1000 for C7H16 != 1391 for others

    From function janafThermo<EquationOfState>::operator-=(const janafThermo<EquationOfState>& jt) const
    in file /home/turcios/OpenFOAM/OpenFOAM-2.0.x/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 260.

Looks like something has changed in the underlying structure. Anyone have a fix for this or seen it before

wyldckat October 31, 2011 18:03

Hi Marco,

Yeah, I know, Henry Weller has been tweaking the code to respect physics a bit better: http://www.openfoam.com/mantisbt/view.php?id=327 - the tutorials still need fixing as mentioned on comment #777: http://www.openfoam.com/mantisbt/view.php?id=327#c777

I think that you can go back to a safer place by running:
Code:

git checkout 2b11286dad626d4f6a35379eeda0f29b0ee5ac23
At least until it's safe to pull the latest one. ;)

You can check what they've been doing before doing a "git pull" by seeing here first: https://github.com/OpenFOAM/OpenFOAM-2.0.x/commits/

Best regards,
Bruno

JBUNSW April 23, 2012 07:25

Hi everyone,

I have the same problem with my newly installed OF 2.0.x. :(

Code:

--> FOAM FATAL ERROR:
Tcommon 1000 for C7H16 != 1391 for others

    From function janafThermo<EquationOfState>::operator-=(const janafThermo<EquationOfState>& jt) const
    in file /home/turcios/OpenFOAM/OpenFOAM-2.0.x/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 260.

I installed it using the instructions given here:

http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html

I tried the restore command Bruno has offered, but that avenue failed too! :confused:

Quote:

Originally Posted by wyldckat (Post 330220)
I think that you can go back to a safer place by running:
Code:

git checkout 2b11286dad626d4f6a35379eeda0f29b0ee5ac23
At least until it's safe to pull the latest one. ;)

I have developed a chemistry model under OpenFOAM 2.0.x using DieselFOAM solver, and by modifying corresponding ODEChemistryModel's library classes. In new version, they have replaced this solver with SprayFOAM, which its interaction with aforementioned classes is unclear to me. So I prefer to continue my development with 2.0.x version, and when I figured out what SprayFOAM's secret(!) is, I will migrate to OF 2.1.0.

I truly appreciate it, if anyone can help me to resolve this error?!

Thanks in advance,
Jalal

wyldckat April 23, 2012 07:43

Greetings Jalal,

Quote:

Originally Posted by JBUNSW (Post 356372)
I tried the restore command Bruno has offered, but that avenue failed too! :confused:

Was there any error message when you did the "git checkout" command?
Did you do any changes to the code in the OpenFOAM-2.0.x folder, before running that command?

If so, run the following commands:
Code:

git stash
git checkout 2b11286dad626d4f6a35379eeda0f29b0ee5ac23
git stash pop

And build OpenFOAM again:
Code:

./Allwmake
Best regards,
Bruno

JBUNSW April 23, 2012 21:36

Hi Bruno,

Thanks for your immediate follow up. As for your following question:
Quote:

Originally Posted by wyldckat (Post 356376)
Was there any error message when you did the "git checkout" command?

I did it couple of days ago, and don't remember the details, but I'm sure that I was facing the same fatal error of janafThermo when I tried to run the code again.

As for changes to the code in the OF-2.0.x folder:
Quote:

Originally Posted by wyldckat (Post 356376)
Did you do any changes to the code in the OpenFOAM-2.0.x folder, before running that command?

As far as I remember, no. I didn't change anything there. I just copied my custom code under 'user' directory, that is jalal-2.0.x, and compiled them and tried to run my binaries.

Today, I went to the openFOAM-2.0.x directory, and issued the restore command you provided in your old post. This is what I witnessed:
Code:

Note: checking out '2b11286dad626d4f6a35379eeda0f29b0ee5ac23'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 2b11286... ENH: meshSearch: use tet decomposition for cell searching

After that I tried to run the original aachenBomb test case with original dieselFoam solver, not my customized version, and I had the same problem:
Code:

--> FOAM FATAL ERROR:
Tcommon 1000 for C7H16 != 1391 for others

    From function janafThermo<EquationOfState>::operator-=(const janafThermo<EquationOfState>& jt) const
    in file /home/jalal/OpenFOAM/OpenFOAM-2.0.x/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 260.

FOAM exiting

What should I do?! :confused:

I tried the new restore and make commands you proposed:
Quote:

Originally Posted by wyldckat (Post 356376)
If so, run the following commands:
Code:

git stash
git checkout 2b11286dad626d4f6a35379eeda0f29b0ee5ac23
git stash pop

And build OpenFOAM again:
Code:

./Allwmake

And this was what I received:
Code:

jalal@ubuntu:~/OpenFOAM/OpenFOAM-2.0.x$ git stash
No local changes to save
jalal@ubuntu:~/OpenFOAM/OpenFOAM-2.0.x$ git checkout 2b11286dad626d4f6a35379eeda0f29b0ee5ac23
HEAD is now at 2b11286... ENH: meshSearch: use tet decomposition for cell searching
jalal@ubuntu:~/OpenFOAM/OpenFOAM-2.0.x$ git stash pop
No stash found.

Even though there was no stash to be saved, I issued the Allwmake command. Now, I have to wait hours for the Allwmake to finish...:rolleyes:

I hope this fixes the problem.:(

Jalal

wyldckat April 24, 2012 04:13

Hi Jalal,

OK, then the problem was that you only did the git checkout. Without re-building OpenFOAM, the libraries and applications could not reflect the modified source code. I didn't mention the need to run Allwmake because it's implied when using the git version of OpenFOAM ;)

To speed up the build process, run this command before Allwmake:
Code:

export WM_NCOMPPROCS=4
This allows you to build with 4 simultaneous processes, making it about 3 times faster...

Best regards,
Bruno

JBUNSW April 24, 2012 04:35

Thanks Bruno,

I didn't know about the necessity of Allwmaking after gitting!

I didn't have the chance to try your multiprocessor speedup command, because I had already issued the Allwmake. Anyway, now dieselFoam works and I do not see those strange janafThermo errors. So happy!:p:)

Thanks again,
Jalal

kmpang April 4, 2013 07:29

Hi Foamers,

I have used the solution proposed by Bruno and it worked on my laptop. However, when I did the exact same thing on my workstation and I received the error below when I run the case.

Evolving Spray
Solving chemistry
#0 Foam::error:: printStack(Foam::Ostream&) in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 exp in "/lib/x86_64-linux-gnu/libm.so.6"F
#4 Foam::ReversibleReaction<Foam::sutherlandTransport <Foam::specieThermo<Foam::janafThermo<Foam:: perfectGas> > >, Foam::FallOffReactionRate<Foam::ArrheniusReactionR ate, Foam::TroeFallOffFunction> >::kf(double, double, Foam::Field<double> const&) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#5 Foam::ODEChemistryModel<Foam:: psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam:: perfectGas> > > >::omega(Foam::Reaction<Foam::sutherlandTransport< Foam::specieThermo<Foam::janafThermo<Foam:: perfectGas> > > > const&, Foam::Field<double> const&, double, double, double&, double&, int&, double&, double&, int&) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#6 Foam::ODEChemistryModel<Foam:: psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam:: perfectGas> > > >::omega(Foam::Field<double> const&, double, double) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#7 Foam::ODEChemistryModel<Foam:: psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam:: perfectGas> > > >::derivatives(double, Foam::Field<double> const&, Foam::Field<double>&) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#8 Foam::ODESolver::solve(Foam::ODE const&, double, double, Foam::Field<double>&, double, double&) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libODE.so"
#9 Foam::ode<Foam::ODEChemistryModel<Foam:: psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam:: perfectGas> > > > >::solve(Foam::Field<double>&, double, double, double, double) const in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#10 Foam::ODEChemistryModel<Foam:: psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam:: perfectGas> > > >::solve(double, double) in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#11
in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/bin/dieselFoam"
#12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13
in "/home/kmpan/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/bin/dieselFoam"
Floating point exception (core dumped)

Both my laptop and workstation are running with OF20x and the test case is exactly the same. :confused:

FYI, there are many fall-off reactions in my chem.inp, defined by by LOW and TROE, for example:

C2H2+H(+M)<=>C2H3(+M) 5.600E+12 0.000 2.400E+03
LOW / 3.8000E+40 -7.2700E+00 7.2200E+03 /
TROE / 7.5100E-01 9.8500E+01 1.3020E+03 4.1670E+03 /
H2/2/ H2O/6/ CO/1.5/ CO2/2/ CH4/2/ C2H6/3/

When I commented out LOW and/or TROE, the case can be run but apparently, the solution is just not right. :p

Can anyone please give some advice regarding this issue?

Many thanks in advance!

Best regards,
Pang.

wyldckat April 6, 2013 07:03

Greetings Pang,

Try this on both machines:
Code:

dieselFoam -help
At the end of the help message, you should see something similar to this:
Code:

Using: OpenFOAM-2.0.x (see www.OpenFOAM.org)
Build: 2.0.x-3cdcacaf38bb

But in your case, instead of "3cdcacaf38bb" you should see "2b11286dad62", which is the first 12 bytes from the hash for the commit I indicated in the second post.

Best regards,
Bruno

kmpang April 9, 2013 03:46

Hi Bruno,

Sorry for the late reply.

I have run dieselFoam -help on both of the machines and they did show 2.0.x-2b11286dad62. However, one of them gives the problem that I mentioned earlier. Do you have any clue? It's just confusing me. :confused:

Many thanks for your help. :)

Best regards,
Pang

wyldckat April 9, 2013 04:22

Hi Pang,

Try running one of the tutorial cases from 2.0.x that use dieselFoam.

If it also crashes, try running the following commands for rebuilding OpenFOAM 2.0.x:
Code:

foam
wcleanAll
export WM_NCOMPPROCS=4
./Allwmake > make.log 2>&1

Change "4" to the number of cores in your machine.

Best regards,
Bruno

kmpang April 11, 2013 06:01

Thanks again Bruno.

In fact it didn't crash with the tutorial case and when I use some other chemical mechanisms. I tried to recompile OF too but it doesn't solve the problem. That's weird. Emm... :mad:

Best regards,
Pang

wyldckat April 11, 2013 09:46

Hi Pang,

A few ideas come to mind:
  1. Do both machines use the x86_64 architecture? Because if one of them is a 32bit machine, or has a i686 Linux Distribution installed, that might indicate that the problem is related to small math differences.
  2. The libraries used on the system might be different. Run the following command on both machines:
    Code:

    ldd $(which dieselFoam)
    Check if there are differences between the two outputs.
  3. Check if the binary is exactly the same, location-wise:
    Code:

    which dieselFoam
  4. Are you 100% certain that the cases are identical on both machines?
  5. Does your case have any "libs ();" or function object entries in "system/controlDict"?
  6. Have you modified anything or any file inside the folder "OpenFOAM-2.0.x/etc"?
  7. Does the folder "~/.OpenFOAM" exist? If so, are there any stray files inside it? Notice that there is a dot symbol before "OpenFOAM"! This folder is for personal configurations.
  8. Have you built any custom solvers or libraries on one of the machines? Check by running:
    Code:

    ls -l $FOAM_USER_APPBIN
    ls -l $FOAM_USER_LIBBIN

Best regards,
Bruno

kmpang April 13, 2013 04:40

Hi Bruno,

Million thanks for the suggestion. Unfortunately, the remote access to my office workstations is down. :mad: I can't test them out throughout the weekend. I'll test next week and share my experience here by then.

Thanks again and have a nice weekend!

Best regards,
Pang.

kmpang April 15, 2013 03:14

Hi Bruno,

I have checked through according to your suggestions:

1) Do both machines use the x86_64 architecture? Because if one of them is a 32bit machine, or has a i686 Linux Distribution installed, that might indicate that the problem is related to small math differences.
A: Yes, both are running with the x86_64 architecture.

2) The libraries used on the system might be different. Run the following command on both machines:
Code: ldd $(which dieselFoam)
Check if there are differences between the two outputs.
A: All the libraries are same but the alphanumeric at the end of each line is different, does it matter?
----- Eg: libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f16723bc000)

3) Check if the binary is exactly the same, location-wise:
A: The binary is exactly the same.

4) Are you 100% certain that the cases are identical on both machines?
A: Yes, I'm sure that the cases are identical.

5) Does your case have any "libs ();" or function object entries in "system/controlDict"?
A: No, I didn't include that function objection there.

6) Have you modified anything or any file inside the folder "OpenFOAM-2.0.x/etc"?
A: I don't think I did anything to any files in that folder.

7) Does the folder "~/.OpenFOAM" exist? If so, are there any stray files inside it? Notice that there is a dot symbol before "OpenFOAM"! This folder is for personal configurations.
A: I have checked under my personal directory and I don't see any ~/.OpenFOAM there.

8) Have you built any custom solvers or libraries on one of the machines?
A: I have quite a bit of different custom solvers and libraries in both of the machines but as far as I remember, I didn't modify anything on the default dieselFoam.

By the way, one of my machine (of that which is free from this problem) is running with Ubuntu 11.10 while the one faces the problem is running with Kubuntu 12.04. Will this difference give the problem?

Many thanks again.

Best regards,
Pang

wyldckat April 15, 2013 08:21

Hi Pang,

7) Confirm with the following command, just in case:
Code:

ls -l ~/.OpenFOAM
8) Just in case, try the following commands:
Code:

mv ${FOAM_USER_APPBIN} ${FOAM_USER_APPBIN}_backup
mv ${FOAM_USER_LIBBIN} ${FOAM_USER_LIBBIN}_backup

  • To check what they do first, run with "echo" in the beginning:
    Code:

    echo mv ${FOAM_USER_APPBIN} ${FOAM_USER_APPBIN}_backup
    echo mv ${FOAM_USER_LIBBIN} ${FOAM_USER_LIBBIN}_backup

  • To undo:
    Code:

    mv ${FOAM_USER_APPBIN}_backup ${FOAM_USER_APPBIN}
    mv ${FOAM_USER_LIBBIN}_backup ${FOAM_USER_LIBBIN}

This will only work if your custom solvers/utilities were built into these folders.

As for one being Ubuntu 11.10 and the other Kubuntu 12.04 - there are a few possibilities:
  • If you incorrectly copied things from one machine to the other, then there might be some broken files or links. But if you independently built on both directly from the git repositories, then there shouldn't be any problems.
  • The kernel on one of them might be suspicious, at least from my experience with Ubuntu 11.10... but on 12.04, it should be very stable.
  • There could be a hardware problem on the machine you are having problems. But usually you should have gotten more than one problem so far...
Best regards,
Bruno

kmpang April 18, 2013 05:23

Hi Bruno,

Sorry for the late reply. I was busy with something else.

7) Tried using 'ls -l ~/.OpenFOAM' and it returned with 0 found.

8) I can't test these now cause I'm running some cases with the solvers. I'll test it as soon as I finish those simulations.

Emm, for some reasons, it works with 11.10 but not 12.04 in my case - weird enough.

Many thanks for the support again. I shall continue to find out the reason behind soon. :o

Best regards,
Pang.


All times are GMT -4. The time now is 09:58.