CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

DirectMappedPatchBase, offset and samplePatch

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 3 Post By elia87
  • 2 Post By elia87

Reply
 
LinkBack Thread Tools Display Modes
Old   October 5, 2010, 06:20
Question DirectMappedPatchBase, offset and samplePatch
  #1
Senior Member
 
Francois
Join Date: Jun 2010
Posts: 107
Rep Power: 7
Fransje is on a distinguished road
Dear Foamers,

I've encountered an issue I couldn't quite understand when using the directMappedVelocityFlux boundary condition. In the ./constant/polyMesh/boundary file I specify the following:
Code:
inlet1
{
    type                directMappedPatch;
    nFaces             512;
    startFace          95232;
    offset               (0 0 0);
    sampleRegion    region0;
    sampleMode      nearestPatchFace;
    samplePatch      outlet1;
}

inlet2
{
    type               directMappedPatch;
    nFaces            512;
    startFace         95744;
    offset              (0 0 0);
    sampleRegion   region0;
    sampleMode     nearestPatchFace;
    samplePatch     outlet2;
}
And run blockMesh. The blockMesh utility overwrites the samplePatch information back to none, so after running blockMesh, I re-modify samplePatch back to outlet1 and outlet2. Up to here, all is well.
The problem comes when running pisoFoam, which returns the following error:
Code:
--> FOAM FATAL ERROR: 
Did not find sample (0 0.03125 0.0625) on any processor of region region0

    From function directMappedPatchBase::findSamples(const pointField&, labelList&, labelList&, pointField&)
    in file directMapped/directMappedPolyPatch/directMappedPatchBase.C at line 364.

FOAM exiting
Changing the offset value to (1 0 0) for both patches returns almost the same error, with pisoFoam complaining about not finding sample (1 0.03125 0.0625).

However! Changing the offset value to (2 0 0) does work! Any tips/ideas why?

And when specifying that offset, the mapped velocities are taken from the patches outlet1 and outlet2 located at (6 0 0) -which was what I was trying to achieve-, but having absolutely nothing to do with the offset (2 0 0)...
So I was thinking that maybe I was misunderstanding the concept of the offset value, and I was wondering if someone would happen to know what the offset value is compared to the samplePatch option? Do they have anything to do with each other?

Looking forward to you replies!

Francois.
Fransje is offline   Reply With Quote

Old   September 28, 2012, 07:53
Default
  #2
New Member
 
Elia Agnani
Join Date: Oct 2011
Location: Modena, Italy
Posts: 5
Rep Power: 5
elia87 is on a distinguished road
Send a message via Skype™ to elia87
Hi Francois,

I don't know if you are still using OpenFOAM and anyway I guess you have solved this problem, but I'm going to answer your question hoping it will be useful for other foamers.

In offset dictionary you have to put the distance between the mapped patches.


For example:

I want to map a fan_outlet patch to the fan_inlet one; fan_outlet is a linear extrusion of fan_inlet patch in positive y direction for 2.75 meters.

This is how I set my constant/polyMesh/boundary file

Code:
    fan_outlet
    {
        type                 mappedPatch;
        nFaces             800;
        startFace          2524850;
	sampleMode	nearestPatchFace;
	samplePatch	fan_inlet;
	offsetMode  	uniform;
	offset		        (0 -2.75 0); //negative because fan_inlet is behind fan_outlet
    }
    fan_inlet
    {
        type               patch;
        nFaces          800;
        startFace       2525650;
    }
Tobi, adambarfi and ing like this.
__________________
SnappyWiki
elia87 is offline   Reply With Quote

Old   April 16, 2013, 21:21
Default Question
  #3
New Member
 
Jeff Cumpston
Join Date: Oct 2011
Posts: 8
Rep Power: 5
Jeffzda is on a distinguished road
Hi Elia,

I am having trouble understanding what it means to map a patch. Does this map all the surface fields to the new patch? I'm trying to generate a mappedPatch for use with the viewFactorsGen utility for radiation modelling. Specifically, I don't understand what you mean by one patch being a 'linear extrusion' of another. My understanding is that an extrusion of an area is a volume, but the extrusion you're talking about is still surely a patch area. I wonder if you could explain this a bit further.

Thank you for posting this just for a sake of fellow foamers!

Cheers,

Jeff
Jeffzda is offline   Reply With Quote

Old   April 29, 2013, 10:52
Default
  #4
New Member
 
Elia Agnani
Join Date: Oct 2011
Location: Modena, Italy
Posts: 5
Rep Power: 5
elia87 is on a distinguished road
Send a message via Skype™ to elia87
Hi Jeffzda,

I will try to better explain myself.

I have modeled a jet fan in a road tunnel as a simple cave cylinder (in figure 1.png you can see a slice of the tunnel with fan_inlet and fan_outlet patches).

For some reasons I want the flow through fan_outlet to be the same as the fan_inlet's one, so I mapped U, epsilon, k and nut from fan_inlet (where they have a 'zeroGradient' boundary condition) to fan_outlet.
In figure 2.png you can see for example the axial component of velocity on fan_inlet and fan_outlet patches.

To do this it is necessary to use a 'mapped' boundary conditions on fan_outlet for U and turbulent quantities.

Code:
// content of 0/U file //    

fan_outlet
    {
        type                mapped;
        value               uniform (0 0 0);
        interpolationScheme cell;
        setAverage          false;
        average             (0 0 0);
    }
But 'mapped' boundary conditions can be applied only on 'mappedPatch' patches.
So I have manually modified (it is not necessary to use 'createPatch' in this case, at least in OF 2.1.x) the 'constant/polyMesh/boundary' file for fan_outlet

Code:
// content of constant/polyMesh/boundary file //
    
    fan_outlet
    {
        type             mappedPatch;
        nFaces         800;
        startFace      2524850;
	sampleMode	nearestPatchFace;
	samplePatch	fan_inlet;
	offsetMode        uniform;
	offset  (0 -2.75 0); //negative because fan_inlet is behind fan_outlet
    }
    fan_inlet
    {
        type               patch;
        nFaces          800;
        startFace       2525650;
    }
Where (0 -2.75 0) is simply the distance between patch fan_outlet and fan_inlet. The word "extrusion" is quite inappropriate, sorry.

PS: I used a 'mapped' boundary condition for U, k and epsilon, but for p I used a 'zeroGradient' condition on fan_outlet. So I think you can choose which fields to map on the 'mappedPatch'. If you use a BC type different from 'mapped', the 'mappedPatch' (fan_outlet in my case) will behave as a simple patch of 'patch' type.
Attached Images
File Type: jpg 1.jpg (14.9 KB, 74 views)
File Type: jpg 2.jpg (7.4 KB, 67 views)
marluc and ing like this.
__________________
SnappyWiki
elia87 is offline   Reply With Quote

Old   May 1, 2013, 03:38
Default
  #5
New Member
 
Jeff Cumpston
Join Date: Oct 2011
Posts: 8
Rep Power: 5
Jeffzda is on a distinguished road
Hi Elia,

Thanks for your reply, that is much clearer now!

Jeff
Jeffzda is offline   Reply With Quote

Reply

Tags
directmappedpatchbase, directmappedvelocityflux, offset, pisofoam, samplepatch

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
chtMultiRegionFoam - offset santoo_cfd OpenFOAM 11 November 1, 2010 16:01


All times are GMT -4. The time now is 21:45.