# Grid problem

 Register Blogs Members List Search Today's Posts Mark Forums Read

October 2, 2013, 07:43
Grid problem
#1
Member

le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 6
hi ,
I am a beginner in the coding. I will use fortran for my course. I'm trying to make the grid for my model, but when i ran, it had error. I know this forum is for OpenFOAM, but I really need help!
Could you help me to fix it!!
Thank you

program nozzle_mesh
implicit none
real,allocatable,dimension(:,::x,y
integer::i,j,num_xi,num_eta
real::d_xi,d_eta,xi,eta,le,wi,L1,L2,eta0
!eta0 is the hight of base
!L1 is the lenght of base
!L2 is the lenght of combustion chamber
!eta,xi is coordinate in computer plane, eta vetical axial, xi holizon axial
!d_xi; d_eta is distance between 2 node
!i,j is the node
!num_xi;num_eta is number of node
!beta_x;beta_y is the compressible coefficience of cluster grid
!xi0 is the position where cluster compressed in x direction
!xii;etaj distance to origin
real,parameter::e=2.71828
real::beta_x=5.0,beta_y=1.2,anpha,A,xi0,xii,etaj,c ,eta0,x0
open(1,"Nozlle.dat")
xi=hg
eta=le
call number(xi,num_xi,L1)
call number(eta,num_eta,eta0)
d_xi=xi/(num_xi-1)
d_eta=eta/(num_eta-1)
xi0=L1
allocate(x(num_xi,num_eta),y(num_xi,num_eta))
do j=1,num_xi
do i=1,num_eta
xii=d_xi*(j-1)
x0=log((1.0+(exp(beta_x)-1.0)*xi0)/(1.0+(exp(-beta_x)-1.0)*xi0))&
& /log(e)/2.0/beta_x
A=sinh(beta_x*x0)
x(i,j)=xi0*(sinh((xii-x0)*beta_x)+A)/A
if(xii<=L1 .and. i<=eta0/d_eta)y(i,j)=eta0
else if (xii<=L1 .and. i>eta0/d_eta) then
etaj=d_eta*(i-1)
c=log((beta_y+1)/(beta_y-1))
if (xii<=L1) anpha=0
if (xii>L1) anpha=0.5
y(i,j)=((beta_y+1)-(beta_y-1)*exp(-c*(etaj-1-anpha)/(1-anpha))) &
& /((2*anpha+1)*(1+exp(-c*(etaj-1-anpha))/(1-anpha)))
write(1,*),x(i,j),y(i,j)
end if
end do
write(1,*),x(i,j),y(i,j)
print*,x(i,j),y(i,j)
end do
end

//************************************************** *****************//
subroutine number(L,number,L1)
real,intent(inout)::L,number,L1
real::delta
integer::num1,num2
delta=L/(number-1)
num1=L1/delta
delta=L1/num1
num2=L2/delta
L2=num2*delta
L=L1+L2
number=num1+num2
return (L),(number),(L1)
end
Attached Images
 1385855_659641574054657_1942636461_n.jpg (31.3 KB, 5 views)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post praveen SU2 20 March 10, 2014 15:09 immortality OpenFOAM Running, Solving & CFD 6 May 28, 2013 18:12 CFD_Novice Main CFD Forum 13 February 17, 2008 23:56 David FLUENT 4 June 8, 2005 16:20 nisheet goyal Phoenics 1 June 18, 2001 09:28

All times are GMT -4. The time now is 18:59.