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

Input.f90

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
 +
<pre>
 +
 +
!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
Subroutine Init_all
Line 5: Line 28:
   
   
DO 2 I=1,NXmaxP  
DO 2 I=1,NXmaxP  
-
 
DO 2 J=1,NYmaxP  
DO 2 J=1,NYmaxP  
     F(i,j,1) =          2. * Yp(i,j) * (1. - Xp(i,j)**2.)  
     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,2) =  (-1.) * 2. * Xp(i,j) * (1. - Yp(i,j)**2.)  
!    F(i,j,1) =  1.
!    F(i,j,1) =  1.
-
 
+
!   F(i,j,2) = -1.
-
!     F(i,j,2) = -1.
+
2 continue
2 continue
Line 20: Line 40:
    
    
  DO 3 I=1,NXmaxP  
  DO 3 I=1,NXmaxP  
-
 
  DO 3 J=1,NYmaxP  
  DO 3 J=1,NYmaxP  
Line 31: Line 50:
!  F(    1,:,5) = 0.          ! x = -1
!  F(    1,:,5) = 0.          ! x = -1
-
 
!  F(NXmaxP,:,5) = 0.          ! x = 1
!  F(NXmaxP,:,5) = 0.          ! x = 1
-
 
!  F(:,    1,5) = 0.          ! y = 0
!  F(:,    1,5) = 0.          ! y = 0
-
 
!  F(:,NYmaxP,5) = 0.          ! y = 1
!  F(:,NYmaxP,5) = 0.          ! y = 1
!------------------------------------------------
!------------------------------------------------
-
 
!------------------------------------------------
!------------------------------------------------
Line 47: Line 62:
  alfff = 20.
  alfff = 20.
-
     F(    1,:,5) = 1. -  tanh(alfff)  ! x = -1   0<y<1
+
     F(    1,:,5) = 1. -  tanh(alfff)  ! x = -1     0<y<1
-
 
+
    F(NXmaxP,:,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  
-
 
+
-
F(:,NYmaxP,5) = 1. -  tanh(alfff)  ! -1<x<1     y =  1  
+
-
 
+
! DO 3 I=1,NXmaxP  
! DO 3 I=1,NXmaxP  
-
 
! DO 3 J=1,NYmaxP  
! DO 3 J=1,NYmaxP  
-
 
!  3 continue
!  3 continue
-
 
-
 
-
 
!------------------------------------------------
!------------------------------------------------
-
 
open(54, file='inlet_prof.txt')
open(54, file='inlet_prof.txt')
Line 71: Line 77:
   If ( Xp(i,1)<0.) then   
   If ( Xp(i,1)<0.) then   
 
 
-
  F(i,1,5) = 1. + tanh(alfff * ( 2.* Xp(i,1) + 1.) )
+
F(i,1,5) = 1. + tanh(alfff * ( 2.* Xp(i,1) + 1.) )
-
write(54,*) Xp(i,1),F(i,1,5)
+
write(54,*) Xp(i,1),F(i,1,5)
   
   
  end if
  end if
Line 80: Line 86:
close(54)
close(54)
-
 
Return  
Return  
 +
End
-
End
+
</pre>

Latest revision as of 15:35, 21 September 2005


!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