|
[Sponsors] |
May 9, 2011, 12:57 |
Bug in patchInternalField()
|
#1 |
Senior Member
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18 |
Greetings,
I believe that there is a problem in implementation of the function patchInternalField(). The distribution is OpenFoam-1.7.1. The problem was discovered while working on updateCoeffs() function of derivedFvPatchField (derived from mixedFvPatchField): Code:
void Foam::myFvPatchScalarField::updateCoeffs() { // <some code> const scalarField& thisIntField = patchInternalField(); Info << thisIntField << endl; // <some more code> } Instead, some cells contain zero value. Code:
value nonuniform List<scalar> 2160 ( 6.92193e-310 6.92193e-310 0 0 300 300 300 <...> ); New boundary condition is applied only on the inner patch. Anomalies appear only on the faces that are next to the edges, selective, not all. Usually several first ones (like in the example above). If the "inner" patch is divided into 6 ones, with applied new derivedBC, anomalies are not observed. Presented usage of the function is quite basic- this drives to conclusion that there is something wrong deeper in the code. Please this bug into consideration. I would also be very grateful for any other possible explanation of the described problem. Best, Pawel S |
|
July 24, 2011, 17:14 |
|
#2 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Did this get resolved? Maybe you should report it directly to http://www.openfoam.com/bugs/
and/or http://sourceforge.net/apps/mantisbt..._view_page.php Cheers, Dan |
|
September 21, 2011, 14:12 |
|
#3 | |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Pawel,
did you create a bug report for this? I have not been able to find one... At the moment, I am facing the same problem (using OF 1.6-ext), as patch values calculated by patchInternalField() are different from internal field values in the patch near cells. Or did you find a solution for this in the meantime? Arne Edit: Could someone check if the following is right or wrong: Quote:
Last edited by Arnoldinho; September 22, 2011 at 02:50. Reason: typos |
||
September 22, 2011, 08:46 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Ok, having a deeper look at my results, I can so far state that the "bug" in my case only resulted from the interpolation/display scheme in ParaView:
Values from U.boundaryField()[patchi].patchInternalField() were different from U internalField values at regarded probe locations, because ParaView normally seems to use (mesh) point values instead of cell values for display. Using a CellDatatoPointData filter before setting the probe location in contrast results in identical values. Arne |
|
October 12, 2011, 04:53 |
|
#5 |
New Member
Tim Gronarz
Join Date: Sep 2011
Location: Aachen
Posts: 4
Rep Power: 15 |
Hi,
i am facing exactly the same Problem as Pawel does. I also get four wrong values as the first entries in my Field list. Is there a Solution to this? Is it even a Bug or did i do something wrong? Cheers, Tim |
|
October 12, 2011, 05:22 |
|
#6 |
Senior Member
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18 |
Hello Tim,
this issue disappeared when I moved to OF-2.0.0. In the end I did not find out what caused it, but used a "walk around". You can create a function and use it instead of patchInternalField In the .H file: Code:
virtual tmp<scalarField> ppatchInternalField() const; Code:
Foam::tmp<Foam::scalarField> Foam::NAME_OF_YOUR_BOUNDARY_CONDITION::ppatchInternalField() const { tmp<scalarField> tField(new scalarField(size())); scalarField& refF=tField(); forAll(patch().faceCells(),cellI) { refF[cellI]=(*this).internalField()[patch().faceCells()[cellI]]; } return tField; } Hope it helps a bit. Best, Pawel |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serious bug in LES interface | fs82 | OpenFOAM Bugs | 21 | November 16, 2009 09:15 |
On Bug of Fluent 12.0 | lzgwhy | FLUENT | 0 | August 26, 2009 07:41 |
Bug in twoPhaseEulerFoam wallfunctions | alberto | OpenFOAM Bugs | 1 | February 9, 2007 15:15 |
Bug reports | Mattijs Janssens (Mattijs) | OpenFOAM | 0 | January 10, 2005 11:05 |
Forum y2k Bug | Jonas Larsson | Main CFD Forum | 1 | January 5, 2000 11:22 |