CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   fortran code for taylor green vortex (https://www.cfd-online.com/Forums/main/87214-fortran-code-taylor-green-vortex.html)

HaKu April 14, 2011 03:29

fortran code for taylor green vortex
 
i need fortran code for the initial and boundary condition of taylor green vortex problem...

will be thankful if somone can give me the fortran code in which the initial and boundary conditions are applied....

thanks and regards

cfdnewbie July 14, 2011 14:14

Hello,
the initial and boundary conditions for the Taylor Green Vortex are very simple. It's a 3d domain of size (2*Pi)^3, all bcs are periodic, no magic there.
The initial conditions are simple sin/cos analytical functions, see the JFM article of Brachet or the very good phd dissertation of Fauconnier; http://users.ugent.be/~dfauconn/research.htm

cheers,
cfdnewbie

magicsquirrel July 18, 2011 10:26

Hi,
An example of z-wise Taylor Green vortex initialization in Fortran:
(Xf1,Xf2,Xf3) is are space coordinate and Tf is the time.
The viscosity had to be setup appropriately.

Code:

!
! DESCRIPTION: z-wise Taylor-Green vortices
!
Real (Kind=double) Function u1TGzwisee (Xf1, Xf2, Xf3, Tf)
  Real (Kind=double) Xf1
  Real (Kind=double) Xf2
  Real (Kind=double) Xf3
  Real (Kind=double) Tf
  Real (Kind=double) cgret
  cgret = Sin (Xf1/0.5D1) * Cos (Xf2/0.5D1) * Exp &
      & (-0.2D1/0.25D2*Tf)
  u1TGzwisee = cgret
  Return
End Function u1TGzwisee

Real (Kind=double) Function u2TGzwisee (Xf1, Xf2, Xf3, Tf)
  Real (Kind=double) Xf1
  Real (Kind=double) Xf2
  Real (Kind=double) Xf3
  Real (Kind=double) Tf
  Real (Kind=double) cgret
  cgret = - Cos (Xf1/0.5D1) * Sin (Xf2/0.5D1) * Exp &
      & (-0.2D1/0.25D2*Tf)
  u2TGzwisee = cgret
  Return
End Function u2TGzwisee
!
Real (Kind=double) Function u3TGzwisee (Xf1, Xf2, Xf3, Tf)
  Real (Kind=double) Xf1
  Real (Kind=double) Xf2
  Real (Kind=double) Xf3
  Real (Kind=double) Tf
  Real (Kind=double) cgret
  cgret = 0D0
  u3TGzwisee = cgret
  Return
End Function u3TGzwisee

Cheers,

cfdnewbie July 18, 2011 16:01

Hey Squirrel,
why do you have a time dependence in your initialization? From what I understand, die Taylor Green Vortex is initialized at t=0 as a sine/cosine function, and then left to develop on its own?!!..... why do you need an exponential damping term in there?

thx and cheers
cfdnewbie

magicsquirrel July 18, 2011 22:02

You can set Tf to 0 or what you want you will still have TG.
It's useful to have the time in this function for follow the evolution after the initialization.
The exponential damping term is here because of the viscosity.
You have to set it in function of the viscosity that you have in the problem.
By the way HaKu, what is the BCs that you consider ?

cfdnewbie July 19, 2011 02:49

Hey Squirrel, thanks for your reply!

I agree, if you set Tf to zero, you'll get the standard TG initialization.
However, your Tf dependence only occurs inside the exponential damping term, so all you would get for Tf > 0 is a damped initial condition, but not an evolution of the TG - which is highly nonlinear...

What am I missing? :)

magicsquirrel July 19, 2011 10:31

Hi cfdnewbie,

If you take a TG with characteristic Reynolds number low enough you will have laminar TG and you can follow the evolution ... useful for code validation and stuff like that ... so yes the function give you the evolution.

Cheers,

cfdnewbie July 19, 2011 16:25

Hey Squirrel,
alright, that makes sense I guess... I've done some TG runs, all with a Re of 1000 and above, so I really got many many scales and transition to turbulence. I'll set up a run with Re = 10, just for fun, and check against your data...

Have you done any turbulent TG calculations? I'd be willing to share some results, in case you are interested...

lemme know!

cheers,
newbie

magicsquirrel July 19, 2011 22:28

No I never done this.
Cheers

cfdnewbie July 20, 2011 04:52

Just an addendum for the guy who started the thread:
don't forget to compute the (incomp.) pressure from the velocity field (insert divergence into momentum eqn)


All times are GMT -4. The time now is 13:52.