CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   mappedPatch BC (

vigges February 20, 2012 09:42

mappedPatch BC
Hi all!!

I'm having a hard time setting up the boundary conditions for my 2D case.
I'm using OF 2.1.0 and simpleFoam.

What I need is a mapped patch at the inlet in order to get a fully developed turbulent flow before entering a diffuser.
I adjusted my constant/polyMesh/boundary and 0/U as followed:

        type            mappedPatch;
        nFaces          8;
        startFace      45368;
        sampleMode        nearestCell;
        sampleRegion    region0;
        samplePatch        none;
        offsetMode        uniform;
        offset            (0.035 0 0);


        type                        mapped;
        value                        uniform (30.22 0 0);
        interpolationScheme            cell;
        setAverage                    true;
        average                        (30.22 0 0);   

Unfortunately, it's not working.
Any ideas or suggestions what I could change?


stevenvanharen February 20, 2012 11:20

What do you exactly mean when you say it is not working?

I am not sure about version 2.1 but in 1.7 you should have directMappedPatch as type in the boundary file. And directMapped in the field file.

Did you check the tutorials? Or you sure this type is correct?

vigges February 22, 2012 04:38

Problem solved.
After converting my 3D sHM mesh into 2D using extrudeMesh and autoPatch, I forgot to reassign the properties to the inletPatch in constant/polyMesh/boundary.

samiam1000 May 9, 2012 03:45

Hi all,

just a question: does the mappedPatch type allow you to set the interface between 2 fluid regions??

Thanks a lot,


Djub March 15, 2013 07:39

Hi Vigges,
May I ask you what is your 0/p boundary conditions for your inlet ?
Do you map also the pressure field or use a classic "zerogradient" condition?
For me, the NS equations are linking both fields. You should not take V without P! Nevertheless, tutorial are making this (U=mapped and p=zeroGradient ). What is your opinion about this?
For example, there is a under-pressure in the core of a large vortex. Don't you have to map it in the inlet? Or the NS solver is able to reconstruct it thanks to U-field?
I am still doubtfull, because within the calculated domain, from where you extract the V field, pressure field has no reason to be zerogradient!
How to deal with this?

hrvig March 8, 2015 12:34

I am asking the exact same questions as you Djub. What I have done so far is to place my sample patch sufficiently long away from the outlet, so that the type of BC here does not influence on the sample patch.

Did you find a way to solve your problem?

I am having convergence problems when mapping the pressure field from outlet to inlet. This approach does as well require you to specify a reference pressure inside the domain, which shouldn't be a problem.

All times are GMT -4. The time now is 12:22.