ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
monitor.f90
Go to the documentation of this file.
1 module monitor
2 !
3 ! This module contains the variables to be monitored during the
4 ! convergence as well as the arrays to store the convergence.
5 ! The latter are only allocated by processor 0.
6 ! The default variables to be monitored depend on the governing
7 ! equations to be solved.
8 !
9  use constants, only: inttype, realtype, cgnsrealtype, &
11  implicit none
12  save
13 !
14 ! Parameters for the format to write the convergence to stdout.
15 !
16  integer, parameter :: fieldwidth = 12
17  integer, parameter :: fieldwidthlarge = 24
18  integer, parameter :: decimalwidth = 5
19 !
20 ! Variables to compute the convergence info.
21 !
22  ! nMonSum: Number of monitoring variables for which the sum over
23  ! all processors must be taken. Note that this is an
24  ! integer, because of MPI.
25  ! nMonMax: Number of monitoring variables for which the maximum
26  ! over all processors must be taken. Note that this is
27  ! an integer, because of MPI.
28  ! nMon: The sum of nmonSum and nmonMax
29 
30  integer :: nmonsum, nmonmax, nmon
31 
32  ! monLoc(nMon): Array for the local summation/maximum of the
33  ! monitoring variables.
34  ! monGlob(nMon): Idem, but for the global summation/maximum.
35  ! monRef(nMon): Idem, but for the reference values needed
36  ! for an unsteady computation.
37  ! MassFluxL, G Massflux out of bcOutflowSubsonic (eran-msf)
38 
39  real(kind=realtype), dimension(:), allocatable :: monloc
40  real(kind=realtype), dimension(:), allocatable :: monglob
41  real(kind=realtype), dimension(:), allocatable :: monref
42  real(kind=realtype) :: massfluxl, massfluxg ! eran-msf
43 
44  ! monNames(nMon): The names of the variables to be monitored.
45 
46  character(len=maxCGNSNameLen), dimension(:), allocatable :: &
47  monnames
48 
49  ! monMachOrHMax: Whether or not the maximum value of the Mach
50  ! number and total enthalpy difference must be
51  ! monitored and thus computed.
52  ! showCPU: Whether or not the CPU time must be shown
53  ! in the output to screen.
54 
55  logical :: monmachorhmax
56  logical :: showcpu
57 
58  ! monMassSliding: Whether or not to monitor the mass flow of
59  ! the sliding interfaces.
60  ! monMassFamilies: Whether or not the mass flow of at least
61  ! one family must be monitored.
62 
63  logical :: monmasssliding
64  logical :: monmassfamilies
65 !
66 ! Variables to store the convergence info.
67 !
68  ! convArray(0:nIterMax,nsps,nmon): 3D array to store the
69  ! convergence histories.
70 
71  real(kind=cgnsrealtype), dimension(:, :, :), allocatable :: &
72  convarray
73 
74  ! solverDataArray(0:Itermax, sps, 4): stores the cumulative number of iterations,
75  ! CFL, step size, and lin res at each major iter.
76  ! It is used post processing convergence histories
77  real(kind=realtype), dimension(:, :, :), allocatable :: solverdataarray
78 
79  ! solverTypeArray(0:Itermax, sps): Stores string designating the iteration type on
80  ! each major iteration. Each string is 8 char long
81  character(len=8), dimension(:, :), allocatable :: solvertypearray
82 
83 ! Variables to store the time accurate history.
84 ! Only allocated for a time accurate computation.
85 !
86  ! nTimeStepsRestart: Number of time steps taken in an earlier
87  ! unsteady computation from which a restart
88  ! is performed.
89  ! timeStepUnsteady: The current unsteady time step number;
90  ! restart is not taken into account.
91  ! timeUnsteady: Amount of physical time of the current
92  ! simulation; only relevant in unsteady mode.
93  ! timeUnsteadyRestart: Amount of physical time from a previous
94  ! simulation from which a restart is
95  ! performed.
96 
97  integer(kind=intType) :: ntimestepsrestart, timestepunsteady
98  real(kind=realtype) :: timeunsteady, timeunsteadyrestart
99 
100  ! timeArray(nTimeMax): Array to store the values of the
101  ! time at every time step.
102  ! timeDataArray(nTimeMax,nMon): 2D array to store the variables
103  ! to be monitored at every time
104  ! step. No need to store a spectral
105  ! index here.
106 
107  real(kind=cgnsrealtype), dimension(:), allocatable :: timearray
108 
109  real(kind=cgnsrealtype), dimension(:, :), allocatable :: &
111 
112  ! writeGrid: Whether or not a grid file must be written.
113  ! writeVolume: Idem for a volume solution file.
114  ! writeSurface: Idem for a surface solution file.
115 
117 
118 end module monitor
integer, parameter maxcgnsnamelen
Definition: constants.F90:17
logical writegrid
Definition: monitor.f90:116
integer(kind=inttype) timestepunsteady
Definition: monitor.f90:97
real(kind=realtype) massfluxg
Definition: monitor.f90:42
integer nmon
Definition: monitor.f90:30
real(kind=cgnsrealtype), dimension(:), allocatable timearray
Definition: monitor.f90:107
integer nmonmax
Definition: monitor.f90:30
logical writesoleachiter
Definition: monitor.f90:116
real(kind=realtype), dimension(:), allocatable monloc
Definition: monitor.f90:39
real(kind=realtype) massfluxl
Definition: monitor.f90:42
logical monmachorhmax
Definition: monitor.f90:55
real(kind=realtype), dimension(:, :, :), allocatable solverdataarray
Definition: monitor.f90:77
integer nmonsum
Definition: monitor.f90:30
real(kind=cgnsrealtype), dimension(:, :, :), allocatable convarray
Definition: monitor.f90:71
logical showcpu
Definition: monitor.f90:56
character(len=maxcgnsnamelen), dimension(:), allocatable monnames
Definition: monitor.f90:46
real(kind=realtype) timeunsteady
Definition: monitor.f90:98
real(kind=realtype) timeunsteadyrestart
Definition: monitor.f90:98
integer, parameter decimalwidth
Definition: monitor.f90:18
integer(kind=inttype) ntimestepsrestart
Definition: monitor.f90:97
logical writevolume
Definition: monitor.f90:116
logical monmasssliding
Definition: monitor.f90:63
integer, parameter fieldwidthlarge
Definition: monitor.f90:17
real(kind=realtype), dimension(:), allocatable monglob
Definition: monitor.f90:40
logical monmassfamilies
Definition: monitor.f90:64
logical writesurface
Definition: monitor.f90:116
real(kind=realtype), dimension(:), allocatable monref
Definition: monitor.f90:41
real(kind=cgnsrealtype), dimension(:, :), allocatable timedataarray
Definition: monitor.f90:109
character(len=8), dimension(:, :), allocatable solvertypearray
Definition: monitor.f90:81
integer, parameter fieldwidth
Definition: monitor.f90:16