## COMPARISON OF WEDGE BOUNDARY CONDITION WITH SYMMETRIC BOUNDARY CONDITION AND HAIGEN-POISEUILLE EQUATION

AIM:- IN THIS PROJECT SIMULATION IS DONE ON THE FLUID FLOW THROUGH PIPE USING OPENFOAM SOFTWARE AND MATLAB . THE TOPIC GIVEN BELOW IS COVERED IN THIS                      PROJECT.

• TO MAKE A PROGRAM IN MATLAB THAT CAN GENERATE MESH AUTOMATICALLY FOR ANY WEDGE ANGLE AND GRADING SCHEME FOR SYMMETRIC BOUNDARY CONDITION.
• TO SHOW ENTRY LENGTH IS SUFFICIENT TO PRODUCE VELOCITY PROFILE.
• TO CALCULATE  THE LENGTH OF PIPE USING MATLAB PROGRAM BY ENTRY LENGTH FORMULA .
• TO GENERATE FULLY DEVELOP VELOCITY PROFILE AND MATCH WITH HAIGEN-POISEUILLE EQUATION.
• TO ALSO OBTAIN ACTUAL VELOCITY PROFILE AND SHEAR STRESS FROM POISEUILLE LAW.
• TO POST PROCESS VELOCITY AND SHEAR STRESS AND AND  MAKE COMPARISON WITH HAIGEN-POISEUILLE EQUATION.
• TO COMPARE THE POST-PROCESSED RESULT BETWEEN WEDGE BOUNDARY CONDITION, SYMMETRIC BOUNDARY CONDITION AND HAIGEN-POISUILLE EQUATION

ASSUMPTIONS:-

• SYMMETRIC ANGLE FOR PIPE IS TAKEN AS 10,25,45 DEGREE.
• NUMBER OF CELLS ALONG "AXI SYMMETRIC".
• CALCULATION OF LENGTH OF PIPE THROUGH  ENTRY LENGTH FORMULA.
• TEMPERATURE CONSIDERED 4 DEGREE CELCIUS(4^o C).
• ICOFOAM SOLVER FOR POST PROCESSING.
• TIME FOR SIMULATION IS TAKEN 15 SECONDS.

DATA ASSUMPTION FOR SIMULATION:-

• KINEMATIC VISCOSITY=1.3E-6m^2s^-1.
• DYNAMIC VISCOSITY=0.0013 Pa.s
• REYNOLDS NUMBER=2100.

IN THIS PROJECT, I HAVE MADE SIMULATION ON FLOW(MOTION) OF FLUID THROUGH AN OPEN PIPE USING OPENFOAM SOFTWARE .

IN THIS, I HAVE CONSIDERED AN OPEN PIPE IN WHICH THERE IS INLET FOR FLUID FROM ONE END AND OUTLET FROM OTHER END. WE HAVE ALSO CONSIDERED THE CIRCULAR EDGE OF PIPE AS NOSLIP WALL WHICH MAKES VELOCITY AT THERE ZERO SUCH THAT THE VELOCITY PROFILE OBTAINED FROM SIMULATION CAN BE SAME AS OBTAINED FROM HAIGEN-POISEUILLE EQUATION.

HERE THE REYNOLDS NUMBER FOR VELOCITY IS TAKEN AS 2100 WHICH MAKES IT LAMINAR FLOW AND PROVIDES ADVANTAGE OF FINDING OUT THE ENTRY LENGTH FOR PIPE.

ENTRY LENGTH OF PIPE=0.06*R_e , WHERE ENTRY LENGTH IS DEFINED AS TOTAL LENGTH TRAVELLED BY THE FLUID BEFORE BECOMING FULLY DEVELOPED(VELOCITY PROFILE) IN THE PIPE.

HERE BOUNDARY CONDITION IS TAKEN AS SYMMETRIC BOUNDARY CONDITION.

HERE IS VELOCITY PROFILE DIFFERENCE BETWEEN LAMINAR FLOW (UNIFORM OR NON-UNIFORM) AND TURBULENT FLOW .

THE ENTRY LENGTH HELPS IN FINDIND OUT THE MAXIMUM VELOCITY OF FLUID FLOWING THROUGH PIPE AT PARTICULAR LOCATION DUE TO WHICH WE ARE ALSO ABLE PREDICT THE AVERAGE VELOCITY OF FLUID.

THE VELOCITY PROFILE HELPS IN FINDING OUT THE NATURE OF FLUID THROUGH FLOWING THROUGH PIPE. SO IN ORDER TO FIND THE NATURE OF FLUID AND SHEAR STRESS DUE TO MOTION OF FLUID, I HAVE DONE SIMULATION HERE.

FORMULA FOR VELOCITY PROFILE IS DEFINED AS :-

v=-1/(4mu)(delp)/(delx)(R^2-r^2).

IT FORMULA PROVES THAT VELOCITY IS MAXIMUM AT CENTRE OF PIPE AND MINIMUM AT EDGE OF PIPE.

(delp)/(delx)=-(8*mu*u)/R^2

THIS FORMULA IS ALSO KNOWN AS "HAIGEN-POISEUILLE'S LAW".

MATLAB PRGRAM:-

PROGRAM SCRIPTED IN MATLAB SO THAT IT CAN AUTOMATICALLY GENERATE MESH FOR ANY WEDGE ANGLE AND GRADING SCHEME FOR ANY GEOMETRY IN OPENFOAM.

clear all
close all
clc

% data for analysis of flow:-

rey_no=2100;  %% reynolds number describing the type of flow

rho=input("give density of water\t")

mu=input("give dynamic viscosity of water\t")

d=input("give diameter of the pipe (in meter)\t")

theta=input("give wedge angle for pipe\t")

%% ENTRY LENGTH OF PIPE:-

l_e=d*(0.06*rey_no);

%% Actual length of pipe:-
l=0.5+l_e;

% BOUNDARY CONDITION:-

v_avg=(rey_no*mu)/(rho*d);

v_max=2*v_avg;

nu=mu/rho;

p=(32*v_avg*nu*l)/(d)^2;

% vertices of the wedge geometry:-

v_0=[0 0 0];
v_1=[0 d/2*cosd(theta/2) -d/2*sind(theta/2)];
v_2=[0 d/2*cosd(theta/2) d/2*sind(theta/2)];
v_3=[l 0 0];
v_4=[l d/2*cosd(theta/2) -d/2*sind(theta/2)];
v_5=[l d/2*cosd(theta/2) d/2*sind(theta/2)];

arc_1=[0.0 d/2 0.0];

arc_2=[l d/2 0.0];

x=input("give number of grid points along x-axis\t")

y=input("give number of grid points along y-axis\t")

z=input("give number of grid points along z-axis\t")

n=input("give conversion unit value\t")

line1='/*-------------------------------------c++ -------------------------------------------*\';
line2='|    ========                                                                         |';
line3='|   \        /      F ield              | OpenFOAM: The Open Source CFD Toolbox       |';
line4='|    \      /       O peration          | Website: https://openfoam.org               |';
line5='|     \    /        A nd                | Version:  6                                 |';
line6='|      \  /         M anipulation       |                                             |';
line7='\*-----------------------------------------------------------------------------------*/';
line8='FoamFile ';
line9=' { ';

%% "CREATING BLOCKMESH DICTIONERY FILE BELOW USING FILE PARSING"%%

f1=fopen('blockMeshDict.txt','w')
fprintf(f1,'%s\n',line1);
fprintf(f1,'%s\n',line2);
fprintf(f1,'%s\n',line3);
fprintf(f1,'%s\n',line4);
fprintf(f1,'%s\n',line5);
fprintf(f1,'%s\n',line6);
fprintf(f1,'%s\n',line7);
fprintf(f1,'\n');
fprintf(f1,'%s\n',line8);
fprintf(f1,'%s\n\n',line9);

fprintf(f1,'%16s %10s \n','version','  2.0;           ');
fprintf(f1,'%16s %10s \n','format' ,'  ascii;         ');
fprintf(f1,'%16s %10s \n','class'  ,'  dictionary;    ');
fprintf(f1,'%16s %10s \n','object' ,'  blockMeshDict; ');
fprintf(f1,'\n } \n \n');
fprintf(f1,'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n ');
fprintf(f1,' convertToMeters %d;\n \n',n);

% DEFINING VERTICES OF GEOMETRY :-

fprintf(f1,'\t\tvertices \n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t(%f %f %f)\n',v_0);
fprintf(f1,'\t\t\t(%f %f %f)\n',v_1);
fprintf(f1,'\t\t\t(%f %f %f)\n',v_2);
fprintf(f1,'\t\t\t(%f %f %f)\n',v_3);
fprintf(f1,'\t\t\t(%f %f %f)\n',v_4);
fprintf(f1,'\t\t\t(%f %f %f)\n',v_5);
fprintf(f1,'\t\t);\n\n');
fprintf(f1,'\t\tblocks \n');
fprintf(f1,'\t\t( \n');
fprintf(f1,'\t\t\t hex (0 1 2 0 3 4 5 3)  (%d %d %d)  simpleGrading (%d %d %d)\n\t\t); \n \n',x,y,z,xx,yy,zz);

%% DEFININIG SIDES OF GEOMETRY:-

%EDGE OF PIPE:-
fprintf(f1,'\t\tedges \n');
fprintf(f1,'\t\t(\n ');
fprintf(f1,'\t\t\tarc 1 2 (%f %f %f) \n',arc_1);
fprintf(f1,'\t\t\tarc 4 5 (%f %f %f) \n',arc_2);
fprintf(f1,' \t\t); \n \n');

% DEFINING BOUNDARY OF PIPE:-
fprintf(f1,' \t\tboundary\n\t\t(\n');

%INLET SECTION:-
fprintf(f1,'%16s\n','inlet');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%25s\n','type patch;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(0 1 2 0)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'\n');

%OUTLET SECTION:-
fprintf(f1,'%15s\n','outlet');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%25s\n','type patch;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(3 4 5 3)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'\n');

%FRONT SIDE OF PIPE:-
fprintf(f1,'%13s\n','Front');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%25s\n','type wedge;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(0 2 5 3)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'\n');

%BACK SIDE OF PIPE:-
fprintf(f1,'%13s\n','Back');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%25s\n','type wedge;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(0 3 4 1)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'\n');

% TOP SIDE OF PIPE
fprintf(f1,'%12s\n','TOP');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%24s\n','type patch;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(1 2 5 4)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'\n');

% AXIS OF PIPE
fprintf(f1,'%13s\n','axis');
fprintf(f1,'%10s\n','{');
fprintf(f1,'%25s\n','type empty;');
fprintf(f1,'%19s\n','faces');
fprintf(f1,'%15s\n','(');
fprintf(f1,'%28s\n','(0 3 3 0)');
fprintf(f1,'%16s\n',');');
fprintf(f1,'%10s\n','}');
fprintf(f1,'%5s\n',');');
fprintf(f1,'\n');

fprintf(f1,'%20s\n','mergePatchPairs');
fprintf(f1,'%6s\n','(');
fprintf(f1,'%7s\n',');');
fclose(f1)

%%%%%%%%%%%%%%%%%%%%%FILES PARSING PROCESS COMPLETED HERE AND TEXT FILE ISGENERATED%%%%%%%%%%%%%%%%%%%%%



PREPROCESSING STEPS :-

1. FILE PARSING TECHNIQUE IS USED FOR GENERATION OF BLOCKMESH DICTIONARY IN TEXT FILE MODE THAT DEFINES THE GEOMETRY OF OBJECT.
2. IN OPENFOAM, CASE FILE OF CAVITY FROM COMPRESSIBLE SETUP IS COPIED AND THEN PASTE IT IN THE RUN FILE USING RUN COMMAND TERMINAL.
3. THE FILE THERE RENAMED AS "CAVITY_2" .
4. AFTER GENERATION OF BLOCKMESH FILE IN MATLAB, THE TEXT FILE IS FED IN CASE FILE OF CAVITY KNOWN AS "SYSTEM"
5. AFTER IT, TIME STEP VALUE IS GIVEN IN CONTROLDICT FILE TO DEFINE SIMULATION TIME.
6. AFTER THAT USERDEFINED VALUE FOR VELOCITY AND PRESSURE IS PROVIDED IN PRESSURE FILE AND VELOCITY FILE.
7. AFTER PROVIDING THE ABOVE DETAILS, VISCOSITY IS PROVIDED IN TRANSPORT PROPERTIES TO GIVE VALUE FOR KINEMATIC VISCOSITY.
8. AFTER COMPLETING ALL DETAILS,THE " BLOCKMESH " COMMAND IS RUN IN RUN TERMINAL TO EXECUTE PROGRAM. THEN " CHECKMESH " IS EXECUTED TO CHECK MESH OF GEOMETRY IS CORRECT OR NOT.
9. AFTER THAT "ICOFOAM" SOLVER IS EXECUTED IN THE RUN TERMINAL WHICH CAUSES THE SIMULATION OF FLOW TO THE DESIRED SIMULATION TIME VALUE.
10. HENCE, IN THIS WAY THE PROCESS FOR PREPROCESSING IS COMPLETED. AND AFTER IT, STEPS FOR POST PROCESSING IS TAKEN .

BLOCKMESHDICT :-

THIS IS THE FILE WHERE THE GEOMETRY IS DEFINED AND ALSO MESHING AND GRADING IS DEFINED.

/*---------------------------*-c++ ---------------------------*
=======
\           /     F ield                 | OpenFOAM: The Open Source CFD Toolbox
\        /      O peration          | Website: https://openfoam.org
\     /        A nd                  | Version:  6
\ /          Manipulation        |
\*---------------------------------------------------------------*/
FoamFile
{
version      2.0;
format       ascii;
class         dictionary;
object       blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;

vertices
(
(0 0 0)
(0 0.00999391 -0.000348995)
(0 0.00999391 0.000348995)
(3.02 0 0)
(3.02 0.00999391 -0.000348995)
(3.02 0.00999391 0.000348995)
);

blocks
(
hex (0 1 2 0 3 4 5 3)  (100 1 200)  simpleGrading (1 1 1)
);

edges
( arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (3.020000 0.010000 0.000000)
);

boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}

outlet
{
type patch;
faces
(
(3 4 5 3)
);
}

Front
{
type wedge;
faces
(
(0 2 5 3)
);
}
Back
{
type wedge;
faces
(
(0 3 4 1)
);
}
TOP
{
type wall;
faces
(
(1 2 5 4)
);
}

axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);

mergePatchPairs
(
) ;


CONTROLDICT:-

IN THIS FILE, THE TIME STEP VALUE IS DEFINED WHICH WILL HELP IN ACCOUNTING THE FLOW OF FLUID OVER THE TIME STEP.

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

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.8;

deltaT          1e-4;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
#includeFunc streamlines
}

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


TRANSPORTPROPERTIES:-

IN THIS FILE , THE KINEMATIC VISCOSITY OF FLUID IS DEFINED .

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

nu              [0 2 -1 0 0 0 0] 1.3e-6;

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

VELOCITY FILE:-

IN THIS FILE, TYPE OF VELOCITY IS DEFINED AT INLET AND OUTLET SECTION AND ALSO AT INTERNAL FIELDS.

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

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

internalField   uniform (0.05292 0 0);

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

outlet
{
}

Front
{
type            wedge;
}

Back
{
type            wedge;
}

TOP
{
type          noSlip;
}
}

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



PRESSURE FILE:-

IN THIS FILE, TYPE OF PRESSURE IS DEFINED AT INLET AND OUTLET SECTION AND ALSO AT INTERNAL FIELD.

/*--------------------------------*- C++ -*----------------------------------*\
=========                 |
\\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
\\    /   O peration     | Website:  https://openfoam.org
\\  /    A nd           | Version:  6
\\/     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
{
}

outlet
{
type           fixedValue;
value          uniform 5.377;
}

Front
{
type            wedge;
}

Back
{
type            wedge;
}

TOP
{

}
}

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


POSTPROCESSING STEPS:-

1. AFTER EXECUTING THE "ICOFOAM"SOLVER ,THE SIMULATION COMPLETES FOR REQUIRED TIME AND NOW WE ARE ABLE TO EXTRACT DATA FROM SIMULATION.
2. IN ORDER TO DO THAT, OPEN THE PARAVIEW USING PARAFOAM COMMAND IN RUN TERMINAL.
3. AFTER OPENING PARAVIEW, CLICK  APPLY ON PROPERTIES MENU. IT WILL GENERATE THE GEOMETRY(MODEL).
4. AFTER THAT CLICK ON 'PROBE OVER LINE' TAB IN STATUS BAR. IT WILL OPEN THAT, THERE PROVIDE THE COORIDINATES FOR LINE FROM STARTING TO ENDING POINT OF LINE.
5. JUST MAKE SURE FOR WHICH PHYSICAL PARAMETER(LIKE PRESSURE,VELOCITY) ARE YOU SEARCHING THE PROBE. HERE IT IS VELOCITY PROFILE. THEN CLICK APPLY.
6. NOW, VELOCITY PROFILE IS GENERATED.
7. CLICK ON FILE OPTION ON TOP LEFT OF THE WINDOW  AND CLICK ON SAVE DATA. IT WILL STORE ALL THE VALUES AT GRID POINTS FOR ALL THE PHYSICAL QUANTITY.
8. NOW SAVE THE DATA AS  FILENAME AS ".CSV" EXTENSION.
9. NOW, IMPORT THE SAVE DATA IN MATLAB SOFTWARE AND WITH THE HELP OF CODING , PLOT THE DATA FOR SHEAR STRESS.
10. SIMILARLY, VALUES AT EACH POINT FOR VELOCITY IS GENERATED AND WE CAN FIND OUT THE MAXIMUM AND MINIMUM VELOCITY ACROSS RADIUS OF PIPE.
11. IN THIS WAY, THE POST PROCESSING IS COMPLETED AND SHEAR STRESS IS DEVELOPED ALONG WITH MAXIMUM AND MINIMUM VELOCITY OF FLUID IN MATLAB.

GEOMETRY AND MESH GENERATED IN PARAFOAM AT WEDGE ANGLE OF 10 DEGREE :-

GEOMETRY AND MESH GENERATED IN PARAFOAM AT WEDGE ANGLE OF 25 DEGREE :-

GEOMETRY AND MESH GENERATED IN PARAFOAM AT WEDGE ANGLE OF 45 DEGREE :-

POSTPROCESS RESULTS :-

NUMERICAL RESULT

FOR VELOCITY PROFILE AT DEGREE 10 :-

NUMERICAL RESULT

FOR VELOCITY PROFILE AT DEGREE 25 :-

NUMERICAL RESULT

FOR VELOCITY PROFILE AT DEGREE 45:-

ANALYTICAL RESULT FOR VELOCITY PROFILE :-

NUMERICAL RESULTS :-

SHEAR STRESS  AT ANGLE 10 DEGREE :-

NUMERICAL RESULT:-

SHEAR STRESS  AT ANGLE 25 DEGREE :-

NUMERICAL RESULT:-

SHEAR STRESS  AT ANGLE 45 DEGREE :-

ANALYTICAL RESULT OF SHEAR STRESS   :-

PROGRAM FOR ANALYTICAL RESULT OF

(a)  VELOCITY PROFILE.

(c)  SHEAR STRESS .

%%%%% analytical velocity profile of fluid in the pipe:-

%Given:-
R=d/2;
r=linspace(-d/2,d/2,1002);
dl=linspace(0,l,1002);
y=r(2)-r(1);
dx=dl(2)-dl(1);

for i=1:length(r)
u(i)=v_max*(1-(r(i)/R)^2);
end

figure(1)
plot(r,u,'linewidth',2)
ylabel('VELOCITY(ms^-^1)','fontweight',"Bold",'color','b');
title('VELOCITY PROFILE OF FLUID IN PIPE');

%%%%% analytical pressure gradient of fluid in the pipe:-

for i=1:length(dl)
dp(i)=(4*nu*v_max*dl(i))/(R)^2;
end

figure(2)
plot(dl,dp,'linewidth',2)
xlabel('LENGTH OF PIPE(m)','fontweight',"Bold",'color','r');
title('PRESSURE GRADIENT OF FLUID IN PIPE');

%%%%% analytical shear stress of fluid in the pipe:-

for i=2:length(u)
tau(i)=((dp(i)-dp(i-1))/dx)*(r(i)/2);
end

figure(3)
plot(abs(r),tau,'linewidth',2)
ylabel('SHEAR STRESS(N/m^-^2)','fontweight',"Bold",'color','b');
title('SHEAR STRESS OF FLUID IN PIPE');



NOTE:- NUMERICAL RESULT SOURCE CODE SHOULD BE RUN ALONG WITH MAIN BLOCKMESH SOURCE CODE FILE . AS DATA IN THIS CODE IS DEPENDENT ON THE                         MAIN SOURCE CODE FILE.

PROGRAM FOR NUMERICAL RESULT OR POSTPROCESS RESULT OF

(a) SHEAR STRESS .

clear all
close all
clc

u=x(:,1);
u_max=max(u);
r=x(:,7);
mu=0.0013;
l=linspace(0,l,1002);
dx=l(2)-l(1);
R=max(r);
y=linspace(-R,R,1002);
dy=y(2)-y(1);

%% numerical pressure gradient of fluid in the pipe:-
nu=mu/rho;

for i=1:length(l)
dp(i)=(4*nu*u_max*l(i))/(R)^2;
end

%% numerical shear stress of fluid in the pipe:-

for i=2:length(l)
tau(i)=((dp(i)-dp(i-1))/dx)*(y(i)/2);
end

figure(2)
plot(abs(y),tau,'r','linewidth',2)
ylabel('SHEAR STRESS(N/m^-^2)','fontweight',"Bold",'color','b');
title('SHEAR STRESS OF FLUID IN PIPE'); 

THIS FILE IS ALSO DEPENDENT ON MAIN SOURCE CODE . THERFORE IT SHOULD BE RUN ALONG WITH THAT.

THIS IS HOW THE ACTUAL RESULT AND POST-PROCESS RESULT HAVE BEEN DERIVED FROM SIMULATED DATA OBTAINED FROM OPENFOAM.

ANGLE OF WEDGE      MAX.VELOCITY     ACTUAL MAX. VELOCITY       RELATIVE ERROR IN %        COURANT MEAN NO.        COURANT NO. MAX        SIMULATION TIME

2^0                        0.27146                 0.27300                                       0.56                                  0.048                               0.187                             298.19 sec

3^0                        0.27146                 0.27300                                       0.56                                  0.048                               0.187                             299.24 sec

4^0                        0.27147                 0.27300                                       0.56                                  0.048                               0.187                             301.66 sec

10^0                      0.27150                 0.27300                                       0.54                                  0.048                               0.190                             310.07 sec

25^0                      0.27172                 0.27300                                       0.46                                  0.048                               0.202                             325.24 sec

'45^0'                       0.27216                 0.27300                                       0.30                                  0.070                               0.261                             552.75 sec

HERE , THE RELATIVE ERROR IS SO LOW WHICH TOTALLY TELLS THAT VELOCITY IS APPROXIMATELY COMPLETLY DEVELOPED .

HERE, CONSTANT COURANT NUMBER SIGNIFIES THAT THE SIMULATION IS QUITE STABLE AND WE CAN PREDICT OUT VALUES FOR FURTHER STEP TIME VALUES WITHOUT ANY  HESITATION .

BUT WHEN IT COMES TO SIMULATION TIME , WE SEE THAT PROCESSOR CONSUMES MORE TIME AS WE INCREASE THE WEDGE BOUNDARY CONDITION OF PIPE. THIS WAY WE COME TO THE CONCLUSION THAT WEDGE BOUNDARY CONDITION OF PIPE IS BETTER CHOICE THAN SYMMETRIC CONDITION IN TERMS OF SIMULATION TIME AND ALSO WE SEE THAT THE VALUES AT BOUNDARY OF PIPE IS NO SO MUCH DEFINED IN WEDGE CASE AS WE CAN SEE IN  SYMMETRIC CASE WHEN COMPARED TO HAIGEN-POISEUILLE EQUATION .

HENCE, IN THIS WAY PROJECT COMES TO AN END AND WE FINALLY PROVED THAT WEDGE BOUNDARY CONDITION PERFORMS VERY WELL THAN SYMMETRIC CONDITION IN SIMULATION WHEN COMPARED TO POISEUILLE LAW.

### SIMULATION ON PRANDTL MEYER SHOCK PROBLEM AND UNDERSTANDING THE CONCEPT BEHIND IT Shyam Rai · 2020-01-08 20:30:44

THEORY:- BOUNDARY CONDITION :- IN PHYSICS ,THESE ARE THOSE CONDITIONS WHICH ARE APPLIED AT THE BOUNDARY OF THE DOMAIN . IT SPECIFIES THE CONDITION AT BOUNDARY ON THE BASIS OF WHAT THE GOVERNING EQUATION DEFINES THE CONDITION OF DOMAIN ALONG WITH THE HELP OF INTIAL COND Read more

### Transient simulation of flow over a throttle body Shyam Rai · 2019-11-09 08:36:53

OBJECTIVE:- STEADY STATE SIMULATION OF FLOW OVER A THROTTLE BODY . SOFTWARE USED :- 1. CONVERGE STUDIO:- TO SETUP THE MODEL.  2. CYGWIN:- FOR RUNNING THE SIMULATION. 3. OPENFOAM:- TO VISUALIZE THE DIFFERENT POST-PROCESSED RESULT.   THEORY:- HERE, WE HAV Read more

### Steady state simulation of flow over a throttle body Shyam Rai · 2019-11-08 21:36:56

OBJECTIVE:- STEADY STATE SIMULATION OF FLOW OVER A THROTTLE BODY . SOFTWARE USED :- 1. CONVERGE STUDIO:- TO SETUP THE MODEL.  2. CYGWIN:- FOR RUNNING THE SIMULATION. 3. OPENFOAM:- TO VISUALIZE THE DIFFERENT POST-PROCESSED RESULT.   THEORY:- HERE, WE HAV Read more

### Simulation of Flow through pipe in OpenFoam using Matlab software Shyam Rai · 2019-09-09 12:53:45

AIM:- IN THIS PROJECT SIMULATION IS DONE ON THE FLUID FLOW THROUGH PIPE USING OPENFOAM SOFTWARE AND MATLAB . THE TOPIC GIVEN BELOW IS COVERED IN THIS PROJECT. TO MAKE A PROGRAM IN MATLAB THAT CAN GENERATE MESH AUTOMATICALLY FOR ANY WEDGE ANGLE AND GRADING SCHEME. TO Read more

### SIMULATION OF FLOW THROUGH THE BACKWARD FACING STEP BY USING BLOCKMESH IN OPENFOAM Shyam Rai · 2019-08-13 20:27:58

AIM :- IN THIS PROJECT, I HAVE WORKED ON SIMULATING THE FLOW OF FLUID THROUGH  THE DOMAIN (CONTROL VOLUME). DESCRIPTION:- THE DOMAIN IS NOTHING ELSE, IT IS JUST A CONTROL VOLUME THROUGH WHICH I HAVE SIMULATED THE RESULT OBTAINED FROM THE GOVERNING EQUATION. THE Read more

### 1D Super-sonic nozzle flow simulation using Macormack Method Shyam Rai · 2019-08-04 18:34:37

IN THIS PROJECT, I HAVE WORKED ON THE ONE DIMENSIONAL SUPERSONIC NOZZLE FLOW. IN THIS FLOW, I HAVE ASSUMED THE FLOW TO BE STEADY,ISENTROPIC. IN THIS NOZZLE, I HAVE CONSIDERED THE FLOW AT INLET SECTION COMES FROM RESERVOIR WHERE THE PRESSURE, TEMPERATURE ARE DENO Read more

### PROGRAM ON FLOW OF HEAT IN THE RECTANGULAR SLAB (2-D DOMAIN) USING 2-DIMENSIONAL HEAT CONDUCTION EQUATION IN STEADY AND TRANSITION STATE Shyam Rai · 2019-07-09 18:02:52

In this project, I have worked on the simulation of conduction of temperature heat in two dimensional space (2D domain).  The aim was to determine the rate of flow of  heat due to temperature difference over the space domain under steady condition and Read more

### Program on deriving fourth order approximation for different difference schemes for second order derivative Shyam Rai · 2019-06-23 15:26:37

In this programming, I have derived the four order approximation of second order derivative using finite difference method. In Finite difference method,we generally convert ordinary differential equation into difference equation. In order to achieve so, we use simple t Read more

### SIMULATION OF AN OSCILLATION OF A 2-D PENDULUM BY USING SECOND ORDER ORDINARY DIFFERENTIAL EQUATION Shyam Rai · 2019-06-21 19:15:09

In this report, I have simulated the oscillation of 2D pendulum and also generate a plot of \'angular_displacement\' & \'angular_velocity\' vs \"time\" in octave. Consider a pendulum which is having a string of length of \'1metre\' connected to a ball of mass,m=1kg Read more