|
[Sponsors] |
May 27, 2014, 13:32 |
value of alpha1[celli] is not correct
|
#1 |
New Member
jaming
Join Date: Dec 2010
Location: Berlin
Posts: 9
Rep Power: 15 |
Hi Foamers,
I have a problem setting in the forAll() loop the right condition: ########################## forAll(alpha1,celli) { if (alpha1[celli] > 1 ) { Pout<<"alpha1= "<<alpha1[celli]<<endl; } } ########################## I also get alpha1= 1 in the results what I think is not logic. So if someone has any idea I will be thankful Yamine |
|
May 27, 2014, 15:34 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hallo,
It is probably related to your write precision in your controlDict, e.g. if the write precision is 6, then 1.000000007 is written as 1. You could test this by using the following code: Code:
Pout << alpha1[celli] << tab << 1 - alpha1[celli] << endl; Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 27, 2014, 17:01 |
|
#3 |
New Member
jaming
Join Date: Dec 2010
Location: Berlin
Posts: 9
Rep Power: 15 |
Many thanks for you quick replay,
but look for example hier: Code:
forAll(alpha1, celli) { if ( alpha1[celli] < scalar(1.)) { Pout<< "Alpha1= "<<alpha1[celli]<< endl; } PHP Code:
And like you can see unfortunately 1 is not filtered here With kind regards, Yamine |
|
May 27, 2014, 17:13 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
With your recent code, you turned around the inequality, and the value being 1, can actually be 0.9999999999, i.e. to me the code still does the rigth thing.
Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 27, 2014, 17:36 |
|
#5 |
New Member
jaming
Join Date: Dec 2010
Location: Berlin
Posts: 9
Rep Power: 15 |
Hi ngj
Many Thanks for your unpayable help. Regards Yamine |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is my Dynamic mesh setup correct? | cfd seeker | FLUENT | 16 | October 30, 2020 07:16 |
Evaporation due to Heat Transport using InterFoam (Correct Implementation?) | ovie | OpenFOAM | 14 | August 3, 2019 08:00 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Is there a way to find a correct "spacing"? | Jordi P. | Main CFD Forum | 2 | August 15, 2013 11:05 |
LES correct function | luiz eduardo | OpenFOAM Running, Solving & CFD | 6 | September 14, 2007 05:10 |