CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

fortran code for taylor green vortex

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2011, 03:29
Default fortran code for taylor green vortex
  #1
Senior Member
 
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17
HaKu is on a distinguished road
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
HaKu is offline   Reply With Quote

Old   July 14, 2011, 14:14
Default
  #2
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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
cfdnewbie is offline   Reply With Quote

Old   July 18, 2011, 10:26
Default
  #3
New Member
 
Join Date: Jul 2011
Posts: 8
Rep Power: 14
magicsquirrel is on a distinguished road
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,
magicsquirrel is offline   Reply With Quote

Old   July 18, 2011, 16:01
Default
  #4
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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
cfdnewbie is offline   Reply With Quote

Old   July 18, 2011, 22:02
Default
  #5
New Member
 
Join Date: Jul 2011
Posts: 8
Rep Power: 14
magicsquirrel is on a distinguished road
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 ?
magicsquirrel is offline   Reply With Quote

Old   July 19, 2011, 02:49
Default
  #6
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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?
cfdnewbie is offline   Reply With Quote

Old   July 19, 2011, 10:31
Default
  #7
New Member
 
Join Date: Jul 2011
Posts: 8
Rep Power: 14
magicsquirrel is on a distinguished road
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,
magicsquirrel is offline   Reply With Quote

Old   July 19, 2011, 16:25
Default
  #8
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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
cfdnewbie is offline   Reply With Quote

Old   July 19, 2011, 22:28
Default
  #9
New Member
 
Join Date: Jul 2011
Posts: 8
Rep Power: 14
magicsquirrel is on a distinguished road
No I never done this.
Cheers
magicsquirrel is offline   Reply With Quote

Old   July 20, 2011, 04:52
Default
  #10
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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)
cfdnewbie is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discontinuous Galerkin schemes -- fortran source code diedro Main CFD Forum 3 March 12, 2011 10:20
Grid generation code in Fortran artemiss1984 Main CFD Forum 3 February 23, 2011 01:19
parallel fortran code Ahmed Main CFD Forum 1 October 23, 2008 07:15
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
Multi-dimensional heat conduction fortran code odat Main CFD Forum 1 August 6, 1999 00:18


All times are GMT -4. The time now is 19:47.