|
[Sponsors] |
DirectMappedPatchBase, offset and samplePatch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 5, 2010, 07:20 |
DirectMappedPatchBase, offset and samplePatch
|
#1 |
Senior Member
Francois
Join Date: Jun 2010
Posts: 107
Rep Power: 21 |
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; } 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 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. |
|
September 28, 2012, 08:53 |
|
#2 |
New Member
|
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; }
__________________
SnappyWiki |
|
April 16, 2013, 22:21 |
Question
|
#3 |
New Member
Jeff Cumpston
Join Date: Oct 2011
Posts: 8
Rep Power: 15 |
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 |
|
April 29, 2013, 11:52 |
|
#4 |
New Member
|
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); } 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; } 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.
__________________
SnappyWiki |
|
May 1, 2013, 04:38 |
|
#5 |
New Member
Jeff Cumpston
Join Date: Oct 2011
Posts: 8
Rep Power: 15 |
Hi Elia,
Thanks for your reply, that is much clearer now! Jeff |
|
Tags |
directmappedpatchbase, directmappedvelocityflux, offset, pisofoam, samplepatch |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
chtMultiRegionFoam - offset | santoo_cfd | OpenFOAM | 11 | November 1, 2010 16:01 |