CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   mapped boundary condition (http://www.cfd-online.com/Forums/openfoam/101669-mapped-boundary-condition.html)

samiam1000 May 10, 2012 07:03

mapped boundary condition
 
Dear Foamers,

what about the mapped BC? How can I set them? Where can I find an example? Do you think they are good for fixing the patch where I do have 2 different fluid regions?

Thanks a lot,
Samuele.

latvietis May 14, 2012 22:19

I'm actually also looking for some kind of tutorial/example. Any luck finding one?

Martin

samiam1000 May 15, 2012 02:45

Hi Martin,

if you agree we can collaborate in order to get something useful.

Please, write me an email and we'll discuss the problem (if you want, of course): samuele.zampini@gmail.com

Have a good day,
Samuele

latvietis May 21, 2012 06:39

Greetings!

I actually found solution to my problem. Maybe this will give some hint where to start looking.

Firstly, I did search in OpenFOAM tutorials and

Code:

openfoam210/tutorials/incompressible/pisoFoam/les/pitzDailyMapped
was my starting point.

Then read .H file, that gives some basic knowladge http://foam.sourceforge.net/docs/cpp/a05692_source.htmlAlso, did a little search in forums and in the end I came up with revelation that it isn't that difficult. So, what worked for me was that I had to edit only 2 files - boundary and field file.

I opened "constant/polyMesh/bounadry"

Code:

   
patch1
    {
        type            patch;
        nFaces          3044;
        startFace      2260730;
    }

and edited it to

Code:

    patch1
    {
        type            mappedPatch;
        nFaces          3044;
        startFace      2260730;
        sampleMode      nearestPatchFace;
        samplePatch    patch1a;
        offsetMode      uniform;
        offset          (0 0 0);
    }

then went to "0/field_I_want_to_map"

Code:

    patch1
    {
        type                fixedValue;
        value              uniform (0 0 0);
    }

and edited to

Code:

    patch1
    {
        type                mapped;
        value              uniform (0 0 0);
        interpolationScheme cell;
        setAverage          false;
        average            (0 0 0);
    }

and it worked. At least I believe it did. I still have questions to all Foamers out there since there are things I want to understand to be sure about the result I achieved.

1) What is the meaning of 'offset'?

Code:

        offsetMode      uniform;
        offset          (0 0 0);

2) What is the meaning of 'averaging' something?

Code:

        setAverage          false;
        average            (0 0 0);

Yours,
Martin

Linse May 30, 2012 06:36

Concerning the "offset":
If I am not totally mistaken on this, "offset" gives the distance from the actual boundary where the mapping get's its data.
So if there is boundary A set with an offset of 0.001 it will get the value to map from B in a distance of 0.001 from A. If you set offset to -0.5, A will get the value from C 0.5 upstream of A.

C----(0.5)-------A-(0.001)-B

In case I am wrong on that, please anybody correct me!

For the average thing I do have many speculations, but nothing I would write in here....


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