|
[Sponsors] |
April 28, 2020, 10:32 |
very small values get set to 0
|
#1 |
Member
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 7 |
Hi my problem is that in my simulations some numeric values are very small, in regions of 1E-40 for example a approximation for a rate coefficient field :
Code:
k4.field() = 1.5E-40*pow(TGas.field()/300, -2.5); |
|
April 28, 2020, 12:23 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Have a look at the machine epsilon table below, and compare it with your hardware:
Machine epsilon
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 1, 2020, 14:30 |
|
#3 |
Member
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 7 |
from python I got:
Code:
import sys sys.float_info.epsilon Out[2]: 2.220446049250313e-16 |
|
May 3, 2020, 18:11 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
yes, those numbers lower than the machepsilon ks mumbo jumbo most of the time to avoid fp exceptions.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 4, 2020, 06:28 |
|
#5 | ||
Member
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 7 |
Hi for everyone who sees this post, here is a complete discussion about the topic.
is double precision default of OF? in short: Quote:
|
|||
Tags |
numerical, small, values |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 17:35 |
Set values of a volVectorField to zero | GustavGans | OpenFOAM Programming & Development | 12 | April 9, 2019 01:12 |
set a volScalarField values | anishtain4 | OpenFOAM | 1 | July 5, 2012 10:28 |
Numerical errors in nested domain with pre-calculated boundary values | Arnoldinho | OpenFOAM Running, Solving & CFD | 3 | April 4, 2012 11:31 |
Reference values set up Plz help! | pah | FLUENT | 0 | June 14, 2005 07:39 |