Hi,
I wanna know what do I need to do to obtain the Drag Coefficient using Code Saturne (using Salomé to do the mesh)
Also, I'd like to know how can I simulate a rotating cylinder in the Code Saturne.
Thanks in advance.
Renan Neves Nascimento
How to calcule the Drag Coefficient and Rotating Cylinder
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Re: How to calcule the Drag Coefficient and Rotating Cylinder
What version do you use?
Re: How to calcule the Drag Coefficient and Rotating Cylinder
James,
I use the version 2.0.4
I use the version 2.0.4
Re: How to calcule the Drag Coefficient and Rotating Cylinde
The following is what I do for my rotating cylinder case you'll need to tweak it I guess. There are other ways to do this too but it works for me :)
In usclim:
The drag's an example in usproj and been discussed loads on this board (search for efforts).
Eg:
Hope that helps.
James
In usclim:
Code: Select all
alpha = 10.0d0 ! non dim rotation rate = omega*cyl_radius/U
! --- Cylinder (walls)
call getfbr('BODY', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
iphas = 1
itypfb(ifac,iphas) = iparoi
xx = cdgfbo(1,ifac)
yy = cdgfbo(3,ifac)
theta = atan(abs(yy/xx))
if(xx.ge.0.d0.and.yy.ge.0.d0) theta = theta
if(xx.lt.0.d0.and.yy.ge.0.d0) theta = - theta + pi
if(xx.lt.0.d0.and.yy.lt.0.d0) theta = theta + pi
if(xx.ge.0.d0.and.yy.lt.0.d0) theta = - theta + 2.d0*pi
ctheta = cos(theta)
stheta = sin(theta)
rcodcl(ifac, iu(iphas), 1) = alpha*(ctheta - stheta)
rcodcl(ifac, iv(iphas), 1) = 0.d0
rcodcl(ifac, iw(iphas), 1) = alpha*(stheta + ctheta)
enddo
Eg:
Code: Select all
!initialise
do ii=1,ndim
xfor(ii) = 0.d0
enddo
call getfbr('BODY',nlelt,lstelt)
! ======
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! xfor is force in ii direction
do ii=1,ndim
xfor(ii) = xfor(ii) + ra(iforbr + (ifac-1)*ndim + ii-1)
enddo
enddo
!sum in parallel
if (irangp.ge.0) then
call parrsm(ndim,xfor)
endif
James
Re: How to calcule the Drag Coefficient and Rotating Cylinder
I'll try it!
Thank you, James!
Thank you, James!
Re: How to calcule the Drag Coefficient and Rotating Cylinder
Hi James,
For your information, it exist in Fortran a function called "atan2" which does the job you've done with 4 lines.
atan2(x,y) gives you the argument of the complexe x+iy
not crucial but helpful,
Cheers,
Guillaume
For your information, it exist in Fortran a function called "atan2" which does the job you've done with 4 lines.
atan2(x,y) gives you the argument of the complexe x+iy
not crucial but helpful,
Cheers,
Guillaume