CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Boundary Conditions (https://www.cfd-online.com/Forums/main/74246-boundary-conditions.html)

Victor10 March 27, 2010 14:08

Boundary Conditions
 
Hello ,
I am writing a Finite Volume method code for isentropic flow through a converging diverging nozzle . I am modelling half of the nozzle due to symmetry about the center line .I am not sure how to apply the Symmetry Boundary Condition .Here is the code I have written for the Symmetry Boundary Condition and the Wall Boundary Condition . Can someone please tell me if it is correct ?

u represents the horizontal velocity through the nozzle ;v the vertical component of velocity ;a is the speed of sound ;d -density ; e- internal energy .

the profile of the nozzle is taken as y=0.5 +1.1(x-1.5)^2 ;

for(i=1;i<=210;i++)
{
k=120;
p[i][k+1]=p[i][k];
theta = atan(2.2*(x[i][k]-1.5));
//The above line calculates the tangential direction along the upper wall of nozzle//
if(theta>=0){
u[i][k+1]=u[i][k]*cos(2.0*theta) + v[i][k]*sin(2.0*theta) ;
v[i][k+1]=u[i][k]*sin(2.0*theta) - v[i][k]*cos(2.0*theta);
}
else {
v[i][k+1] =-(u[i][k]*sin(-2.0*theta) + v[i][k]*cos(-2.0*theta));
u[i][k+1] = u[i][k]*cos(-2.0*theta)- v[i][k]*sin(-2.0*theta);
}
a[i][k+1]=a[i][k];
d[i][k+1]=d[i][k];
e[i][k+1]=e[i][k];
}



Symmetry Boundary Condition ;


for(i=1;i<=nx;i++)
{
pb[i]=p[i][1];
ub[i]=u[i][1];
vb[i]=0.0;
ab[i]=a[i][1];
db[i]=d[i][1];
eb[i]=e[i][1];
}




Waiting eagerly for some help.

Regards .

Victor .


All times are GMT -4. The time now is 21:10.