CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Crash using DirectMappedVelocityFluxField (https://www.cfd-online.com/Forums/openfoam-bugs/80469-crash-using-directmappedvelocityfluxfield.html)

Fransje September 27, 2010 11:06

Crash using DirectMappedVelocityFluxField
 
Dear developers, debuggers and forum readers,

When using the directMappedVelocityFlux patch to remap the U field, pisoFoam crashes when using the NEARESTFACE option.

If interested, I can post the error message associated with the crash, but I've traced the origin back to the following piece of code in directMappedVelocityFluxFixedValueFvPatchField:
Code:

00209            newUValues = patch().patchSlice(newUValues);
The thing is that newUValues was declared slightly higher with
Code:

00176    vectorField newUValues;
but was not used/instantiated after that.
Reading the similar routine used in directMappedFixedValueFvPatchField.C, I guess the variable in brackets should be allUValues and not newUValues, leading to:
Code:

00209            newUValues = patch().patchSlice(allUValues);
This is however only an educated guess of yours truly, since I don't know what the patch().patchSlice() function does... :o

I was also wondering if a kind soul could also make good use of this discussion and explain to me what the patch().patchSlice() command does?

Kind regards,

Francois.

mattijs September 28, 2010 09:07

We've finally got a proper bug reporting system :-)
Please report any OpenFOAM bugs on http://www.openfoam.com/bugs.

Thanks,

Mattijs

JamesJCFD October 14, 2010 02:44

2 Attachment(s)
This was still crashing for me;

The updated inlet velocity is written out in the wrong place in "case customDirectMappedPolyPatch::NEARESTFACE"

I've attached fixed C source files.

JamesJCFD October 14, 2010 03:24

The mapDistributes may also need to be corrected?

Fransje October 14, 2010 07:29

Dear James,

I don't know which version of OpenFOAM you are using, but the issue I had has been resolved in the 1.7.x version. It's just a question of entering "git pull" in the OpenFOAM-1.7.x directory, and recompiling with ./Allwmake.

I haven't yet double checked the order of writing in NEARESTFACE, but I saw that you moved the patch().patchSlice() before the mapDistribute::distribute command. I'll come back to you on that one as soon as I find the time to further investigate the problem.

Kind regards,

Francois.

JamesJCFD October 14, 2010 11:30

Hi Francois,

I was on the most recent pull of the repos, recompiled from scratch.
(Check bug #0000056 on the foam bugs list); nearestFace wasn't working for me at all until I moved new*Values to before the mapDistributes, similar to the other cases...

James

Fransje November 8, 2010 06:48

Hi James,

Thank you for your reply!
Good to know the problem is fixed, as I was just going to start working with the NEARESTFACE option.. ;-)

Regards,

Francois.

panda60 November 9, 2010 03:28

Dear Fransje,

It seems that nearestFace still doesn't work for me. mattijs has modified this in 2010.10.15.

In my U file, I use like this,

inlet
{
type directMappedVelocityFlux;
value uniform(10 0 0);
setAverage false;
average (10 0 0);
phi phi;
}

Is it right?
Thanks.

Fransje November 10, 2010 11:09

Dear panda,

Yes, this is correct.
By the way, if you are using the directMappedVelocityFlux type you don't need the setAverage and the related average switches since they are not used by the directMappedVelocityFluxFvPatchField class.

Kind regards,

Francois.

Fransje November 12, 2010 06:43

And nearestFace should now work as well. See the following thread:

http://www.cfd-online.com/Forums/ope...tml#post283044

Kind regards,

Francois.

panda60 January 13, 2011 07:34

Quote:

Originally Posted by JamesJCFD (Post 279208)
Hi Francois,

I was on the most recent pull of the repos, recompiled from scratch.
(Check bug #0000056 on the foam bugs list); nearestFace wasn't working for me at all until I moved new*Values to before the mapDistributes, similar to the other cases...

James

Dear James,

Are you working now for "nearestFace" ? I think mattijs have fixed the bug for nearestPatchFace, and it is working now. But I think he didn't repair nearestFace. How about your case ?

Thanks.

JamesJCFD January 13, 2011 08:16

Hi,

It has been a while since I looked at this, however I'm think that that the fix Mattijs implemented, worked for me?

James


All times are GMT -4. The time now is 18:50.