subroutine eddyvis c By A.W. Vreman, Vreman Research 2005. c Implementation of the isotropic form of the LES-model published c in Physics of Fluids 2004. implicit none c include DECLARATION OF ARRAYS: c input arrays: velocity derivatives "duidxj" (nine arrays) c and local cell volume array "vol". c output: array with eddy-viscosity "eddyv". c Here arrays are assumed to depend on the node index "n", c but this can simply be replaced by three indices "i,j,k" c Declaration of dummies: integer n real*8 csma,coef,del,d1,d2,d3 real*8 d1v1,d2v1,d3v1,d1v2,d2v2,d3v2,d1v3,d2v3,d3v3 real*8 b11,b12,b13,b22,b23,b33 real*8 abeta,bbeta c csma: Smagorinsky constant, e.g. 0.20, 0.17 or 0.10. csma=0.17d0 coef=2.5d0*csma*csma do n= .... del=vol(n)**0.333333333333333d0 d1=del*del d2=d1 d3=d1 c For anisotropic form prescribe d1, d2 and d3 by h1**2, h2**2 and h3**2, c where h1, h2 and h3 represent the meshsizes in the three coordinate directions c in physical space. d1v1=du1dx1(n) d2v1=du1dx2(n) d3v1=du1dx3(n) d1v2=du2dx1(n) d2v2=du2dx2(n) d3v2=du2dx3(n) d1v3=du3dx1(n) d2v3=du3dx2(n) d3v3=du3dx3(n) b11=d1*d1v1*d1v1+d2*d2v1*d2v1+d3*d3v1*d3v1 b12=d1*d1v1*d1v2+d2*d2v1*d2v2+d3*d3v1*d3v2 b13=d1*d1v1*d1v3+d2*d2v1*d2v3+d3*d3v1*d3v3 b22=d1*d1v2*d1v2+d2*d2v2*d2v2+d3*d3v2*d3v2 b23=d1*d1v2*d1v3+d2*d2v2*d2v3+d3*d3v2*d3v3 b33=d1*d1v3*d1v3+d2*d2v3*d2v3+d3*d3v3*d3v3 abeta=d1v1**2+d1v2**2+d1v3**2+ $ d2v1**2+d2v2**2+d2v3**2+ $ d3v1**2+d3v2**2+d3v3**2 bbeta=b11*b22-(b12**2)+b11*b33-(b13**2)+b22*b33-(b23**2) if (bbeta.lt.1d-12) then eddyv(n)=0d0 else eddyv(n)=coef*sqrt(bbeta/abeta) end if c in case of single precision (real*4): "if (bbeta.lt.1d-6) then" end do return end