CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

how to use directed-mapped boundry condition

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2014, 14:06
Default how to use directed-mapped boundry condition
  #1
Member
 
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 12
zqlhzx is on a distinguished road
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.
geometry.jpg
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.
Time 0.005.jpg
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!
zqlhzx is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access cell volume from boundry condition JimKnopf OpenFOAM Programming & Development 2 March 10, 2011 05:29
Help:something about boundry condition bright181 Fluent UDF and Scheme Programming 1 January 5, 2011 10:11
query about boundry condition for energy equation jugal44j FLUENT 0 December 4, 2010 05:53
wall boundry condition fred FLUENT 0 August 19, 2004 13:10
Temperature rise at a boundry condition Rodrigo FLUENT 5 August 3, 2001 11:04


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