Challenge

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

Objective -

Perform simulation for the below mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations like you did in week 11 challenge.

Angles to test:

  • `10^o`
  • `25^o`
  • `45^o`

Expected 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

Calculation of endTime -

This an important parameter to follow in the simulation process. So that, Fluid flow compeletes through entire section of the pipe length.

We know that,

Time = Distance/Velocity

L - length of pipe from inlet to outlet=2.6 m

v_avg- Velocity=0.0937 m/s

Time=27.748 sec

Total time required = 55.496 sec ~56 sec

Code -

MatLab Wedge Condition -

clear all
close all
clc

%Given Data for Analysis
Re=2100; %Reynolds Number
mu=input("Enter Dynamic Viscosity of watern")
rho=input("Enter Density of watern")
d=input("Enter Diameter of pipen")
theta=input("Enter Wedge Angle for pipen")  %Wgde Andle should be <5 Degrees
  

%Entry Lenght of pipe
Le=d*(0.05*Re)
%Actual lenght of pipe
L=0.5+Le
R=d/2   %Radius of pipe
v_avg=(Re*mu)/(rho*d) %average velocity
v_max=2*v_avg  % maximium velocity
T_wall=4*((mu*v_avg)/R)
dp=(32*mu*v_avg)/((d)^2)
nu=mu/rho %Nuseltte Number
r=linspace(0,R,300);
v=v_max*(1-(r.^2./R^2));

plot(r,v,'linewidth',2)
xlabel('radius')
ylabel('velocity')
title('velocity profile at fully developed region')


%-------------------------------------------------------------------------------------------------------------------------------
%%writting the header part for BlockMeshDict File in Matlab
h1='/*--------------------------------*- C++ -*----------------------------------*';
h2='  =========                 |';
h3='        /  F ield         | OpenFOAM: The Open Source CFD Toolbox';
h4='       /   O peration     | Website:  https://openfoam.org';
h5='      /    A nd           | Version:  8';
h6='     /     M anipulation  |';
h7='*---------------------------------------------------------------------------*/';
h8='FoamFile';
h9='{';
h10='    version     2.0;';
h11='    format      ascii;';
h12='    class       dictionary;';
h13='    object      blockMeshDict;';
h14='}';
h15='// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';
h16='// ************************************************************************* //';

conv='convertToMeters 1;';
v0=[0 0 0];
v1=[L 0 0];
v2=[L R*cosd(theta/2) R*sind(theta/2)];
v3=[0 R*cosd(theta/2) R*sind(theta/2)];
v4=[0 R*cosd(theta/2) -R*sind(theta/2)];
v5=[L R*cosd(theta/2) -R*sind(theta/2)];

block='hex (0 1 5 4 0 1 2 3) (500 20 1) simpleGrading (1 0.01 1)';
inlet='(0 1 2 0)';
outlet='(1 5 2 1)';
top='3 2 5 4';
front='0 1 2 3';
back='0 4 5 1';
axis='0 1 1 0';
s1=blanks(4);
s2=blanks(7);
s3=blanks(11);
s4=blanks(3);


%Generating blockMeshDict File
f1=fopen('blockMeshDict.txt','w');
fprintf(f1,'%sn',h1);
fprintf(f1,'%sn',h2);
fprintf(f1,'%sn',h3);
fprintf(f1,'%sn',h4);
fprintf(f1,'%sn',h5);
fprintf(f1,'%sn',h6);
fprintf(f1,'%sn',h7);
fprintf(f1,'%sn',h8);
fprintf(f1,'%sn',h9);
fprintf(f1,'%sn',h10); 
fprintf(f1,'%sn',h11); 
fprintf(f1,'%sn',h12);
fprintf(f1,'%sn',h13); 
fprintf(f1,'%sn',h14); 
fprintf(f1,'%sn',h15);
fprintf(f1,'n');

fprintf(f1,'%sn',conv);
fprintf(f1,'n');

fprintf(f1,'%sn','vertices');
fprintf(f1,'%sn','(');
fprintf(f1,'%s(%d %d %d)n',s1,v0(1),v0(2),v0(3));
fprintf(f1,'%s(%d %d %d)n',s1,v1(1),v1(2),v1(3));
fprintf(f1,'%s(%d %d %d)n',s1,v2(1),v2(2),v2(3));
fprintf(f1,'%s(%d %d %d)n',s1,v3(1),v3(2),v3(3));
fprintf(f1,'%s(%d %d %d)n',s1,v4(1),v4(2),v4(3));
fprintf(f1,'%s(%d %d %d)n',s1,v5(1),v5(2),v5(3));
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','blocks');
fprintf(f1,'%sn','(');
fprintf(f1,'%s%sn',s4,block);
fprintf(f1,'n');
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','edges');
fprintf(f1,'%sn','(');
fprintf(f1,'%s %s %d %d(%d %d %d)n',s4,'arc',3,4,0,R,0);
fprintf(f1,'%s %s %d %d(%d %d %d)n',s4,'arc',2,5,L,R,0);
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','boundary');
fprintf(f1,'%sn','(');

fprintf(f1,'%s %sn',s4,'inlet');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type patch;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,3,4,0);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'outlet');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type patch;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,1,5,2,1);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'top');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type wall;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,3,2,5,4);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'front');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type wedge;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,1,2,3);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'back');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type wedge;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,4,5,1);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'axis');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type empty;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,1,1,0);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');
fprintf(f1,'%sn',s2,');');
fprintf(f1,'n');
fprintf(f1,'%sn','mergePatchPairs');
fprintf(f1,'%sn','(');
fprintf(f1,'%sn',');');

fprintf(f1,'%sn',h16);
fclose(f1);
%---------------------------------------------------------------------------------------------------------------------------

BlockMeshDict file -

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

convertToMeters 1;

vertices
(
    (0 0 0)
    (2.600000e+00 0 0)
    (2.600000e+00 9.762960e-03 2.164396e-03)
    (0 9.762960e-03 2.164396e-03)
    (0 9.762960e-03 -2.164396e-03)
    (2.600000e+00 9.762960e-03 -2.164396e-03)
);

blocks
(
   hex (0 1 5 4 0 1 2 3) (500 20 1) simpleGrading (1 0.01 1)

);

edges
(
    arc 3 4(0 1.000000e-02 0)
    arc 2 5(2.600000e+00 1.000000e-02 0)
);

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

mergePatchPairs
(
);
// ************************************************************************* //

ControlDict file -

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

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         56;

deltaT          0.005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

U-

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

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

internalField   uniform (0.11 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.11 0 0);
    }
    
    outlet
    {
        type            zeroGradient;
    }
    
    front
    {
        type            wedge;
    }
    
    back
    {
        type            wedge;
    }

    top
    {
        type            noSlip;
    }

    axis
    {
        type            empty;
    }
    
}

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

p-

/*--------------------------------*- C++ -*----------------------------------*
  =========                 |
        /  F ield         | OpenFOAM: The Open Source CFD Toolbox
       /   O peration     | Website:  https://openfoam.org
      /    A nd           | Version:  8
     /     M anipulation  |
*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    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            wedge;
    }
    
    back
    {
        type            wedge;
    }
    
    top
    {
        type            zeroGradient;
    }
    
    axis
    {
        type            empty;
    }
}
// ************************************************************************* //

transportProperties -

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

nu              [0 2 -1 0 0 0 0] 8.97e-7;


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

Geometry Generated -

Analytical Velocity Profile -

Simulation Results for wedge boundary condition -

At `theta=10^o`

At `theta=25^o`

At `theta=45^o`

MatLab code for Symmetry Condition -

clear all
close all
clc

%Given Data for Analysis
Re=2100; %Reynolds Number
mu=input("Enter Dynamic Viscosity of watern")
rho=input("Enter Density of watern")
d=input("Enter Diameter of pipen")
theta=input("Enter Wedge Angle for pipen")  %Wgde Andle should be <5 Degrees
  

%Entry Lenght of pipe
Le=d*(0.05*Re)
%Actual lenght of pipe
L=0.5+Le
R=d/2   %Radius of pipe
v_avg=(Re*mu)/(rho*d) %average velocity
v_max=2*v_avg  % maximium velocity
T_wall=4*((mu*v_avg)/R)
dp=(32*mu*v_avg)/((d)^2)
nu=mu/rho %Nuseltte Number
r=linspace(0,R,300);
v=v_max*(1-(r.^2./R^2));



%-------------------------------------------------------------------------------------------------------------------------------
%%writting the header part for BlockMeshDict File in Matlab
h1='/*--------------------------------*- C++ -*----------------------------------*';
h2='  =========                 |';
h3='        /  F ield         | OpenFOAM: The Open Source CFD Toolbox';
h4='       /   O peration     | Website:  https://openfoam.org';
h5='      /    A nd           | Version:  8';
h6='     /     M anipulation  |';
h7='*---------------------------------------------------------------------------*/';
h8='FoamFile';
h9='{';
h10='    version     2.0;';
h11='    format      ascii;';
h12='    class       dictionary;';
h13='    object      blockMeshDict;';
h14='}';
h15='// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';
h16='// ************************************************************************* //';

conv='convertToMeters 1;';
v0=[0 0 0];
v1=[L 0 0];
v2=[L R*cosd(theta/2) R*sind(theta/2)];
v3=[0 R*cosd(theta/2) R*sind(theta/2)];
v4=[0 R*cosd(theta/2) -R*sind(theta/2)];
v5=[L R*cosd(theta/2) -R*sind(theta/2)];

block='hex (0 1 5 4 0 1 2 3) (500 30 1) simpleGrading (1 0.01 1)';
inlet='(0 1 2 0)';
outlet='(1 5 2 1)';
top='3 2 5 4';
front='0 1 2 3';
back='0 4 5 1';
axis='0 1 1 0';
s1=blanks(4);
s2=blanks(7);
s3=blanks(11);
s4=blanks(3);


%Generating blockMeshDict File
f1=fopen('blockMeshDict.txt','w');
fprintf(f1,'%sn',h1);
fprintf(f1,'%sn',h2);
fprintf(f1,'%sn',h3);
fprintf(f1,'%sn',h4);
fprintf(f1,'%sn',h5);
fprintf(f1,'%sn',h6);
fprintf(f1,'%sn',h7);
fprintf(f1,'%sn',h8);
fprintf(f1,'%sn',h9);
fprintf(f1,'%sn',h10); 
fprintf(f1,'%sn',h11); 
fprintf(f1,'%sn',h12);
fprintf(f1,'%sn',h13); 
fprintf(f1,'%sn',h14); 
fprintf(f1,'%sn',h15);
fprintf(f1,'n');

fprintf(f1,'%sn',conv);
fprintf(f1,'n');

fprintf(f1,'%sn','vertices');
fprintf(f1,'%sn','(');
fprintf(f1,'%s(%d %d %d)n',s1,v0(1),v0(2),v0(3));
fprintf(f1,'%s(%d %d %d)n',s1,v1(1),v1(2),v1(3));
fprintf(f1,'%s(%d %d %d)n',s1,v2(1),v2(2),v2(3));
fprintf(f1,'%s(%d %d %d)n',s1,v3(1),v3(2),v3(3));
fprintf(f1,'%s(%d %d %d)n',s1,v4(1),v4(2),v4(3));
fprintf(f1,'%s(%d %d %d)n',s1,v5(1),v5(2),v5(3));
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','blocks');
fprintf(f1,'%sn','(');
fprintf(f1,'%s%sn',s4,block);
fprintf(f1,'n');
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','edges');
fprintf(f1,'%sn','(');
fprintf(f1,'%s %s %d %d(%d %d %d)n',s4,'arc',3,4,0,R,0);
fprintf(f1,'%s %s %d %d(%d %d %d)n',s4,'arc',2,5,L,R,0);
fprintf(f1,'%sn',');');
fprintf(f1,'n');

fprintf(f1,'%sn','boundary');
fprintf(f1,'%sn','(');

fprintf(f1,'%s %sn',s4,'inlet');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type patch;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,3,4,0);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'outlet');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type patch;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,1,5,2,1);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'top');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type wall;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,3,2,5,4);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'front');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type symmetry;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,1,2,3);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'back');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type symmetry;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,4,5,1);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');

fprintf(f1,'%s %sn',s4,'axis');
fprintf(f1,'%s %sn',s4,'{');
fprintf(f1,'%s %sn',s2,'type empty;');
fprintf(f1,'%s %sn',s2,'faces');
fprintf(f1,'%s %sn',s2,'(');
fprintf(f1,'%s (%d %d %d %d)n',s3,0,1,1,0);
fprintf(f1,'%s %sn',s2,');');
fprintf(f1,'%s %sn',s4,'}');
fprintf(f1,'%sn',s2,');');
fprintf(f1,'n');
fprintf(f1,'%sn','mergePatchPairs');
fprintf(f1,'%sn','(');
fprintf(f1,'%sn',');');

fprintf(f1,'%sn',h16);
fclose(f1);
%---------------------------------------------------------------------------------------------------------------------------

ControlDict-

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

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         56;

deltaT          0.005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

BlockMeshDict File -

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

convertToMeters 1;

vertices
(
    (0 0 0)
    (2.600000e+00 0 0)
    (2.600000e+00 9.238795e-03 3.826834e-03)
    (0 9.238795e-03 3.826834e-03)
    (0 9.238795e-03 -3.826834e-03)
    (2.600000e+00 9.238795e-03 -3.826834e-03)
);

blocks
(
   hex (0 1 5 4 0 1 2 3) (500 30 1) simpleGrading (1 0.01 1)

);

edges
(
    arc 3 4(0 1.000000e-02 0)
    arc 2 5(2.600000e+00 1.000000e-02 0)
);

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

mergePatchPairs
(
);
// ************************************************************************* //

U-

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

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

internalField   uniform (0.0937 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.0937 0 0);
    }
    
    outlet
    {
        type            zeroGradient;
    }
    
    front
    {
        type            symmetry;
    }
    
    back
    {
        type            symmetry;
    }

    top
    {
        type            noSlip;
    }

    axis
    {
        type            empty;
    }
    
}

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

p-

/*--------------------------------*- C++ -*----------------------------------*
  =========                 |
        /  F ield         | OpenFOAM: The Open Source CFD Toolbox
       /   O peration     | Website:  https://openfoam.org
      /    A nd           | Version:  8
     /     M anipulation  |
*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    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;
    }
    
    back
    {
        type            symmetry;
    }
    
    top
    {
        type            zeroGradient;
    }
    
    axis
    {
        type            empty;
    }
}
// ************************************************************************* //

TransportProperties -

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

nu              [0 2 -1 0 0 0 0] 8.97e-7;


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

Analytical Velocity Profile for Fully Developed region of pipe -

Simulation Results obtained for symmetry boundary condition -

At `theta=10^o`

At `theta=25^o`

At `theta=45^o`

Validation -

Wedge Condition

Parameters Analytical Solution Numerical Solution
V_max 0.1875 0.2021
Velocity Profile Parabolic Parabolic
Le 2.1m 2.5
T_Wall @ `theta=10^o` 0.0334 0.0416
@ `theta=25^o` 0.04217
@ `theta=45^o` 0.04322

Symmetry Condition

Parameters Analytical Solution Numerical Solution
V_max @ `theta=10^o` 0.1875 0.1765
@ `theta=25^o` 0.1732
@ `theta=45^o` 0.1797
Velocity Profile Parabolic Parabolic
Le 2.1m 2.5
T_Wall @ `theta=10^o` 0.0334 0.03466
@ `theta=25^o` 0.03533
@ `theta=45^o` 0.03708

Conclusion -

  • Wedge boundary condition works really fine with theta of small angles, ideally with angles while simulating in OpenFoam `theta<5^o`.
  • Whereas incase of symmetry condition the results tends to be better when increase in theta.
  • Both the condition are different in nature, its just that the user needs to know how to use them accordingly.
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.

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.