|
[Sponsors] |
February 15, 2017, 13:08 |
Issue with logarithm function in OpenFOAM
|
#1 |
New Member
fluidflowsteel
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
Hi ,
I am able to solve the following PDE successfully in OpenFOAM fvm::ddt(X) == fvc::div(Y1*Y2*fvc::grad(X1/(1-X1))) where X,X1, Y1 and Y2 are scalar field variables but when I modify the PDE in the following form fvm::ddt(X) == fvc::div(Y1*Y2*fvc::grad(log(X1/(1-X1)))) where X1 is 0.09 (i.e less than 1) I am getting the following error #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 log in "/lib/x86_64-linux-gnu/libm.so.6" #4 Foam::log(Foam::Field<double>&, Foam::UList<double> const&) at ??:? #5 ? at ??:? #6 ? at ??:? #7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #8 ? at ??:? Can anyone help me how can get rid of the error ? With regards |
|
February 15, 2017, 16:51 |
|
#2 |
Senior Member
|
Hi,
Is X1 constant? Can it be 0? Can it be negative? Just use X1.writeMinMax(Info) to see the range of X1. |
|
February 16, 2017, 05:05 |
|
#3 |
New Member
fluidflowsteel
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
Hi,
NO X1 is not a constant. X1, Y1 and Y2 are volume scalar field variables. The initial value of X1 is 0.09. I think because of this value (which is very close to 0), the program is showing the error. With regards |
|
February 16, 2017, 05:21 |
|
#4 | |
Senior Member
|
Quote:
The error happens on the first solver iteration? |
||
February 16, 2017, 05:31 |
|
#5 |
New Member
fluidflowsteel
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
yes the error happens on first solver iteration. Look grad (logX1) = (1/X1)*grad(X1). since X1 initial value is 0.09 i think because of 1/0.09, the error is coming
|
|
February 16, 2017, 06:14 |
|
#6 |
Senior Member
|
And you really think, compiler use chain rule for gradient? Instead of GUESSING, you can:
1. Just CHECK values of X1. 2. Use debug build of OpenFOAM to see exact line number, where error is located. Or if this thread is psychoanalytic one, yes, we can continue to discuss, your thoughts. Next step is to talk about your feelings about this error. Did you have particular problems with logarithms in childhood? Also, if I did not make a mistake |
|
February 17, 2017, 09:14 |
|
#7 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Another possible cause is that X1 is zero on one of the boundaries.
/N |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
issue compiling new turbulence model | perplexed user | OpenFOAM Programming & Development | 1 | January 13, 2012 04:40 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |
[swak4Foam] wmake groovyBC in OpenFOAM 1.7 ? | randomid | OpenFOAM Community Contributions | 1 | August 27, 2010 06:15 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |