Challenge

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

Aim:

To Simulate the Wedge flow using the Open Foam for Different angles of Wedge and to Capture the Results that

Given Angles

10

25

45

Objective:

To write a program for the generation of the blockMeshdict file or computational mesh for wedge angle and grading scheme

Calculate the length of the pipe using the entry length formulat through the laminar flow through the pipe

Show that the entry length is enough for producing the fully developed flow

Compare the velocity profile at the different lengths of the pipe

We have to show our velocity profile is fully developed

Post process velocity and shear stress

Laminar Flow through a Pipe

Hydrodynamic Length (Le)

Diamter of the Pipe

D=10mm=0.001m

Re=2100

Le=12.6m

Vavg=0.1869m/s

Delta P =32.mu.LV/D^2

Delta P=0.0789 m^2/s

Vmax=2.Vavg

Vmax=0.3738 m/s

Program that Creats blockMesgDict file using Matlab

close all
clc
theta=25; %input('Input the Wedge Angle=');
theta=theta/2;
L=1.5;
d=0.01;
r=d/2;
height_wedge=r*cosd(theta);
width_wedge=r*sind(theta);
b1='/*----------------------*-C++-*----------------------------------*';
b2='=========               |                                         ';  
b3='  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox';
b4='   \\    /   O peration   | Website: https://openfoam.org         ';
b5='    \\  /    A nd             |Version: 7                         ';
b6='     \\/     M anipulation |                                      ';
b7='\*----------------------------------------------------------------';
f1=fopen('blockMeshDict','w');
fprintf(f1,'%s\n',b1);
fprintf(f1,'%s\n',b2);
fprintf(f1,'%s\n',b3);
fprintf(f1,'%s\n',b4);
fprintf(f1,'%s\n',b5);
fprintf(f1,'%s\n',b6);
fprintf(f1,'%s\n',b7);
fprintf(f1,'FoamFile n{ n version 2.0; n format ascii;n class dictionary;n object    blockMeshDict;n}');
b8=('//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *');
fprintf(f1,'n%s n',b8);
fprintf(f1,'nconverToMeters 1;');
fprintf(f1,'nnvertices n(nn');
fprintf(f1,'(0  0  0)');
fprintf(f1,'n(0  0  0');
ver3=zeros(1,3);
ver4=zeros(1,3);
ver3(2)=height_wedge;
ver3(3)=width_wedge;
fprintf(f1,'n(%f %f %f)',ver3);
fprintf(f1,'n(%f %f %f)nn',ver4);
fprintf(f1,'(1.5 0 0 )');
fprintf(f1,'n(1.5 0 0 )');
ver3=zeros(1,3);
ver4=zeros(1,3);
ver3(1)=L;
ver3(2)=height_wedge;
ver3(3)=-width_wedge;
ver4(1)=L;
ver4(2)=height_wedge;
ver4(3)=width_wedge;
fprintf(f1,'n (%d %f %f)',ver3);
fprintf(f1,'n(%d %f %f)n',ver4);
fprintf(f1,'n);nn');
fprintf(f1,'blocksn(n');
fprintf(f1,' hex(0 1 2 3 4 5 6 7 (1 20 100) simpleGrading (1 0.4 1) n); nedges (n);n');
fprintf(f1,'bounadry n(n top n {n typewall; n faces n ( n    (2 3 7 6)n ); n }');
fprintf(f1,'bottom n {n type empty; n  faces n ( n (2 3 7 6)n ); n} ');
fprintf(f1,' frontwedge n { n type wedge;n faces n (n (0 4 7 3)n );n }');
fprintf(f1,'n backwedge n {n type wedge;n faces n (n (1 2 6 5)n );n }');
fprintf(f1,'n inlet n {n type patch; n faces n (n (1 0 3 2)n);}');
fprintf(f1, 'n outlet n{n type patch;n faces n (n (5 6 7 4)n );n}');
fprintf(f1,'n); nmergePatchPairs n(n);');
bp=('//****************************************************//');
fprintf(f1,'nn%s',b9);
fclose(f1);

blockMeshdict file that creats the wedge of angle 10

FoamFile
{
version 2.0;
format  ascii;
class dictionary;
object blockMeshDict;
}
convertToMeters 1;
vertices
(

(0    0   0)
(0    0   0)
(0.00000  0.004981  -0.00436)
(0.00000  0.004981   0.000436)
(1.5    0   0)
(1.5    0   0)
(1.500000e+00   0.004981    -0.000436)
(1.500000e+00   0.004981    0.000436)
);
blocks
(
  hex(0 1 2 3 4 5 6 7)  (1  20  100)  simpleGrading (1  0.4 1)
);
edges
(
);
boundary
(
  top
    {
      type wall;
      faces
     (
        (2  3 7 6)
     );
    }
   bottom
    {
      type empty;
      faces
     (
        (1  5 4 0)
     );
    }
    frontedge
    {
      type wedge;
      faces
     (
        (0  4 7 3)
     );
    }
   backwedge
    {
      type wedge;
      faces
     (
        (1  2 6 5)
     );
    }
    inlet
    {
      type patch;
      faces
     (
        (1 0 3 2)
     );
    }
    outlet
    {
      type patch;
      faces
     (
        (5  6 7 4)
     );
    }
);

blockmeshdict file that creates the wedge angle of 25

FoamFile
{
version 2.0;
format  ascii;
class dictionary;
object blockMeshDict;
}
convertToMeters 1;
vertices
(

(0    0   0)
(0    0   0)
(0.00000  0.004881  -0.001082)
(0.00000  0.004881   0.001082)
(1.5    0   0)
(1.5    0   0)
(1.500000e+00   0.004881    -0.001082)
(1.500000e+00   0.004881    0.001082)
);
blocks
(
  hex(0 1 2 3 4 5 6 7)  (1  20  100)  simpleGrading (1  0.4 1)
);
edges
(
);
boundary
(
  top
    {
      type wall;
      faces
     (
        (2  3 7 6)
     );
    }
   bottom
    {
      type empty;
      faces
     (
        (1  5 4 0)
     );
    }
    frontedge
    {
      type wedge;
      faces
     (
        (0  4 7 3)
     );
    }
   backwedge
    {
      type wedge;
      faces
     (
        (1  2 6 5)
     );
    }
    inlet
    {
      type patch;
      faces
     (
        (1 0 3 2)
     );
    }
    outlet
    {
      type patch;
      faces
     (
        (5  6 7 4)
     );
    }
);

blockmeshdict file that creates the wedge of angle 45

FoamFile
{
version 2.0;
format  ascii;
class dictionary;
object blockMeshDict;
}
convertToMeters 1;
vertices
(

(0    0   0)
(0    0   0)
(0.00000  0.004619  -0.001913)
(0.00000  0.004619   0.001913)
(1.5    0   0)
(1.5    0   0)
(1.500000e+00   0.004619    -0.001913)
(1.500000e+00   0.004619    0.001913)
);
blocks
(
  hex(0 1 2 3 4 5 6 7)  (1  20  100)  simpleGrading (1  0.4 1)
);
edges
(
);
boundary
(
  top
    {
      type wall;
      faces
     (
        (2  3 7 6)
     );
    }
   bottom
    {
      type empty;
      faces
     (
        (1  5 4 0)
     );
    }
    frontedge
    {
      type wedge;
      faces
     (
        (0  4 7 3)
     );
    }
   backwedge
    {
      type wedge;
      faces
     (
        (1  2 6 5)
     );
    }
    inlet
    {
      type patch;
      faces
     (
        (1 0 3 2)
     );
    }
    outlet
    {
      type patch;
      faces
     (
        (5  6 7 4)
     );
    }
);

controldict file

FoamFile
{
  version 2.0;
  format  ascii;
  class dictionary;
  location  "system";
  object  controlDict;
}
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.4;
deltaT  0.0004;
writeControl  timeStep;
writeInterval 20;
purgewrite  0;
writeFormat ascii;
writePrecision  6;
writeCompression  off;
timeFormat  general;
timePrecision 6;
runTimeModifiable true;

velocity boundary file

FoamFile
{
  version 2.0;
  format  ascii;
  class volVectorField
  object  U;
}
dimensions  [0  1 -1  0 0 0 0];
internalField uniform(0.1869   0  0);
boundaryField
{
  inlet
  {
  type  fixedValue;
  value uniform(0.1869  0 0)'
  }
  outlet
  {
  type  symmetry;
  }
  frontwedge
  {
  type  symmetry;
  }
  backwedge
  {
  type  symmetry;
  }
  top
  {
  type  noSlip;
  }
  bottom
  {
  type  emmpty;
  }
}

pressure boundary file

FoamFile
{
  version 2.0;
  format  ascii;
  class volVectorField
  object  p;
}
dimensions  [0  2 -2  0 0 0 0];
internalField uniform 0;
boundaryField
{
  inlet
  {
  type  zeroGradient;
  }
  outlet
  {
  type  fixedValue;
  value uniform 0;
  }
  frontwedge
  {
  type  symmetry;
  }
  backwedge
  {
  type  symmetry;
  }
  top
  {
  type  zeroGradient;
  }
  bottom
  {
  type  emmpty;
  }
}

transport properties file

FoamFile
{
  version 2.0;
  format  ascii;
  class dictionary;
  location  "constant";
  object  transportProperties;
}
nu  [0  2 -1  0 0 0 0]0.001;

Results tabulated for the wedge angle of 10 degrees

creating the mesh using grading factor 0.4 along with the height of the wedge for wedge angle 10 degrees

Results tabulated for wedge angle of 25 degress

creating the mesh using the grading factor 0.4 along with the height og the wedge for wedge angle 25 degrees

velocity profile

pressure profiel

velocity curve

fully developed velocity curve

shear stress curve

Results tabulated for wedge angle of 45 degrees

creating the mesh using the grading factor 0.4 along with the height og the wedge for wedge angle 45 degrees

velocity profile

pressure profiel

velocity curve

fully developed velocity curve

shear stress curve

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.