CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Input.f90 - determination of intial conditions

Input.f90 - determination of intial conditions

From CFD-Wiki

Revision as of 17:50, 21 September 2005 by Michail (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

!Sample program for solving Smith-Hutton Test using different schemes 
!of covective terms approximation -  Intial data input modul
!Copyright (C) 2005  Michail Kirichkov

!This program is free software; you can redistribute it and/or
!modify it under the terms of the GNU General Public License
!as published by the Free Software Foundation; either version 2
!of the License, or (at your option) any later version.

!This program is distributed in the hope that it will be useful,
!but WITHOUT ANY WARRANTY; without even the implied warranty of
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!GNU General Public License for more details.

!You should have received a copy of the GNU General Public License
!along with this program; if not, write to the Free Software
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

!***************************************************************************


Subroutine Init_all

include 'icomm_1.f90'

 
DO 2 I=1,NXmaxP 
DO 2 J=1,NYmaxP 

     F(i,j,1) =          2. * Yp(i,j) * (1. - Xp(i,j)**2.) 
     F(i,j,2) =  (-1.) * 2. * Xp(i,j) * (1. - Yp(i,j)**2.) 

!    F(i,j,1) =  1.
!    F(i,j,2) = -1.

2 continue

  
 DO 3 I=1,NXmaxP 
 DO 3 J=1,NYmaxP 

	Gam(i,j) = 1.  /1000000.

	Ro(i,j)  = 1. 
	
 3 continue


!   F(     1,:,5) = 0.          ! x = -1
!   F(NXmaxP,:,5) = 0.          ! x = 1
!   F(:,     1,5) = 0.          ! y = 0
!   F(:,NYmaxP,5) = 0.          ! y = 1

!------------------------------------------------
!------------------------------------------------

F(:,:,5)=0.00001


 alfff = 20.

    F(     1,:,5) = 1. -  tanh(alfff)  !  x = -1     0<y<1
    F(NXmaxP,:,5) = 1. -  tanh(alfff)  !  x = -1     0<y<1
    F(:,NYmaxP,5) = 1. -  tanh(alfff)  ! -1 < x < 1  y =  1 

! DO 3 I=1,NXmaxP 
! DO 3 J=1,NYmaxP 
!  3 continue
!------------------------------------------------

open(54, file='inlet_prof.txt')

  DO 5 I=1,NXmaxP 
  
  	If ( Xp(i,1)<0.) then  
 			
	F(i,1,5) = 1. + tanh(alfff * ( 2.* Xp(i,1) + 1.) )

	write(54,*) Xp(i,1),F(i,1,5)
 
 	end if

  5 continue  

close(54)

Return 
End

My wiki