IMEXSfloW  1.0
templategithubproject
 All Classes Files Functions Variables Pages
IMEX_SfloW.f90
Go to the documentation of this file.
1 !********************************************************************************
16 !
27 !********************************************************************************
28 
30 PROGRAM imex_sflow
31 
33 
34  USE geometry, ONLY : init_grid
35  USE geometry, ONLY : b_cent , dx
36 
38 
39  USE inpout, ONLY : init_param
40  USE inpout, ONLY : read_param
41  USE inpout, ONLY : output_solution
42  USE inpout, ONLY : read_solution
43  USE inpout, ONLY : close_units
44  USE inpout, ONLY : output_dakota
45 
48  USE solver, ONLY : imex_rk_solver
49  USE solver, ONLY : timestep
50 
51  USE inpout, ONLY : restart
52 
53  USE parameters, ONLY : t_start
54  USE parameters, ONLY : t_end
55  USE parameters, ONLY : t_output
56  USE parameters, ONLY : riemann_flag
57 
58  USE solver, ONLY : q , dt
59 
60  IMPLICIT NONE
61 
62  REAL*8 :: t
63  REAL*8 :: t1 , t2
64 
65  CALL cpu_time(t1)
66 
67  CALL init_param
68 
69  CALL read_param
70 
71  IF ( restart ) THEN
72 
73  CALL read_solution
74 
75  ELSE
76 
77  CALL init_grid
78 
80 
82 
83  ! riemann problem defined in file.inp
84  IF(riemann_flag.EQV..true.)THEN
85 
86  CALL riemann_problem
87 
88  ! generic problem defined by initial conditions function (in init.f90)
89  ELSE
90 
92 
93  ENDIF
94 
95  END IF
96 
97  t = t_start
98 
99  WRITE(*,*) 't_start =',t
100 
101  CALL output_solution(t)
102 
103  DO WHILE ( t .LT. t_end )
104 
105  CALL timestep
106 
107  IF ( t+dt .GT. t_end ) dt = t_end - t
108  IF ( t+dt .GT. t_output ) dt = t_output - t
109 
110  CALL imex_rk_solver
111 
112  t = t+dt
113 
114  WRITE(*,*) 't =',t,' dt =',dt,' h_tot =',dx*(sum(q(1,:)-b_cent(:)))
115 
116  IF ( ( t .GE. t_output ) .OR. ( t .GE. t_end ) ) CALL output_solution(t)
117 
118  END DO
119 
120  CALL output_dakota
121 
123 
124  CALL close_units
125 
126  CALL cpu_time(t2)
127 
128  WRITE(*,*) 'Time taken by the code was',t2-t1,'seconds'
129 
130 END PROGRAM imex_sflow
131 
subroutine imex_rk_solver
Runge-Kutta integration.
Definition: solver.f90:414
subroutine init_problem_param
Initialization of relaxation flags.
subroutine timestep
Time-step computation.
Definition: solver.f90:322
subroutine read_param
Read the input file.
Definition: inpout.f90:239
Numerical solver.
Definition: solver.f90:12
program imex_sflow
Github project page: http://demichie.github.io/IMEX_SfloW/ .
Definition: IMEX_SfloW.f90:30
subroutine initial_conditions
Problem initialization.
Definition: init.f90:133
subroutine riemann_problem
Riemann problem initialization.
Definition: init.f90:38
subroutine init_param
Initialization of the variables read from the input file.
Definition: inpout.f90:105
subroutine read_solution
Read the solution from the restart unit.
Definition: inpout.f90:442
subroutine deallocate_solver_variables
Memory deallocation.
Definition: solver.f90:270
Grid module.
Definition: geometry.f90:7
Initial solution.
Definition: init.f90:8
subroutine output_dakota
Definition: inpout.f90:649
Parameters.
Definition: parameters.f90:7
Constitutive equations.
Definition: constitutive.f90:4
subroutine allocate_solver_variables
Memory allocation.
Definition: solver.f90:112
Input/Output module.
Definition: inpout.f90:13
subroutine output_solution(t)
Write the solution on the output unit.
Definition: inpout.f90:509
subroutine close_units
Definition: inpout.f90:608
subroutine init_grid
Finite volume grid initialization.
Definition: geometry.f90:47