|
[Sponsors] |
April 2, 2016, 15:12 |
Logarithm for volScalarField
|
#1 |
New Member
Akash
Join Date: Jun 2014
Location: Oslo
Posts: 29
Rep Power: 12 |
Hi All
I am working on a multiphase solidification model and I need to construct a drag model taking into grain motion during solidification of binary alloys. So I obtain reynolds number (volScalarField) from the velocity fields of solid and liquid. To obtain the drag coefficient, I need to have an expression like log10(Reynolds). So when I use this, the code compiles. But when I run the simulation I get 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 log10 in "/lib/x86_64-linux-gnu/libm.so.6" #4 Foam::log10(Foam::dimensioned<double> const&) at ??:? #5 ? at ??:? #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #7 ? at ??:? Floating point exception (core dumped) I am assuming this not the way to calculate logarithmic expressions. Can somebody guide me through this? Thanks Akash |
|
April 2, 2016, 16:39 |
|
#2 |
Senior Member
|
Hi,
(obvious) Are you sure Reynolds field is positive? FPE suggests contrary. |
|
April 2, 2016, 16:45 |
|
#3 |
New Member
Akash
Join Date: Jun 2014
Location: Oslo
Posts: 29
Rep Power: 12 |
Its small (order 1e-4) but certainly positive.
|
|
April 2, 2016, 16:52 |
|
#4 |
Senior Member
|
Surely you can set up 1D problem with 10 cells and post output of
Code:
Info<< Reynolds << endl |
|
April 2, 2016, 17:03 |
|
#5 |
New Member
Akash
Join Date: Jun 2014
Location: Oslo
Posts: 29
Rep Power: 12 |
Rel: 5.67461e-05
Rel: 5.67461e-05 Rel: 0.000116924 Rel: 0.000116924 Rel: 0.000114174 Rel: 0.000114174 Rel: 0.000117549 Rel: 0.000117549 Rel: 0.000113562 Rel: 0.000113562 Rel: 0.000122217 Rel: 0.000122217 The values are correct (with some slight error ofcourse) as I have verified with the analytical model. |
|
April 2, 2016, 17:33 |
|
#6 |
New Member
Akash
Join Date: Jun 2014
Location: Oslo
Posts: 29
Rep Power: 12 |
So yea, I got the error. A numerical parameter in my code was the issue. This was setting Reynolds number to zero in some cells. Anyways, thanks for the help
Cheers Akash |
|
April 2, 2016, 17:38 |
|
#7 |
Senior Member
|
Hi,
Since your output differs from standard volScalarField output: Code:
dimensions [0 0 0 0 0 0 0]; internalField nonuniform List<scalar> 10 ( ... ) ; boundaryField { ... boundaries ... } Also you can try running debug build to see where exactly (up to line number) you have problem. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
natural logarithm function | zhoubinwx | OpenFOAM Programming & Development | 8 | July 5, 2010 07:13 |
Could you tell me how to use logarithm function ( | fanjl | Phoenics | 4 | February 9, 2005 12:25 |