Challenge

Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation

Aim:

To simulate by applying Symmetry Boundary Condition. You will do the simulation for the below mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations.

Angles to test:

  • 10o
  • 25o
  • 45o

Objective:

we have to find the below required results

  1. Validate Hydro-dynamic length with the numerical result
  2. Validate the fully developed flow velocity profile with its analytical profile
  3. Validate maximum velocity and pressured drop for fully developed flow
  4. Post-process Shear stress and validate wall shear stress for fully developed flow
  5. Highligh the differences in both boundary conditions in terms of their usage and aplication

Symmetry 10 Blockmesh:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// blockMesh parameterization   

/* Geometrical Info */

D	0.004;                      // Diameter 
r #calc "0.5*$D";                   // Radius
angle	10;                          // Angle in degrees
theta   #calc "degToRad($angle)";   // Angle in radians
Re 100;          		    // Reynolds Number
Le #calc "0.06*$Re*$D";             // Entrance Length
L  #calc "0.2 + $Le";		    // Total length of pipe

/* Vertices Info */

xmin	0;    
xmax	$L;   
ymax	#calc "$r*cos($theta)";
zmax	#calc "$r*sin($theta)";
zmin    #calc "-$r*sin($theta)";

curve #calc "$r*cos($theta)+1e-4"; 

/* Mesh Info */

nx	10;	// Cells along local X  
ny	1;	// Cells along local Y  
nz	50;	// Cells along local Z  
gx	0.2;	// SG along local X  
gy	1;	// SG along local Y
gz	1;	// SG along local Z 


convertToMeters 1;

vertices
(
    ($xmin 0 0)		 //0
    ($xmin $ymax $zmax)	 //1
    ($xmin $ymax $zmin)	 //2
    ($xmax 0 0)		 //3
    ($xmax $ymax $zmax)	 //4
    ($xmax $ymax $zmin)	 //5

);

blocks
(
    hex (0 2 1 0 3 5 4 3) ($nx $ny $nz) simpleGrading ($gx $gy $gz)
);

edges
(
    arc 1 2 ($xmin $curve 0)
    arc 4 5 ($xmax $curve 0)
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (3 5 4 3)
        );
    }
    front
    {
        type symmetry;
        faces
        (
            (0 3 4 1)
        );
    } 
    back
    {
        type symmetry;    // symmetry
        faces
        (
            (0 2 5 3)
        );
    } 
    wall
    {
        type wall;    // symmetry
        faces
        (
            (2 1 4 5)
        );
    } 
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }     
    
);

mergePatchPairs
(
);

// ************************************************************************* //

Controldict symmetry 10:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.001;

writeControl    timeStep;

writeInterval   500;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


// ************************************************************************* //

symmetry 10 pressure:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
	type            zeroGradient;
    }

    outlet
    {
        
        type            fixedValue;
        value           uniform 0;       
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            zeroGradient;
    }   
    
    axis
    {
        type            empty;
    }
}

// ************************************************************************* //

symmetry 10 velocity:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.0223169508525577 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            noSlip;
    }   
    
    axis
    {
        type            empty;
    }
    
}

// ************************************************************************* //

Transport properties:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 8.9267803410231e-07;


// ************************************************************************* //

Symmetry 25 blockmesh:

Controldict symmetry 25:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.001;

writeControl    timeStep;

writeInterval   500;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


// ************************************************************************* //

Pressure symmetry 25:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
	type            zeroGradient;
    }

    outlet
    {
        
        type            fixedValue;
        value           uniform 0;       
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            zeroGradient;
    }   
    
    axis
    {
        type            empty;
    }
}

// ************************************************************************* //

Velocity symmetry 25:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.0223169508525577 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            noSlip;
    }   
    
    axis
    {
        type            empty;
    }
    
}

// ************************************************************************* //

Symmetry 25 transport properties:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 8.9267803410231e-07;


// ************************************************************************* //

Symmetry 45 blockmesh:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// blockMesh parameterization   

/* Geometrical Info */

D	0.004;                      // Diameter 
r #calc "0.5*$D";                   // Radius
angle	45;                          // Angle in degrees
theta   #calc "degToRad($angle)";   // Angle in radians
Re 100;          		    // Reynolds Number
Le #calc "0.06*$Re*$D";             // Entrance Length
L  #calc "0.2 + $Le";		    // Total length of pipe

/* Vertices Info */

xmin	0;    
xmax	$L;   
ymax	#calc "$r*cos($theta)";
zmax	#calc "$r*sin($theta)";
zmin    #calc "-$r*sin($theta)";
curve #calc "$r*cos($theta)+1e-4"; 
 

/* Mesh Info */

nx	10;	// Cells along local X  
ny	1;	// Cells along local Y  
nz	50;	// Cells along local Z  
gx	0.2;	// SG along local X  
gy	1;	// SG along local Y
gz	1;	// SG along local Z 


convertToMeters 1;

vertices
(
    ($xmin 0 0)		 //0
    ($xmin $ymax $zmax)	 //1
    ($xmin $ymax $zmin)	 //2
    ($xmax 0 0)		 //3
    ($xmax $ymax $zmax)	 //4
    ($xmax $ymax $zmin)	 //5

);

blocks
(
    hex (0 2 1 0 3 5 4 3) ($nx $ny $nz) simpleGrading ($gx $gy $gz)
);

edges
(
    arc 1 2 ($xmin $curve 0)
    arc 4 5 ($xmax $curve 0)
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (3 5 4 3)
        );
    }
    front
    {
        type symmetry;
        faces
        (
            (0 3 4 1)
        );
    } 
    back
    {
        type symmetry;    // symmetry
        faces
        (
            (0 2 5 3)
        );
    } 
    wall
    {
        type wall;    // symmetry
        faces
        (
            (2 1 4 5)
        );
    } 
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }     
    
);

mergePatchPairs
(
);

// ************************************************************************* //

Control dict symeetry 45:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.001;

writeControl    timeStep;

writeInterval   500;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


// ************************************************************************* //

Pressure symmetry 45:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
	type            zeroGradient;
    }

    outlet
    {
        
        type            fixedValue;
        value           uniform 0;       
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            zeroGradient;
    }   
    
    axis
    {
        type            empty;
    }
}

// ************************************************************************* //

Velocity symmetry 45:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.0223169508525577 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    front
    {
        type            symmetry;   // symmetry
    }
    
    back
    {
        type            symmetry;   // symmetry
    }  
 
    wall
    {
        type            noSlip;
    }   
    
    axis
    {
        type            empty;
    }
    
}

// ************************************************************************* //

symmetry 45 transport properties:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 8.9267803410231e-07;


// ************************************************************************* //

symmetry 10 image:

pressure symmetry image:

Mesh image:

symmetry 10 velocity plot:

symmetry 10 shear stress comparision:

pressure image:

velocity symmetry 25:

symmetry 25 mesh image:

Velocity plot symmetry 25:

shear stress comparision plot:

symmetry 45 velocity:

symmetry 45 pressure :

symmetry 45 mesh image:

symmetry 45 velocity plot:

symmetry 45 shear stress:

shear stress symmetry 45 comparision plot:

Conclution :

Finally we canclude the validate Hydro-dynamic length with the numerical result and validate the fully developed flow velocity profile with its analytical profile next validate maximum velocity and pressured drop for fully developed flow then post-process Shear stress and validate wall shear stress for fully developed flow and then highligh the differences in both boundary conditions in terms of their usage and aplication.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.