CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Example code for solving Smith-Hutton test - Fortran 90

Example code for solving Smith-Hutton test - Fortran 90

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
(Main.f90)
 
(4 intermediate revisions not shown)
Line 1: Line 1:
-
== Main.f90 ==
+
''Dear friends''
-
Program Main
+
''It's just a scrap. Later I'll correct it, although it's a complete working code''
-
include 'icomm_1.f90'
+
'''This code have been developed completely by myself in my native Marijampole. Please use it without limitations. Also I ask to add here procedures, which implement other schemes of approximation'''
-
Dimension F_out(nx,ny)
+
'''Kirichkov Michail, Lithuania, Marijampole, 2005 09 19'''
-
Character  Filename*10
+
*[[Bound_1.f90 - Set boundary conditions]]
-
 
+
*[[Check_koeff.f90 - Performing checking of koefficients]]
-
Call Ini
+
*[[Coeff_11.f90 - calculate the coefficients]]
-
 
+
*[[Contr_gem1.f90]]
-
Call Grid_rectangular
+
*[[COnvrg_sub.f90 - calculationg ]]
-
 
+
*[[Geom_1.f90]]
-
Call input_all
+
*[[Grid_sub.f90]]
-
 
+
*[[HLPA.f90]]
-
Call Geom
+
*[[ini.f90]]
-
 
+
*[[input.f90]]
-
Call Init_all
+
*[[Main.f90 - Main modul]]
-
 
+
*[[Out_array_1.f90]]
-
    Call Control_gem
+
*[[Output_aa.f90]]
-
 
+
*[[TDMA_11.f90 - Solution of system of linear equatrions by Thomas method]]
-
Do 100 Niter=1,100
+
*[[icomm_1.f90 - include module]]
-
 
+
-
write(*,*) '------------------------',Niter,'------------------------'
+
-
 
+
-
Call Coef_1(5)
+
-
 
+
-
Call Check_koeff
+
-
 
+
-
!  Alfa = 0.95   
+
-
!  Call Under_Relaxation(Alfa,5)
+
-
 
+
-
    Call TDMA_1(5)
+
-
 
+
-
Call Bound_condition
+
-
+
-
  Call Convergence_Criteria(5)
+
-
 
+
-
100 continue
+
-
 
+
-
 
+
-
!----------------------------------------------------------------
+
-
 
+
-
NImax = NXmaxp
+
-
 
+
-
NJmax = NYmaxp
+
-
 
+
-
F_out    = F(:,:,1)
+
-
 
+
-
!         1234567890
+
-
 
+
-
Filename  ='1_U_s.txt'
+
-
 
+
-
!    Call  Out_array(F_out,NImax,NJmax,Filename)
+
-
 
+
-
!-------------------------------------------------------------------
+
-
 
+
-
!----------------------------------------------------------------
+
-
 
+
-
NImax = NXmaxp
+
-
 
+
-
NJmax = NYmaxp
+
-
 
+
-
F_out    = F(:,:,2)
+
-
 
+
-
!         1234567890
+
-
Filename  ='1_V_s.txt'
+
-
 
+
-
!    Call  Out_array(F_out,NImax,NJmax,Filename)
+
-
 
+
-
!-------------------------------------------------------------------
+
-
 
+
-
NImax = NXmaxp
+
-
 
+
-
NJmax = NYmaxp
+
-
 
+
-
F_out    = F(:,:,5)
+
-
 
+
-
!         1234567890
+
-
 
+
-
Filename  ='1_T_s.txt'
+
-
 
+
-
!    Call  Out_array(F_out,NImax,NJmax,Filename)
+
-
 
+
-
!-------------------------------------------------------------------
+
-
 
+
-
Call output_all
+
-
+
-
WRITE(*,*) 'PRIVET'
+
-
 
+
-
STOP
+
-
 
+
-
END
+
-
 
+
-
-----------------------------------------------------------------------
+
-
 
+
-
== Bound.f90 ==
+
-
 
+
-
 
+
-
Subroutine Bound_condition
+
-
 
+
-
include 'icomm_1.f90
+
-
 
+
-
!  F(NXmaxP,2:NYmaxP,5) = F(NXmaxP-1,2:NYmaxP,5)
+
-
 
+
-
!  F(1,2:NYmaxP,5) = F(2,2:NYmaxP,5)
+
-
 
+
-
!  F(2:NXmaxP,NYmaxP,5) = F(2:NXmaxP,NYmaxP-1,5)
+
-
 
+
-
!  F(2:NXmaxP,1    ,5) = F(2:NXmaxP, 2      ,5)
+
-
 
+
-
open(54, file='ioutlet_prof.txt')
+
-
 
+
-
DO 5 I=1,NXmaxP
+
-
 
+
-
If ( Xp(i,1)>0.) then 
+
-
+
-
  F(i,1,5) = F(i,2,5)
+
-
+
-
write(54,*) Xp(i,1),F(i,1,5)
+
-
end if
+
-
 
+
-
  5 continue 
+
-
 
+
-
close(54)
+
-
 
+
-
 
+
-
Return
+
-
 
+
-
End
+

Latest revision as of 05:53, 19 September 2005

Dear friends

It's just a scrap. Later I'll correct it, although it's a complete working code

This code have been developed completely by myself in my native Marijampole. Please use it without limitations. Also I ask to add here procedures, which implement other schemes of approximation

Kirichkov Michail, Lithuania, Marijampole, 2005 09 19

My wiki