CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to use directed-mapped boundry condition (https://www.cfd-online.com/Forums/openfoam-solving/128608-how-use-directed-mapped-boundry-condition.html)

zqlhzx January 16, 2014 13:06

how to use directed-mapped boundry condition
 
2 Attachment(s)
Hi foamers,
I want to simulated a regular pipe with a interface in the middle of the geometry.The length(X-direction) is 200mm,heigh(Y-direction) is 50mm and wide(Z-direction) is 50mm.The interface is at the location of the length is 100mm.Both domains are fluid and one is named fluid1 and another is named fluid2.The number is (50 25 25 ).So the interface is named fluid1_to_fluid2 and fluid2_to_fluid1.
This is my geometry.
Attachment 28025
The solve I used is modified from chtmulRegionFoam with solid(OF2.0.1)!
The case can be run ,but the result is strange for me ,and it is wrong.
Attachment 28026
The vilocity is clearly wrong at the middle cell(near the interface).I think I define the wrong U boundry of the interface.
Please see my blockMeshDict,U boundry of fluid1 and fluid2.
blockMeshDict:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (-0.1 -0.05  -0.05)
    ( 0.1 -0.05  -0.05)
    ( 0.1  0.05  -0.05)
    (-0.1  0.05  -0.05)
    (-0.1 -0.05  0.05)
    ( 0.1 -0.05  0.05)
    ( 0.1  0.05  0.05)
    (-0.1  0.05  0.05)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (50 25 25) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    topwall
    {
        type wall;
        faces
        (
            (3 7 6 2)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 4 7 3)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (2 6 5 1)
        );
    }
    bottomwall
    {
        type wall;
        faces
        (
            (1 5 4 0)
        );
    }
    minZ
    {
        type wall;
        faces
        (
            (0 3 2 1)
        );
    }
    maxZ
    {
        type wall;
        faces
        (
            (4 5 6 7)
        );
    }
);

mergePatchPairs
(
);

boundry of fluid1(domain 1)
Code:

6
(
    topwall
    {
        type            wall;
        nFaces          625;
        startFace      45000;
    }
    inlet
    {
        type            patch;
        nFaces          625;
        startFace      45625;
    }
    bottomwall
    {
        type            wall;
        nFaces          625;
        startFace      46250;
    }
    minZ
    {
        type            wall;
        nFaces          625;
        startFace      46875;
    }
    maxZ
    {
        type            wall;
        nFaces          625;
        startFace      47500;
    }
    fluid1_to_fluid2
    {
        type            directMappedWall;
        nFaces          625;
        startFace      48125;
        sampleMode      nearestPatchFace;
        sampleRegion    fluid2;
        samplePatch    fluid2_to_fluid1;
        offsetMode      uniform;
        offset          (0.002 0 0);
    }
)

boundry of fluid2(domain 2)
Code:

6
(
    topwall
    {
        type            wall;
        nFaces          625;
        startFace      45000;
    }
    outlet
    {
        type            patch;
        nFaces          625;
        startFace      45625;
    }
    bottomwall
    {
        type            wall;
        nFaces          625;
        startFace      46250;
    }
    minZ
    {
        type            wall;
        nFaces          625;
        startFace      46875;
    }
    maxZ
    {
        type            wall;
        nFaces          625;
        startFace      47500;
    }
    fluid2_to_fluid1
    {
        type            directMappedWall;
        nFaces          625;
        startFace      48125;
        sampleMode      nearestPatchFace;
        sampleRegion    fluid1;
        samplePatch    fluid1_to_fluid2;
        offsetMode      uniform;
        offset          (-0.002 0 0);
    }
)

U boundry for fluid1
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            turbulentInlet;
        referenceField  uniform (10 0 0);
        fluctuationScale (0.2 0.1 0.1);
        value          uniform (10 0 0);
    }

    fluid1_to_fluid2 
    {
        type            zeroGradient;
    }

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

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

    minZ
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    maxZ
  {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}

U boundry for fluid2
Code:

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
      outlet
        {
              type            inletOutlet;
              inletValue      uniform (0 0 0);
              value          uniform (0 0 0);
        }
   
        fluid2_to_fluid1 
        {
                  type            directMapped;
              value          uniform (0 0 0);
              setAverage      true;
                  average        (10 0 0);
        }
   
        topwall
        {
            type            fixedValue;
            value          uniform (0 0 0);
        }
   
        bottomwall
        {
            type            fixedValue;
            value          uniform (0 0 0);
        }
   
        minZ
        {
            type            fixedValue;
            value          uniform (0 0 0);
        }
        maxZ
      {
            type            fixedValue;
            value          uniform (0 0 0);
      }
}

Did I set the right boundry for interface?How can I solve my problem?Please onesome can give me some advices!After running th case successly,I will solve turbulent flow in the fluid1 and solve combustion in the fluid1.Now it is my first step!


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