ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
inputParamRoutines.F90
Go to the documentation of this file.
2 
3  use constants, only: maxstringlen, inttype
4 
5  ! Set the parameter none, which is used as a check to see
6  ! whether or not some key parameters were specified.
7 
8  integer(kind=intType), parameter :: none = 0
9 
10  ! monDturb: Whether or not the turbulent residuals
11  ! must be monitored. This must be done via
12  ! this construction, because during the
13  ! reading of the monitoring variables the
14  ! turbulence model might not be known.
15  ! monitorSpecified: Whether or not the monitoring variables
16  ! were specified.
17  ! surfaceOutSpecified: Whether or not the surface output
18  ! variables were specified.
19  ! volumeOutSpecified: Whether or not the volume output
20  ! variables were specified.
21  ! isoOutSpecified: Wheter or not the isosurface output
22  ! variables were specified
23  logical :: mondturb
24  logical :: monitorspecified
26  logical :: volumeoutspecified
27  logical :: isooutspecified
28 
29  ! liftDirSpecified: Whether or not the lift direction was
30  ! specified.
31 
32  logical :: liftdirspecified
33 
34 contains
35 
36  subroutine checkmonitor
37  !
38  ! checkMonitor checks and possibly corrects the variables
39  ! to be monitored during the convergence. This depends on the
40  ! governing equations to be solved. After the correction the
41  ! sequence of the monitoring variable names is changed, such
42  ! that the output is independent of the specified sequence.
43  ! Furthermore memory is allocated for the arrays used to compute
44  ! the monitoring variables and it is checked whether or not the
45  ! maximum Mach number of total enthalpy difference is to be
46  ! monitored.
47  !
48  use constants
49  use cgnsnames
50  use monitor, only: monnames, monglob, monloc, nmonmax, nmonsum, &
55  use utils, only: terminate
56  implicit none
57  !
58  ! Local variables.
59  !
60  integer :: ierr
61 
62  integer(kind=intType) :: i, ii, nn
63  integer(kind=intType), dimension(:), allocatable :: sortNumber
64  integer(kind=intType), dimension(:), allocatable :: tmpNumber
65 
66  character(len=maxCGNSNameLen), dimension(:), allocatable :: &
67  tmpNames
68  logical :: RKExplicit
69 
70  ! Find out if an explicit RK scheme is used in unsteady mode and
71  ! set the logical RKExplicit accordingly. For explicit RK schemes
72  ! no residuals are monitored.
73 
74  rkexplicit = .false.
75  if (equationmode == unsteady .and. &
76  timeintegrationscheme == explicitrk) rkexplicit = .true.
77 
78  ! If the turbulent residuals must be monitored add them to the
79  ! list of monitoring names. Enough memory should have been
80  ! allocated for this.
81 
82  if (mondturb .and. equations == ransequations .and. &
83  (.not. rkexplicit)) then
84 
85  select case (turbmodel)
86 
87  ! One equation models of the spalart-allmaras family.
88 
90  nmon = nmon + 1; nmonsum = nmonsum + 1
92 
93  ! Two equation models of the k-w family.
94 
96  nmon = nmon + 2; nmonsum = nmonsum + 2
97  monnames(nmon - 1) = cgnsl2resk
99 
100  ! Two equation k-tau model.
101 
102  case (ktau)
103  nmon = nmon + 2; nmonsum = nmonsum + 2
104  monnames(nmon - 1) = cgnsl2resk
106 
107  ! V2f model.
108 
109  case (v2f)
110  nmon = nmon + 4; nmonsum = nmonsum + 4
111  monnames(nmon - 3) = cgnsl2resk
113  monnames(nmon - 1) = cgnsl2resv2
115 
116  end select
117  end if
118 
119  ! Allocate the memory for sortNumber tmpNumber and tmpNames.
120 
121  allocate (sortnumber(nmon), tmpnumber(nmon), tmpnames(nmon), &
122  stat=ierr)
123  if (ierr /= 0) &
124  call terminate("checkMonitor", &
125  "Memory allocation failure for sortNumber, etc.")
126 
127  ! Loop over the monitoring variables, copy the name into tmpName
128  ! and set a number to determine its place in the sequence. If the
129  ! variable cannot be monitored for the governing equations, the
130  ! priority is set to a high number, such that it will be at the
131  ! end of the sorted numbers. At the same time the number of
132  ! variables to be monitored, nMonSum, nMonMax and nMon, is
133  ! corrected.
134 
135  nn = nmon
136  do i = 1, nn
137 
138  tmpnames(i) = monnames(i)
139 
140  ! Determine the place in the sequence for this string.
141 
142  select case (monnames(i))
143  case (cgnsl2resrho)
144  sortnumber(i) = 1
145  if (rkexplicit) then
146  sortnumber(i) = 10001
147  nmonsum = nmonsum - 1
148  end if
149 
150  case (cgnsl2resmomx)
151  sortnumber(i) = 2
152  if (rkexplicit) then
153  sortnumber(i) = 10002
154  nmonsum = nmonsum - 1
155  end if
156 
157  case (cgnsl2resmomy)
158  sortnumber(i) = 3
159  if (rkexplicit) then
160  sortnumber(i) = 10003
161  nmonsum = nmonsum - 1
162  end if
163 
164  case (cgnsl2resmomz)
165  sortnumber(i) = 4
166  if (rkexplicit) then
167  sortnumber(i) = 10004
168  nmonsum = nmonsum - 1
169  end if
170 
171  case (cgnsl2resrhoe)
172  sortnumber(i) = 5
173  if (rkexplicit) then
174  sortnumber(i) = 10005
175  nmonsum = nmonsum - 1
176  end if
177 
178  case (cgnsl2resnu)
179  sortnumber(i) = 6
180  if (equations /= ransequations) then
181  sortnumber(i) = 10001
182  nmonsum = nmonsum - 1
183  end if
184 
185  case (cgnsl2resk)
186  sortnumber(i) = 7
187  if (equations /= ransequations) then
188  sortnumber(i) = 10002
189  nmonsum = nmonsum - 1
190  end if
191 
192  case (cgnsl2resomega)
193  sortnumber(i) = 8
194  if (equations /= ransequations) then
195  sortnumber(i) = 10003
196  nmonsum = nmonsum - 1
197  end if
198 
199  case (cgnsl2restau)
200  sortnumber(i) = 9
201  if (equations /= ransequations) then
202  sortnumber(i) = 10004
203  nmonsum = nmonsum - 1
204  end if
205 
206  case (cgnsl2resepsilon)
207  sortnumber(i) = 10
208  if (equations /= ransequations) then
209  sortnumber(i) = 10005
210  nmonsum = nmonsum - 1
211  end if
212 
213  case (cgnsl2resv2)
214  sortnumber(i) = 11
215  if (equations /= ransequations) then
216  sortnumber(i) = 10006
217  nmonsum = nmonsum - 1
218  end if
219 
220  case (cgnsl2resf)
221  sortnumber(i) = 12
222  if (equations /= ransequations) then
223  sortnumber(i) = 10007
224  nmonsum = nmonsum - 1
225  end if
226 
227  case (cgnscl)
228  sortnumber(i) = 101
229  if (flowtype == internalflow) then
230  sortnumber(i) = 11001
231  nmonsum = nmonsum - 1
232  end if
233 
234  case (cgnsclp)
235  sortnumber(i) = 102
236  if (flowtype == internalflow) then
237  sortnumber(i) = 11002
238  nmonsum = nmonsum - 1
239  end if
240 
241  case (cgnsclv)
242  sortnumber(i) = 103
243  if (equations == eulerequations .or. &
244  flowtype == internalflow) then
245  sortnumber(i) = 11003
246  nmonsum = nmonsum - 1
247  end if
248 
249  case (cgnscd)
250  sortnumber(i) = 104
251  if (flowtype == internalflow) then
252  sortnumber(i) = 11004
253  nmonsum = nmonsum - 1
254  end if
255 
256  case (cgnscdp)
257  sortnumber(i) = 105
258  if (flowtype == internalflow) then
259  sortnumber(i) = 11005
260  nmonsum = nmonsum - 1
261  end if
262 
263  case (cgnscdv)
264  sortnumber(i) = 106
265  if (equations == eulerequations .or. &
266  flowtype == internalflow) then
267  sortnumber(i) = 11006
268  nmonsum = nmonsum - 1
269  end if
270 
271  case (cgnscfx)
272  sortnumber(i) = 107
273 
274  case (cgnscfy)
275  sortnumber(i) = 108
276 
277  case (cgnscfz)
278  sortnumber(i) = 109
279 
280  case (cgnscmx)
281  sortnumber(i) = 110
282 
283  case (cgnscmy)
284  sortnumber(i) = 111
285 
286  case (cgnscmz)
287  sortnumber(i) = 112
288 
289  case ('totalR')
290  sortnumber(i) = 113
291 
292  case (cgnssepsensor)
293  sortnumber(i) = 114
294 
295  case (cgnscavitation)
296  sortnumber(i) = 115
297 
298  case (cgnsaxismoment)
299  sortnumber(i) = 116
300 
301  case (cgnssepsensorksarea)
302  sortnumber(i) = 117
303 
304  case (cgnshdiffmax)
305  sortnumber(i) = 201
306 
307  case (cgnsmachmax)
308  sortnumber(i) = 202
309 
310  case (cgnsyplusmax)
311  sortnumber(i) = 203
312  if (equations /= ransequations) then
313  sortnumber(i) = 12003
314  nmonmax = nmonmax - 1
315  end if
316 
317  case (cgnseddymax)
318  sortnumber(i) = 204
319  if (equations /= ransequations) then
320  sortnumber(i) = 12004
321  nmonmax = nmonmax - 1
322  end if
323 
324  case default
325  call terminate("checkMonitor", "This should not happen")
326  end select
327 
328  end do
329 
330  ! Set the new value of nMon, because this might have changed
331  ! due to the corrections.
332 
333  nmon = nmonsum + nmonmax
334 
335  ! Copy sortNumber in tmpNumber and sort it in increasing order.
336  ! Note that here nn must be used and not nMon.
337 
338  do i = 1, nn
339  tmpnumber(i) = sortnumber(i)
340  end do
341 
342  call qsortintegers(sortnumber, nn)
343 
344  ! Loop over the the number of monitoring variables and store the
345  ! new sequence in monNames.
346 
347  do i = 1, nn
348  ii = bsearchintegers(tmpnumber(i), sortnumber)
349  monnames(ii) = tmpnames(i)
350  end do
351 
352  ! Release the memory of sortNumber, tmpNumber and tmpNames.
353 
354  deallocate (sortnumber, tmpnumber, tmpnames, stat=ierr)
355  if (ierr /= 0) &
356  call terminate("checkMonitor", &
357  "Deallocation error for sortNumber, etc.")
358 
359  ! Allocate the memory for the monitoring variables.
360 
361  allocate (monloc(nmon), monglob(nmon), monref(nmon), stat=ierr)
362  if (ierr /= 0) &
363  call terminate("checkMonitor", &
364  "Memory allocation for monitoring variables")
365 
366  ! Check if the maximum Mach number or the maximum total enthalpy
367  ! difference must be monitored.
368 
369  monmachorhmax = .false.
370  do i = (nmonsum + 1), nmon
371  if (monnames(i) == cgnshdiffmax .or. &
372  monnames(i) == cgnsmachmax) monmachorhmax = .true.
373  end do
374 
375  end subroutine checkmonitor
376  subroutine checkoutput
377  !
378  ! checkOutput checks and possibly corrects the and output
379  ! variables. This depends on the set of governing equations to
380  ! be solved.
381  !
382  use constants
383  use extraoutput
387  implicit none
388 
389  ! Determine the governing equations to be solved and set the
390  ! variables accordingly.
391 
392  select case (equations)
393  case (eulerequations)
394  surfwritecf = .false.
395  surfwritech = .false.
396  surfwriteyplus = .false.
397  surfwritecfx = .false.
398  surfwritecfy = .false.
399  surfwritecfz = .false.
400  surfwriteforceindragdir = .false.
401  surfwriteforceinliftdir = .false.
402 
403  volwritemachturb = .false.
404  volwriteeddyvis = .false.
405  volwriteratioeddyvis = .false.
406  volwritedist = .false.
407  volwriteresturb = .false.
408 
409  case (nsequations)
410  surfwriteyplus = .false.
411 
412  volwritemachturb = .false.
413  volwriteeddyvis = .false.
414  volwriteratioeddyvis = .false.
415  volwritedist = .false.
416  volwriteresturb = .false.
417 
418  case (ransequations)
419 
420  ! Check if it is possible to write a turbulent Mach
421  ! number and eddy viscosity; this depends on the turbulence
422  ! model used.
423 
424  if (.not. kpresent) volwritemachturb = .false.
425  if (.not. eddymodel) then
426  volwriteeddyvis = .false.
427  volwriteratioeddyvis = .false.
428  end if
429 
430  ! If a wall distance free turbulence model is used,
431  ! set volWriteDist to .false.
432 
433  if (.not. walldistanceneeded) volwritedist = .false.
434 
435  end select
436 
437  if (equationmode == unsteady .and. &
439  volwriteresrho = .false.
440  volwriteresmom = .false.
441  volwriteresrhoe = .false.
442  volwriteresturb = .false.
443  end if
444 
445  end subroutine checkoutput
446  subroutine defaultisoout
447  !
448  ! defaultIsoOut sets the default set of additional
449  ! variables to be written to the solution file; the primitive
450  ! variables are always written. This additional set depends on
451  ! the governing equations to be solved.
452  !
453  use constants
454  use extraoutput
455  use inputphysics, only: equations
456  implicit none
457 
458  ! First set the variables, which are independent from the
459  ! governing equations to be solved.
460  isowriterho = .false.
461  isowritevx = .false.
462  isowritevy = .false.
463  isowritevz = .false.
464  isowritep = .false.
465  isowritemx = .false.
466  isowritemy = .false.
467  isowritemz = .false.
468  isowriterhoe = .false.
469  isowritetemp = .false.
470  isowritecp = .false.
471  isowritemach = .false.
472  isowritemachturb = .false.
473  isowritedist = .false.
474  isowritevort = .false.
475  isowritevortx = .false.
476  isowritevorty = .false.
477  isowritevortz = .false.
478  isowriteptotloss = .false.
479  isowriteresrho = .false.
480  isowriteresmom = .false.
481  isowriteresrhoe = .false.
482  isowriteshock = .false.
483  isowritefilteredshock = .false.
484  ! Set the values which depend on the equations to be solved.
485 
486  select case (equations)
487  case (eulerequations)
488  isowriteeddyvis = .false.
489  isowriteratioeddyvis = .false.
490  isowriteresturb = .false.
491 
492  case (nsequations)
493  isowriteeddyvis = .false.
494  isowriteratioeddyvis = .false.
495  isowriteresturb = .false.
496 
497  case (ransequations)
498  isowriteeddyvis = .false.
499  isowriteratioeddyvis = .false.
500  isowriteresturb = .false.
501  end select
502 
503  end subroutine defaultisoout
504  subroutine defaultmonitor
505  !
506  ! defaultMonitor sets the default set of variables to be
507  ! monitored during the convergence. This set depends on the
508  ! governing equations to be solved.
509  !
510  use constants
511  use cgnsnames
512  use inputphysics, only: equations, flowtype
513  use monitor, only: nmonsum, nmonmax, nmon, monnames, showcpu
514  use utils, only: terminate
515  implicit none
516  !
517  ! Local variables.
518  !
519  integer :: ierr
520 
521  ! CPU time is written to stdout.
522 
523  showcpu = .true.
524 
525  ! Determine the governing equations to be solved.
526 
527  select case (equations)
528  case (eulerequations)
529 
530  ! Set the number of summation and maximum monitor variables
531  ! and allocate the memory for the monitoring names.
532  ! A distinction is made between internal and external flows,
533  ! because cl and cd do not make a lot of sense for the former.
534 
535  if (flowtype == internalflow) then
536 
537  ! Internal flow; only the density residual is monitored.
538 
539  nmonsum = 1; nmonmax = 0; nmon = 1
540  allocate (monnames(nmon), stat=ierr)
541  if (ierr /= 0) &
542  call terminate("defaultMonitor", &
543  "Memory allocation failure for monNames")
544 
545  ! Set the names for the variables to be monitored.
546 
548 
549  else
550 
551  ! External; also lift and drag is monitored.
552 
553  nmonsum = 3; nmonmax = 0; nmon = 3
554  allocate (monnames(nmon), stat=ierr)
555  if (ierr /= 0) &
556  call terminate("defaultMonitor", &
557  "Memory allocation failure for monNames")
558 
559  ! Set the names for the variables to be monitored.
560 
562  monnames(2) = cgnscl
563  monnames(3) = cgnscd
564 
565  end if
566 
567  case (nsequations)
568 
569  ! Set the number of summation and maximum monitor variables
570  ! and allocate the memory for the monitoring names.
571  ! A distinction is made between internal and external flows,
572  ! because cl and cd do not make a lot of sense for the former.
573 
574  if (flowtype == internalflow) then
575 
576  ! Internal flow; only the density residual is monitored.
577 
578  nmonsum = 1; nmonmax = 0; nmon = 1
579  allocate (monnames(nmon), stat=ierr)
580  if (ierr /= 0) &
581  call terminate("defaultMonitor", &
582  "Memory allocation failure for monNames")
583 
584  ! Set the names for the variables to be monitored.
585 
587 
588  else
589 
590  ! External; also lift and drag (total and viscous)
591  ! is monitored.
592 
593  nmonsum = 4; nmonmax = 0; nmon = 4
594  allocate (monnames(nmon), stat=ierr)
595  if (ierr /= 0) &
596  call terminate("defaultMonitor", &
597  "Memory allocation failure for monNames")
598 
599  ! Set the names for the variables to be monitored.
600 
602  monnames(2) = cgnscl
603  monnames(3) = cgnscd
604  monnames(4) = cgnscdv
605 
606  end if
607 
608  case (ransequations)
609 
610  ! Set the number of summation and maximum monitor variables
611  ! and allocate the memory for the monitoring names.
612  ! A distinction is made between internal and external flows,
613  ! because cl and cd do not make a lot of sense for the former.
614 
615  if (flowtype == internalflow) then
616 
617  ! Internal flow; the density residual as well as the
618  ! maximum values of yplus and the eddy viscosity ration
619  ! are monitored.
620 
621  nmonsum = 1; nmonmax = 2; nmon = 3
622  allocate (monnames(nmon), stat=ierr)
623  if (ierr /= 0) &
624  call terminate("defaultMonitor", &
625  "Memory allocation failure for monNames")
626 
627  ! Set the names for the variables to be monitored.
628 
631  monnames(3) = cgnseddymax
632 
633  else
634 
635  ! External; also lift and drag (total and viscous)
636  ! is monitored.
637 
638  nmonsum = 4; nmonmax = 2; nmon = 6
639  allocate (monnames(nmon), stat=ierr)
640  if (ierr /= 0) &
641  call terminate("defaultMonitor", &
642  "Memory allocation failure for monNames")
643 
644  ! Set the names for the variables to be monitored.
645 
647  monnames(2) = cgnscl
648  monnames(3) = cgnscd
649  monnames(4) = cgnscdv
651  monnames(6) = cgnseddymax
652 
653  end if
654 
655  end select
656 
657  end subroutine defaultmonitor
658  subroutine defaultsurfaceout
659  !
660  ! defaultSurfaceOut sets the default set of surface variables
661  ! to be written to the solution file. This set depends on the
662  ! governing equations to be solved.
663  !
664  use constants
665  use extraoutput
666  use inputphysics, only: equations
667  implicit none
668 
669  ! First set the variables, which are independent from the
670  ! governing equations to be solved.
671 
672  surfwriterho = .true.
673  surfwritep = .false.
674  surfwritetemp = .false.
675  surfwritevx = .true.
676  surfwritevy = .true.
677  surfwritevz = .true.
678  surfwritecp = .true.
679  surfwritemach = .true.
680 
681  ! Set the values which depend on the equations to be solved.
682 
683  select case (equations)
684  case (eulerequations)
685  surfwriteptotloss = .true.
686  surfwritecf = .false.
687  surfwritech = .false.
688  surfwriteyplus = .false.
689  surfwritecfx = .false.
690  surfwritecfy = .false.
691  surfwritecfz = .false.
692 
693  case (nsequations)
694  surfwriteptotloss = .false.
695  surfwritecf = .true.
696  surfwritech = .false.
697  surfwriteyplus = .false.
698  surfwritecfx = .true.
699  surfwritecfy = .true.
700  surfwritecfz = .true.
701 
702  case (ransequations)
703  surfwriteptotloss = .false.
704  surfwritecf = .true.
705  surfwritech = .false.
706  surfwriteyplus = .true.
707  surfwritecfx = .true.
708  surfwritecfy = .true.
709  surfwritecfz = .true.
710  end select
711 
712  end subroutine defaultsurfaceout
713  subroutine defaultvolumeout
714  !
715  ! defaultVolumeOut sets the default set of additional
716  ! variables to be written to the solution file; the primitive
717  ! variables are always written. This additional set depends on
718  ! the governing equations to be solved.
719  !
720  use constants
721  use extraoutput
722  use inputphysics, only: equations
723  implicit none
724 
725  ! First set the variables, which are independent from the
726  ! governing equations to be solved.
727 
728  volwritemx = .false.
729  volwritemy = .false.
730  volwritemz = .false.
731  volwriterhoe = .false.
732  volwritetemp = .false.
733  volwritecp = .false.
734  volwritemach = .false.
735  volwritemachturb = .false.
736  volwritedist = .false.
737  volwritevort = .false.
738  volwritevortx = .false.
739  volwritevorty = .false.
740  volwritevortz = .false.
741  volwriteptotloss = .true.
742  volwriteresrho = .true.
743  volwriteresmom = .false.
744  volwriteresrhoe = .false.
745 
746  ! Set the values which depend on the equations to be solved.
747 
748  select case (equations)
749  case (eulerequations)
750  volwriteeddyvis = .false.
751  volwriteratioeddyvis = .false.
752  volwriteresturb = .false.
753 
754  case (nsequations)
755  volwriteeddyvis = .false.
756  volwriteratioeddyvis = .false.
757  volwriteresturb = .false.
758 
759  case (ransequations)
760  volwriteeddyvis = .true.
761  volwriteratioeddyvis = .true.
762  volwriteresturb = .true.
763  end select
764 
765  end subroutine defaultvolumeout
766 
768  !
769  ! This subroutine is the same as readParamFile EXCEPT it does not
770  ! read the actual file. Values are set diectly from python for
771  ! all the options and then this file is run.
772  !
773  use constants
774  use inputphysics, only: cpmodel
775 
776  implicit none
777  !
778  ! Local variables
779  !
780  integer, parameter :: readUnit = 32
781 
782  ! Check if all the desired input parameters were specified and
783  ! print warnings if some irrelevant ones are specified.
784 
785  call checkinputparam
786 
787  ! Read the cp curve fits from file if a variable cp model
788  ! must be used.
789 
791 
792  ! Determine the number of governing equations and set the
793  ! corresponding parameters accordingly.
794 
796 
797  ! Extract the multigrid info from the string.
798 
799  call extractmginfo
800 
801  ! If no monitoring variables were specified, set the default set.
802  ! Idem for the surface and volume output variables.
803 
804  if (.not. monitorspecified) call defaultmonitor
805  if (.not. surfaceoutspecified) call defaultsurfaceout
806  if (.not. volumeoutspecified) call defaultvolumeout
807  if (.not. isooutspecified) call defaultisoout
808 
809  ! Check the monitoring and output variables.
810 
811  call checkmonitor
812  call checkoutput
813 
814  end subroutine dummyreadparamfile
815  subroutine extractmginfo
816  !
817  ! extractMgInfo creates the integer array cycleStrategy from
818  ! the string describing the multigrid strategy. This string
819  ! either contains a predefined strategy, like sg, 2v, 4w, etc.,
820  ! or a combination of -1's, 0's and 1's, which defines a user
821  ! defined strategy. The integers -1, 0 and 1 have the following
822  ! meaning: 0 -> perform an iteration step on the current grid.
823  ! 1 -> go to next coarser grid.
824  ! -1 -> go to next finer grid.
825  ! For a valid cycling strategy the sum of the elements of the
826  ! array should be 0.
827  !
828  use constants
830  use inputphysics, only: equationmode
832  use communication, only: myid
834  implicit none
835  !
836  ! Local variables
837  !
838  integer :: stringLen, error
839  integer(kind=intType) :: i, ii, nMinus, nn
840  character(len=maxStringLen) :: errorMessage
841 
842  ! For an unsteady computation using explicit Runge-Kutta schemes
843  ! overrule mgDescription to sg.
844 
845  if (equationmode == unsteady .and. &
847 
848  ! Create a lower case version of mgDescription and determine the
849  ! length of the string. Note that if the string contains a user
850  ! defined cycling strategy the contents (0's, 1's, -1's) is not
851  ! changed by the call to convertToLowerCase
852 
855  stringlen = len_trim(mgdescription)
856 
857  ! Check for predefined cycling strategies.
858 
859  if (mgdescription == "sg") then
860 
861  ! Single grid computation. Set the values for the parameters
862  ! nMGSteps (number of steps in the cycle strategy) and
863  ! cycleStrategy (the cycle strategy itself).
864 
865  nmgsteps = 1
866  allocate (cyclestrategy(1), stat=error)
867  if (error /= 0) call terminate("extractMgInfo", &
868  "allocation error for 1 integer")
869  cyclestrategy(1) = 0
870 
871  ! Set the number of grid levels needed by the multigrid to 1.
872 
873  nmglevels = 1
874 
875  else if (mgdescription(stringlen:stringlen) == "v") then
876 
877  ! Must be a v-cycle. The rest of the string should only contain
878  ! digits. Check this.
879 
880  if (.not. digitsonlyinstring(mgdescription(:stringlen - 1))) then
881  write (errormessage, *) "Invalid cycle strategy, ", &
882  mgdescription(:stringlen), ", specified"
883  if (myid == 0) call terminate("extractMgInfo", errormessage)
884  end if
885 
886  ! Read the number of levels in the cycle.
887 
888  read (mgdescription(:stringlen - 1), *) nmglevels
889 
890  ! Determine the number of steps in cycleStrategy and allocate
891  ! the memory for it.
892 
893  nmgsteps = 4 * nmglevels - 4
894  allocate (cyclestrategy(nmgsteps), stat=error)
895  if (error /= 0) then
896  write (errormessage, *) "Allocation error for", nmgsteps, &
897  "integers for the v-cycle ", &
898  mgdescription(:stringlen)
899  call terminate("extractMgInfo", errormessage)
900  end if
901 
902  ! Set the values of cycleStrategy.
903 
904  ii = 1
905  do i = 1, (nmglevels - 1)
906  cyclestrategy(ii) = 0
907  cyclestrategy(ii + 1) = 1
908  ii = ii + 2
909  end do
910 
911  do i = 1, (nmglevels - 1)
912  cyclestrategy(ii) = 0
913  cyclestrategy(ii + 1) = -1
914  ii = ii + 2
915  end do
916 
917  else if (mgdescription(stringlen:stringlen) == "w") then
918 
919  ! Must be a w-cycle. The rest of the string should only contain
920  ! digits. Check this.
921 
922  if (.not. digitsonlyinstring(mgdescription(:stringlen - 1))) then
923  write (errormessage, *) "Invalid cycle strategy, ", &
924  mgdescription(:stringlen), ", specified"
925  if (myid == 0) call terminate("extractMgInfo", errormessage)
926  end if
927 
928  ! Read the number of levels in the cycle.
929 
930  read (mgdescription(:stringlen - 1), *) nmglevels
931 
932  ! Determine the number of steps in cycleStrategy and allocate
933  ! the memory for it.
934 
936  allocate (cyclestrategy(nmgsteps), stat=error)
937  if (error /= 0) then
938  write (errormessage, *) "Allocation error for", nmgsteps, &
939  "integers for the w-cycle ", &
940  mgdescription(:stringlen)
941  call terminate("extractMgInfo", errormessage)
942  end if
943 
944  ! Set the values of cycleStrategy.
945 
946  ii = 1
947  call setentrieswcycle(ii, nmglevels)
948 
949  else
950 
951  ! The string must be a collection of 0's, -1's and 1's to
952  ! describe the cycle strategy. Get rid of the internal spaces
953  ! first and determine the amount of -'s.
954 
955  ii = 0
956  nminus = 0
957  do i = 1, stringlen
958  if (mgdescription(i:i) /= " ") then
959  ii = ii + 1
960  mgdescription(ii:ii) = mgdescription(i:i)
961  if (mgdescription(ii:ii) == "-") nminus = nminus + 1
962  end if
963  end do
964  stringlen = ii
965 
966  ! Determine the number of steps in the cycle strategy and
967  ! allocate the memory for it.
968 
969  nmgsteps = ii - nminus
970  allocate (cyclestrategy(nmgsteps), stat=error)
971  if (error /= 0) then
972  write (errormessage, *) "Allocation error for", nmgsteps, &
973  "integers for the cycle strategy"
974  call terminate("extractMgInfo", errormessage)
975  end if
976 
977  ! Determine the entries for cycleStrategy.
978 
979  i = 1
980  nn = 1
981  do
982  ii = i
983  if (mgdescription(i:i) == "-") i = i + 1
984 
985  ! Determine the case we are having here.
986 
987  select case (mgdescription(ii:i))
988  case ("0")
989  cyclestrategy(nn) = 0
990  case ("1")
991  cyclestrategy(nn) = 1
992  case ("-1")
993  cyclestrategy(nn) = -1
994  case default
995  write (errormessage, *) "Invalid character, ", &
996  mgdescription(ii:i), &
997  ", in the string describing &
998  &cycling strategy"
999  if (myid == 0) call terminate("extractMgInfo", errormessage)
1000  end select
1001 
1002  ! Update i and nn
1003 
1004  i = i + 1
1005  nn = nn + 1
1006 
1007  ! Exit the do loop in case i is larger than stringLen.
1008 
1009  if (i > stringlen) exit
1010  end do
1011 
1012  ! Check if the string specified is valid and determine the
1013  ! maximum grid level needed in the cycle.
1014 
1015  nn = 0
1016  nmglevels = 0
1017  do i = 1, nmgsteps
1018  nn = nn + cyclestrategy(i)
1019  nmglevels = max(nn, nmglevels)
1020  end do
1021  nmglevels = nmglevels + 1
1022 
1023  if (nn /= 0 .and. myid == 0) &
1024  call terminate("extractMgInfo", &
1025  "sum of coefficients in cycle strategy is not 0")
1026  end if
1027 
1028  ! Correct the value of mgStartlevel in case a nonpositive number
1029  ! has been specified. In that case it is set to -1, the default
1030  ! value.
1031 
1032  if (mgstartlevel <= 0) mgstartlevel = -1
1033 
1034  ! Determine the value of mgStartlevel. This parameter might be
1035  ! specified in the python script file and is checked here for
1036  ! consistency. If mgStartlevel has not been specified to any
1037  ! specific level it is set to the coarsest level in the mg cycle
1038  ! (starting from free stream) or to the finest level (restart).
1039  ! The restart is handled in python wrapper.
1040 
1041  if (mgstartlevel == -1) then
1042 
1043  ! Value has not been specified. Default value is set, see
1044  ! the comments above.
1046 
1047  end if
1048 
1049  end subroutine extractmginfo
1050 
1051  ! ==================================================================
1052 
1053  logical function digitsonlyinstring(string)
1054  !
1055  ! digitsOnlyInString checks whether the given string contains
1056  ! digits only or if other character types are present. In the
1057  ! former case the function returns .True., otherwise .False.
1058  !
1059  implicit none
1060  !
1061  ! Subroutine argument *
1062  !
1063  character(len=*), intent(in) :: string
1064  !
1065  ! Local variables
1066  !
1067  integer :: i, stringlen
1068 
1069  ! Initialize digitsOnlyInString to .True.
1070 
1071  digitsonlyinstring = .true.
1072 
1073  ! Determine the length of the string.
1074 
1075  stringlen = len_trim(string)
1076 
1077  ! Loop over the elements of the string and check if they are digits.
1078 
1079  do i = 1, stringlen
1080  if (string(i:i) < "0" .or. string(i:i) > "9") &
1081  digitsonlyinstring = .false.
1082  end do
1083 
1084  end function digitsonlyinstring
1085 
1086  ! ==================================================================
1087 
1088  recursive function computenstepswcycle(nLevels) result(nSteps)
1089  !
1090  ! computeNstepsWcycle is recursive function, which determines
1091  ! the number of entries of a w-cycle of a given level.
1092  !
1093  use constants
1094  use communication
1095  use utils, only: terminate
1096  implicit none
1097  !
1098  ! Result variable
1099  !
1100  integer(kind=intType) :: nsteps
1101  !
1102  ! Function argument
1103  !
1104  integer(kind=intType), intent(in) :: nlevels
1105  !
1106  ! Local variables
1107  !
1108  character(len=maxStringLen) :: errormessage
1109 
1110  ! Determine the case we are having here. For nLevels is less
1111  ! than 2 an error message is printed, in case nLevels is 2
1112  ! the recursion is broken and otherwise a recursive call is made.
1113 
1114  if (nlevels < 2) then
1115  write (errormessage, *) "Wrong value of nLevels", nlevels
1116  if (myid == 0) call terminate("computeNstepsWcycle", errormessage)
1117  else if (nlevels == 2) then
1118  nsteps = 4
1119  else
1120  nsteps = 4 + 2 * computenstepswcycle(nlevels - 1)
1121  end if
1122 
1123  end function computenstepswcycle
1124 
1125  ! ==================================================================
1126 
1127  recursive subroutine setentrieswcycle(counter, nLevels)
1128  !
1129  ! setEntriesWcycle is a recursive subroutine, which actually
1130  ! fills the entries of cycleStrategy for a w-cycle.
1131  !
1132  use constants
1133  use inputiteration, only: cyclestrategy
1134  use communication, only: myid
1135  use utils, only: terminate
1136  implicit none
1137  !
1138  ! Subroutine argument.
1139  !
1140  integer(kind=intType), intent(inout) :: counter
1141  integer(kind=intType), intent(in) :: nlevels
1142  !
1143  ! Local variables
1144  !
1145  character(len=maxStringLen) :: errormessage
1146 
1147  ! Determine the case we are having here. For nLevels is less
1148  ! than 2 an error message is printed, in case nLevels is 2
1149  ! the recursion is broken and otherwise a recursive call is made.
1150 
1151  if (nlevels < 2) then
1152 
1153  write (errormessage, *) "Wrong value of nLevels", nlevels
1154  if (myid == 0) call terminate("setEntriesWcycle", errormessage)
1155 
1156  else if (nlevels == 2) then
1157 
1158  cyclestrategy(counter) = 0
1159  cyclestrategy(counter + 1) = 1
1160  cyclestrategy(counter + 2) = 0
1161  cyclestrategy(counter + 3) = -1
1162 
1163  counter = counter + 4
1164 
1165  else
1166 
1167  cyclestrategy(counter) = 0
1168  cyclestrategy(counter + 1) = 1
1169  counter = counter + 2
1170 
1171  call setentrieswcycle(counter, nlevels - 1)
1172  call setentrieswcycle(counter, nlevels - 1)
1173 
1174  cyclestrategy(counter) = 0
1175  cyclestrategy(counter + 1) = -1
1176  counter = counter + 2
1177 
1178  end if
1179 
1180  end subroutine setentrieswcycle
1181  subroutine isovariables(variables)
1182  !
1183  ! isoVariables extracts from the given string the extra
1184  ! iso surface variables to be written to the solution file.
1185  !
1186  use constants
1187  use extraoutput
1188  use utils, only: converttolowercase, terminate
1189  implicit none
1190  !
1191  ! Subroutine arguments.
1192  !
1193  character(len=*), intent(inout) :: variables
1194  !
1195  ! Local variables.
1196  !
1197  integer :: nVarSpecified, pos
1198 
1199  character(len=15) :: keyword
1200  character(len=maxStringLen) :: errorMessage
1201 
1202  ! Convert the string variables to lower case.
1203 
1204  call converttolowercase(variables)
1205 
1206  ! Initialize all the iso output variables to .False.
1207  isowriterho = .false.
1208  isowritevx = .false.
1209  isowritevy = .false.
1210  isowritevz = .false.
1211  isowritep = .false.
1212  isowriteturb = .false.
1213 
1214  isowritemx = .false.
1215  isowritemy = .false.
1216  isowritemz = .false.
1217  isowriterhoe = .false.
1218  isowritetemp = .false.
1219  isowritevort = .false.
1220  isowritevortx = .false.
1221  isowritevorty = .false.
1222  isowritevortz = .false.
1223 
1224  isowritecp = .false.
1225  isowritemach = .false.
1226  isowritemachturb = .false.
1227  isowriteptotloss = .false.
1228 
1229  isowriteeddyvis = .false.
1230  isowriteratioeddyvis = .false.
1231  isowritedist = .false.
1232 
1233  isowriteresrho = .false.
1234  isowriteresmom = .false.
1235  isowriteresrhoe = .false.
1236  isowriteresturb = .false.
1237 
1238  isowriteshock = .false.
1239  isowritefilteredshock = .false.
1240 
1241  isowriteblank = .false.
1242 
1243  ! Initialize nVarSpecified to 0. This serves as a test
1244  ! later on.
1245 
1246  nvarspecified = 0
1247 
1248  ! Loop to extract the info from the string variables.
1249 
1250  do
1251  ! Condition to exit the loop.
1252 
1253  if (len_trim(variables) == 0) exit
1254 
1255  ! Locate the first occurance of the _ in the string and
1256  ! determine the string keyword.
1257 
1258  pos = index(variables, "_")
1259  if (pos == 0) then
1260  keyword = variables
1261  variables = ""
1262  else
1263  keyword = variables(:pos - 1)
1264  variables = variables(pos + 1:)
1265  end if
1266 
1267  ! Check the keyword.
1268 
1269  select case (keyword)
1270  case ("")
1271  ! Multiple occurence of "_". Just ignore it.
1272 
1273  case ("rho")
1274  isowriterho = .true.
1275  nvarspecified = nvarspecified + 1
1276 
1277  case ("vx")
1278  isowritevx = .true.
1279  nvarspecified = nvarspecified + 1
1280 
1281  case ("vy")
1282  isowritevy = .true.
1283  nvarspecified = nvarspecified + 1
1284 
1285  case ("vz")
1286  isowritevz = .true.
1287  nvarspecified = nvarspecified + 1
1288 
1289  case ("P")
1290  isowritep = .true.
1291  nvarspecified = nvarspecified + 1
1292 
1293  case ("turb")
1294  isowriteturb = .true.
1295  nvarspecified = nvarspecified + 1
1296 
1297  case ("mx")
1298  isowritemx = .true.
1299  nvarspecified = nvarspecified + 1
1300 
1301  case ("my")
1302  isowritemy = .true.
1303  nvarspecified = nvarspecified + 1
1304 
1305  case ("mz")
1306  isowritemz = .true.
1307  nvarspecified = nvarspecified + 1
1308 
1309  case ("rvx")
1310  isowritervx = .true.
1311  nvarspecified = nvarspecified + 1
1312 
1313  case ("rvy")
1314  isowritervy = .true.
1315  nvarspecified = nvarspecified + 1
1316 
1317  case ("rvz")
1318  isowritervz = .true.
1319  nvarspecified = nvarspecified + 1
1320 
1321  case ("rhoe")
1322  isowriterhoe = .true.
1323  nvarspecified = nvarspecified + 1
1324 
1325  case ("temp")
1326  isowritetemp = .true.
1327  nvarspecified = nvarspecified + 1
1328 
1329  case ("vort")
1330  isowritevort = .true.
1331  nvarspecified = nvarspecified + 1
1332 
1333  case ("vortx")
1334  isowritevortx = .true.
1335  nvarspecified = nvarspecified + 1
1336 
1337  case ("vorty")
1338  isowritevorty = .true.
1339  nvarspecified = nvarspecified + 1
1340 
1341  case ("vortz")
1342  isowritevortz = .true.
1343  nvarspecified = nvarspecified + 1
1344 
1345  case ("cp")
1346  isowritecp = .true.
1347  nvarspecified = nvarspecified + 1
1348 
1349  case ("mach")
1350  isowritemach = .true.
1351  nvarspecified = nvarspecified + 1
1352 
1353  case ("rmach")
1354  isowritermach = .true.
1355  nvarspecified = nvarspecified + 1
1356 
1357  case ("macht")
1358  isowritemachturb = .true.
1359  nvarspecified = nvarspecified + 1
1360 
1361  case ("ptloss")
1362  isowriteptotloss = .true.
1363  nvarspecified = nvarspecified + 1
1364 
1365  case ("eddy")
1366  isowriteeddyvis = .true.
1367  nvarspecified = nvarspecified + 1
1368 
1369  case ("eddyratio")
1370  isowriteratioeddyvis = .true.
1371  nvarspecified = nvarspecified + 1
1372 
1373  case ("dist")
1374  isowritedist = .true.
1375  nvarspecified = nvarspecified + 1
1376 
1377  case ("resrho")
1378  isowriteresrho = .true.
1379  nvarspecified = nvarspecified + 1
1380 
1381  case ("resmom")
1382  isowriteresmom = .true.
1383  nvarspecified = nvarspecified + 1
1384 
1385  case ("resrhoe")
1386  isowriteresrhoe = .true.
1387  nvarspecified = nvarspecified + 1
1388 
1389  case ("resturb")
1390  isowriteresturb = .true.
1391  nvarspecified = nvarspecified + 1
1392 
1393  case ("blank")
1394  isowriteblank = .true.
1395  nvarspecified = nvarspecified + 1
1396 
1397  case ("shock")
1398  isowriteshock = .true.
1399  nvarspecified = nvarspecified + 1
1400 
1401  case ("filteredshock")
1402  isowritefilteredshock = .true.
1403  nvarspecified = nvarspecified + 1
1404 
1405  case default
1406  pos = len_trim(keyword)
1407  write (errormessage, "(3a)") "Unknown extra iso output &
1408  &variable, ", trim(keyword), &
1409  ", specified"
1410  call terminate("isoVariables", errormessage)
1411 
1412  end select
1413 
1414  end do
1415 
1416  ! Set this to true regardless...it is possible no varibles were
1417  ! specified
1418  isooutspecified = .true.
1419 
1420  end subroutine isovariables
1421 
1422  subroutine monitorvariables(variables)
1423  !
1424  ! monitorVariables extracts from the given string the variables
1425  ! to be monitored during the convergence.
1426  !
1427  use constants
1428  use cgnsnames
1430  use monitor, only: monnames, nmon, nmonmax, nmonsum, showcpu
1431  use utils, only: converttolowercase, terminate
1432  implicit none
1433  !
1434  ! Subroutine arguments.
1435  !
1436  character(len=*), intent(inout) :: variables
1437  !
1438  ! Local parameter.
1439  !
1440  integer(kind=intType), parameter :: nVarMax = 21
1441  !
1442  ! Local variables.
1443  !
1444  integer :: pos, ierr
1445 
1446  character(len=15) :: keyword
1447  character(len=maxStringLen) :: errorMessage
1448 
1449  character(len=maxCGNSNameLen), dimension(nVarMax) :: tmpNames
1450 
1451  logical :: monDrho, monTotalR
1452 
1453  ! Check if the monitoring names have already been allocated.
1454  ! This happens when multiple lines for the monitoring variables
1455  ! are specified in the parameter file. If this happens the last
1456  ! value is taken and thus release the memory of previously
1457  ! specified names.
1458 
1459  if (allocated(monnames)) then
1460  deallocate (monnames, stat=ierr)
1461  if (ierr /= 0) call terminate("monitorVariables", &
1462  "Deallocation error for monNames")
1463  end if
1464 
1465  ! Initialize monDrho, monDturb and showCPU to .false.
1466 
1467  mondrho = .false.
1468  montotalr = .false.
1469  mondturb = .false.
1470  showcpu = .false.
1471 
1472  ! Initialize nMonSum, nMonMax and nMon to 0.
1473 
1474  nmonsum = 0
1475  nmonmax = 0
1476  nmon = 0
1477 
1478  ! Convert the string variables to lower case.
1479 
1480  call converttolowercase(variables)
1481 
1482  ! Loop to extract the info from the string variables.
1483 
1484  do
1485  ! Condition to exit the loop.
1486 
1487  if (len_trim(variables) == 0) exit
1488 
1489  ! Locate the first occurance of the _ in the string and
1490  ! determine the string keyword.
1491 
1492  pos = index(variables, "_")
1493  if (pos == 0) then
1494  keyword = variables
1495  variables = ""
1496  else
1497  keyword = variables(:pos - 1)
1498  variables = variables(pos + 1:)
1499  end if
1500 
1501  ! Check the keyword.
1502 
1503  select case (keyword)
1504  case ("")
1505  ! Multiple occurence of "_". Just ignore it.
1506 
1507  case ("cpu") ! only written to stdout.
1508  showcpu = .true.
1509 
1510  case ("resrho")
1511  mondrho = .true.
1512  nmon = nmon + 1; nmonsum = nmonsum + 1
1513  tmpnames(nmon) = cgnsl2resrho
1514 
1515  case ("resmom")
1516  nmon = nmon + 3; nmonsum = nmonsum + 3
1517  tmpnames(nmon - 2) = cgnsl2resmomx
1518  tmpnames(nmon - 1) = cgnsl2resmomy
1519  tmpnames(nmon) = cgnsl2resmomz
1520 
1521  case ("resrhoe")
1522  nmon = nmon + 1; nmonsum = nmonsum + 1
1523  tmpnames(nmon) = cgnsl2resrhoe
1524 
1525  case ("resturb") ! special case, because the turbulence model
1526  ! Is not yet known. See checkMonitor.
1527  mondturb = .true.
1528 
1529  case ("cl")
1530  nmon = nmon + 1; nmonsum = nmonsum + 1
1531  tmpnames(nmon) = cgnscl
1532 
1533  case ("clp")
1534  nmon = nmon + 1; nmonsum = nmonsum + 1
1535  tmpnames(nmon) = cgnsclp
1536 
1537  case ("clv")
1538  nmon = nmon + 1; nmonsum = nmonsum + 1
1539  tmpnames(nmon) = cgnsclv
1540 
1541  case ("cd")
1542  nmon = nmon + 1; nmonsum = nmonsum + 1
1543  tmpnames(nmon) = cgnscd
1544 
1545  case ("cdp")
1546  nmon = nmon + 1; nmonsum = nmonsum + 1
1547  tmpnames(nmon) = cgnscdp
1548 
1549  case ("cdv")
1550  nmon = nmon + 1; nmonsum = nmonsum + 1
1551  tmpnames(nmon) = cgnscdv
1552 
1553  case ("cfx")
1554  nmon = nmon + 1; nmonsum = nmonsum + 1
1555  tmpnames(nmon) = cgnscfx
1556 
1557  case ("cfy")
1558  nmon = nmon + 1; nmonsum = nmonsum + 1
1559  tmpnames(nmon) = cgnscfy
1560 
1561  case ("cfz")
1562  nmon = nmon + 1; nmonsum = nmonsum + 1
1563  tmpnames(nmon) = cgnscfz
1564 
1565  case ("cmx")
1566  nmon = nmon + 1; nmonsum = nmonsum + 1
1567  tmpnames(nmon) = cgnscmx
1568 
1569  case ("cmy")
1570  nmon = nmon + 1; nmonsum = nmonsum + 1
1571  tmpnames(nmon) = cgnscmy
1572 
1573  case ("cmz")
1574  nmon = nmon + 1; nmonsum = nmonsum + 1
1575  tmpnames(nmon) = cgnscmz
1576 
1577  case ("hdiff")
1578  nmon = nmon + 1; nmonmax = nmonmax + 1
1579  tmpnames(nmon) = cgnshdiffmax
1580 
1581  case ("mach")
1582  nmon = nmon + 1; nmonmax = nmonmax + 1
1583  tmpnames(nmon) = cgnsmachmax
1584 
1585  case ("yplus")
1586  nmon = nmon + 1; nmonmax = nmonmax + 1
1587  tmpnames(nmon) = cgnsyplusmax
1588 
1589  case ("eddyv")
1590  nmon = nmon + 1; nmonmax = nmonmax + 1
1591  tmpnames(nmon) = cgnseddymax
1592 
1593  case ("totalr")
1594  montotalr = .true.
1595  nmon = nmon + 1; nmonsum = nmonsum + 1
1596  tmpnames(nmon) = 'totalR'
1597 
1598  case ("sepsensor")
1599  nmon = nmon + 1; nmonsum = nmonsum + 1
1600  tmpnames(nmon) = cgnssepsensor
1601 
1602  case ("SepSensorKsArea")
1603  nmon = nmon + 1; nmonsum = nmonsum + 1
1604  tmpnames(nmon) = cgnssepsensorksarea
1605 
1606  case ("cavitation")
1607  nmon = nmon + 1; nmonsum = nmonsum + 1
1608  tmpnames(nmon) = cgnscavitation
1609 
1610  case ("axismoment")
1611  nmon = nmon + 1; nmonsum = nmonsum + 1
1612  tmpnames(nmon) = cgnsaxismoment
1613 
1614  case default
1615  write (errormessage, "(3a)") "Unknown monitoring variable, ", &
1616  trim(keyword), ", specified"
1617  if (myid == 0) &
1618  call terminate("monitorVariables", errormessage)
1619  call mpi_barrier(adflow_comm_world, ierr)
1620 
1621  end select
1622 
1623  end do
1624 
1625  ! If the density residual was not specified to be monitored,
1626  ! add it to tmpNames.
1627 
1628  if (.not. mondrho) then
1629  nmon = nmon + 1; nmonsum = nmonsum + 1
1630  tmpnames(nmon) = cgnsl2resrho
1631  end if
1632 
1633  ! If the total residual was not specified to be monitored, add
1634  ! it to tmpNames.
1635 
1636  if (.not. montotalr) then
1637  nmon = nmon + 1; nmonsum = nmonsum + 1
1638  tmpnames(nmon) = "totalR"
1639  end if
1640 
1641  ! Allocate the memory for monNames. If the turbulent residuals
1642  ! must be monitored allocate some extra place.
1643 
1644  pos = nmon
1645  if (mondturb) pos = nmon + 4
1646  allocate (monnames(pos), stat=ierr)
1647  if (ierr /= 0) &
1648  call terminate("monitorVariables", &
1649  "Memory allocation failure for monNames")
1650 
1651  ! Copy the monitoring names into monNames.
1652 
1653  do pos = 1, nmon
1654  monnames(pos) = tmpnames(pos)
1655  end do
1656 
1657  ! Set monitorSpecified to .true. to indicate that monitoring
1658  ! variables have been specified.
1659 
1660  monitorspecified = .true.
1661 
1662  end subroutine monitorvariables
1664  !
1665  ! readCpTempCurveFits reads the curve fits for the cp as a
1666  ! function of the temperature from the file cpFile.
1667  !
1668  use constants
1670  use cpcurvefits, only: cptrange, cptempfit, cpeint, cphint, cvn, cv0, &
1671  cpnparts
1672  use inputio, only: cpfile
1673  use utils, only: terminate
1674  implicit none
1675 
1676  ! Local variables.
1677 
1678  integer, parameter :: readUnit = 32
1679 
1680  integer :: ios, ierr
1681 
1682  integer(kind=intType) :: nn, mm, kk, ii
1683  real(kind=realtype) :: t1, t2, e0
1684 
1685  character(len=2*maxStringLen) :: errorMessage
1686  character(len=512) :: string
1687 
1688  ! Open the file for reading and check if it went okay. If the file
1689  ! is not found, processor 0 prints an error message.
1690 
1691  open (unit=readunit, file=cpfile, status="old", &
1692  action="read", iostat=ios)
1693 
1694  if (ios /= 0) then
1695 
1696  write (errormessage, *) "Cp curve fit file ", trim(cpfile), &
1697  " not found."
1698  if (myid == 0) &
1699  call terminate("readCpTempCurveFits", errormessage)
1700 
1701  call mpi_barrier(adflow_comm_world, ierr)
1702  end if
1703 
1704  ! Skip the comment lines and read the number of parts.
1705  ! Check if a valid number is read.
1706 
1707  call findnextinfoline(readunit, string)
1708  read (string, *) cpnparts
1709 
1710  if (cpnparts <= 0) then
1711  if (myid == 0) &
1712  call terminate("readCpTempCurveFits", &
1713  "Wrong number of temperature ranges in &
1714  &Cp curve fit file.")
1715  call mpi_barrier(adflow_comm_world, ierr)
1716  end if
1717 
1718  ! Allocate the memory for the variables to store the curve fit
1719  ! data.
1720 
1721  allocate (cptrange(0:cpnparts), cpeint(0:cpnparts), &
1723  stat=ierr)
1724  if (ierr /= 0) &
1725  call terminate("readCpTempCurveFits", &
1726  "Memory allocation failure for cpTrange, &
1727  &cpEint, cpHint and cpTempFit")
1728 
1729  ! Loop over the number of temperature ranges.
1730 
1731  nranges: do nn = 1, cpnparts
1732 
1733  ! Find the next line with information and read the temperature
1734  ! range.
1735 
1736  call findnextinfoline(readunit, string)
1737  read (string, *) t1, t2
1738 
1739  ! If this is the first range, set the temperature range;
1740  ! otherwise check if the lower boundary equals the upper
1741  ! boundary of the previous range.
1742 
1743  if (nn == 1) then
1744  cptrange(0) = t1
1745  cptrange(1) = t2
1746  else
1747  cptrange(nn) = t2
1748 
1749  if (t1 /= cptrange(nn - 1)) then
1750  if (myid == 0) &
1751  call terminate("readCpTempCurveFits", &
1752  "Curve fit boundary not continuous")
1753  call mpi_barrier(adflow_comm_world, ierr)
1754  end if
1755  end if
1756 
1757  ! Read the number of points in the fit.
1758 
1759  call findnextinfoline(readunit, string)
1760  read (string, *) cptempfit(nn)%nterm
1761 
1762  ! Allocate the memory for the exponents and the constants.
1763 
1764  ii = cptempfit(nn)%nterm
1765  allocate (cptempfit(nn)%exponents(ii), &
1766  cptempfit(nn)%constants(ii), stat=ierr)
1767  if (ierr /= 0) &
1768  call terminate("readCpTempCurveFits", &
1769  "Memory allocation failure for exponents and &
1770  &constants")
1771 
1772  ! Read the exponents from the file.
1773 
1774  call findnextinfoline(readunit, string)
1775  do ii = 1, cptempfit(nn)%nterm
1776 
1777  ! Read the exponent from the string.
1778 
1779  read (string, *) cptempfit(nn)%exponents(ii)
1780 
1781  ! Remove this value from the string if this is not the
1782  ! last exponent to be read.
1783 
1784  if (ii < cptempfit(nn)%nterm) then
1785  ios = index(string, " ")
1786  if (ios > 0) then
1787  string = string(ios:)
1788  string = adjustl(string)
1789  string = trim(string)
1790  else
1791  if (myid == 0) &
1792  call terminate("readCpTempCurveFits", &
1793  "Not enough exponents on line; &
1794  &Cp curve fit file not valid.")
1795  call mpi_barrier(adflow_comm_world, ierr)
1796  end if
1797  end if
1798  end do
1799 
1800  ! Read the constants from the file.
1801 
1802  call findnextinfoline(readunit, string)
1803  do ii = 1, cptempfit(nn)%nterm
1804 
1805  ! Read the constant from the string.
1806 
1807  read (string, *) cptempfit(nn)%constants(ii)
1808 
1809  ! Remove this value from the string if this is not the
1810  ! last constant to be read.
1811 
1812  if (ii < cptempfit(nn)%nterm) then
1813  ios = index(string, " ")
1814  if (ios > 0) then
1815  string = string(ios:)
1816  string = adjustl(string)
1817  string = trim(string)
1818  else
1819  if (myid == 0) &
1820  call terminate("readCpTempCurveFits", &
1821  "Not enough constants on line; &
1822  &Cp curve fit file not valid.")
1823  call mpi_barrier(adflow_comm_world, ierr)
1824  end if
1825  end if
1826  end do
1827 
1828  end do nranges
1829 
1830  ! Close the file
1831 
1832  close (unit=readunit)
1833  !
1834  ! Compute the constants eint0, such that the internal energy is
1835  ! a continous function of the temperature.
1836  !
1837  ! First for the first interval, such that at T = 0 Kelvin the
1838  ! energy is also zero.
1839 
1840  t1 = cptrange(0)
1841  cv0 = -one ! cv/R = cp/R - 1.0
1842  e0 = -t1 ! e = integral of cv, not of cp.
1843 
1844  do ii = 1, cptempfit(1)%nterm
1845 
1846  ! Update cv0.
1847 
1848  t2 = t1**(cptempfit(1)%exponents(ii))
1849  cv0 = cv0 + cptempfit(1)%constants(ii) * t2
1850 
1851  ! Update e0, for which this contribution must be integrated.
1852  ! Take the exceptional case exponent is -1 into account.
1853 
1854  if (cptempfit(1)%exponents(ii) == -1_inttype) then
1855  e0 = e0 + cptempfit(1)%constants(ii) * log(t1)
1856  else
1857  t2 = t1 * t2
1858  e0 = e0 + cptempfit(1)%constants(ii) * t2 &
1859  / (cptempfit(1)%exponents(ii) + 1)
1860  end if
1861 
1862  end do
1863 
1864  ! Set the value of the internal energy at the temperature T1.
1865  ! Cv is assumed to be constant in the temperature range 0 - T1.
1866  ! Idem for the internal enthalpy.
1867 
1868  cpeint(0) = cv0 * t1
1869  cphint(0) = cpeint(0) + t1
1870 
1871  ! Compute the integration constant for the energy.
1872 
1873  cptempfit(1)%eint0 = cpeint(0) - e0
1874 
1875  ! Loop over the other temperature ranges to compute their
1876  ! integration constant and the energy at the curve fit boundary.
1877 
1878  nranges2: do nn = 2, cpnparts
1879 
1880  ! Store nn-1, the previous temperature range, in mm.
1881 
1882  mm = nn - 1
1883 
1884  ! Store the temperature at the interface a bit easier.
1885 
1886  t1 = cptrange(mm)
1887 
1888  ! First compute the internal energy (scaled by r) from the
1889  ! previous range. Actually not the energy but the enthalpy is
1890  ! computed. This leads to the same integraton constant.
1891  ! Again check for exponent -1 when integrating.
1892 
1893  e0 = cptempfit(mm)%eint0
1894 
1895  do ii = 1, cptempfit(mm)%nterm
1896  if (cptempfit(mm)%exponents(ii) == -1_inttype) then
1897  e0 = e0 + cptempfit(mm)%constants(ii) * log(t1)
1898  else
1899  kk = cptempfit(mm)%exponents(ii) + 1
1900  t2 = t1**kk
1901  e0 = e0 + cptempfit(mm)%constants(ii) * t2 / kk
1902  end if
1903  end do
1904 
1905  ! Store the enthalpy and energy at the curve fit boundary.
1906  ! Remember that cp was integrated.
1907 
1908  cphint(mm) = e0
1909  cpeint(mm) = e0 - t1
1910 
1911  ! Substract the part coming from the integration of cp/r of
1912  ! the range nn.
1913 
1914  do ii = 1, cptempfit(nn)%nterm
1915  if (cptempfit(nn)%exponents(ii) == -1_inttype) then
1916  e0 = e0 - cptempfit(nn)%constants(ii) * log(t1)
1917  else
1918  kk = cptempfit(nn)%exponents(ii) + 1
1919  t2 = t1**kk
1920  e0 = e0 - cptempfit(nn)%constants(ii) * t2 / kk
1921  end if
1922  end do
1923 
1924  ! Store the integration constant for the range nn.
1925 
1926  cptempfit(nn)%eint0 = e0
1927 
1928  end do nranges2
1929 
1930  ! Compute the values of cv and the internal energy at the upper
1931  ! boundary of the curve fit. This is needed for the extrapolation
1932  ! of the energy if states occur with a higher temperature than
1933  ! the validness of the curve fits.
1934 
1935  ! First initialize these values.
1936 
1937  nn = cpnparts
1938  t1 = cptrange(nn)
1939  cvn = -one ! cv/R = cp/R - 1.0
1940  e0 = cptempfit(nn)%eint0 - t1 ! e = integral of cv, not of cp.
1941 
1942  do ii = 1, cptempfit(nn)%nterm
1943 
1944  ! Update cvn.
1945 
1946  t2 = t1**(cptempfit(nn)%exponents(ii))
1947  cvn = cvn + cptempfit(nn)%constants(ii) * t2
1948 
1949  ! Update e0, for which this contribution must be integrated.
1950  ! Take the exceptional case exponent is -1 into account.
1951 
1952  if (cptempfit(nn)%exponents(ii) == -1_inttype) then
1953  e0 = e0 + cptempfit(nn)%constants(ii) * log(t1)
1954  else
1955  e0 = e0 + cptempfit(nn)%constants(ii) * t2 * t1 &
1956  / (cptempfit(nn)%exponents(ii) + 1)
1957  end if
1958 
1959  end do
1960 
1961  ! Store e0 correctly.
1962 
1963  cpeint(nn) = e0
1964  cphint(nn) = e0 + t1
1965 
1966  ! Compute the values of the integrands of cp/(R*T) at the lower
1967  ! and upper curve fit boundary. This is needed to compute the
1968  ! total pressure. This cannot be done with a single integration
1969  ! constant, because of the singularity at T = 0.
1970 
1971  nranges3: do nn = 1, cpnparts
1972 
1973  ! Store the temperatures of the lower and upper boundary a
1974  ! bit easier.
1975 
1976  t1 = cptrange(nn - 1)
1977  t2 = cptrange(nn)
1978 
1979  ! Initializes the integrands to zero.
1980 
1981  cptempfit(nn)%intCpovrT_1 = zero
1982  cptempfit(nn)%intCpovrT_2 = zero
1983 
1984  ! Loop over the number of terms of the curve fits and compute
1985  ! the integral cp/(r*t).
1986 
1987  do ii = 1, cptempfit(nn)%nterm
1988 
1989  ! Store the coefficient a bit easier in mm. As the integral
1990  ! of cp/(R*T) must be computed, this is also the exponent
1991  ! of the primitive function; except of course when the exponent
1992  ! is 0.
1993 
1994  mm = cptempfit(nn)%exponents(ii)
1995 
1996  ! Update the integrands if the temperature is larger than
1997  ! 0 kelvin. In case the boundary is 0 kelvin the value is not
1998  ! needed anyway.
1999 
2000  if (t1 > zero) then
2001  if (mm == 0_inttype) then
2002  cptempfit(nn)%intCpovrT_1 = cptempfit(nn)%intCpovrT_1 &
2003  + cptempfit(nn)%constants(ii) * log(t1)
2004  else
2005  cptempfit(nn)%intCpovrT_1 = cptempfit(nn)%intCpovrT_1 &
2006  + (cptempfit(nn)%constants(ii) * t1**mm) / mm
2007  end if
2008  end if
2009 
2010  if (t2 > zero) then
2011  if (mm == 0_inttype) then
2012  cptempfit(nn)%intCpovrT_2 = cptempfit(nn)%intCpovrT_2 &
2013  + cptempfit(nn)%constants(ii) * log(t2)
2014  else
2015  cptempfit(nn)%intCpovrT_2 = cptempfit(nn)%intCpovrT_2 &
2016  + (cptempfit(nn)%constants(ii) * t2**mm) / mm
2017  end if
2018  end if
2019 
2020  end do
2021 
2022  end do nranges3
2023 
2024  end subroutine readcptempcurvefits
2025 
2026  ! ==================================================================
2027 
2028  subroutine findnextinfoline(readUnit, string)
2029  !
2030  ! findNextInfoLine skips the comment lines in the given unit
2031  ! and finds the first line containing information.
2032  !
2033  use communication
2034  use utils, only: terminate
2035  implicit none
2036  !
2037  ! Subroutine arguments
2038  !
2039  integer, intent(in) :: readUnit
2040  character(len=512), intent(out) :: string
2041  !
2042  ! Local variables.
2043  !
2044  integer :: ios, ierr
2045 
2046  ! Loop to skip the comment lines.
2047 
2048  do
2049  read (unit=readunit, fmt="(a512)", iostat=ios) string
2050 
2051  ! Test if everything went okay.
2052 
2053  if (ios /= 0) then
2054  if (myid == 0) &
2055  call terminate("findNextInfoLine", &
2056  "Unexpected end of Cp curve fit file")
2057  call mpi_barrier(adflow_comm_world, ierr)
2058  end if
2059 
2060  ! Get rid of the leading and trailing spaces in string.
2061 
2062  string = adjustl(string)
2063  string = trim(string)
2064 
2065  ! Check if this is the correct line. If so, exit
2066 
2067  if ((len_trim(string) > 0) .and. (string(:1) /= "#")) exit
2068  end do
2069 
2070  end subroutine findnextinfoline
2071 
2073  !
2074  ! setEquationParameters sets the number of variables in the
2075  ! governing equations, the number of turbulent variables, etc.
2076  !
2077  use constants
2078  use paramturb
2079  use turbcurvefits
2080  use flowvarrefstate, only: nw, nwf, nt1, nt2, nwt, viscous, &
2083  implicit none
2084 
2085  ! Set the number of flow variables to 5, nt1 to 6. This is valid
2086  ! for all governing equations. Furthermore initialize viscous,
2087  ! kPresent and eddyModel to .False., which indicates an inviscid
2088  ! computation. For ns and rans this will be corrected.
2089 
2090  nwf = 5
2091  nt1 = 6
2092 
2093  viscous = .false.
2094  kpresent = .false.
2095  eddymodel = .false.
2096 
2097  ! Determine the set of governing equations to solve for and set
2098  ! the parameters accordingly.
2099 
2100  select case (equations)
2101  case (eulerequations)
2102  nw = 5
2103  nt2 = 5
2104 
2105  !===============================================================
2106 
2107  case (nsequations)
2108  nw = 5
2109  nt2 = 5
2110 
2111  viscous = .true.
2112 
2113  !===============================================================
2114 
2115  case (ransequations)
2116 
2117  viscous = .true.
2118 
2119  select case (turbmodel)
2120 
2121  case (spalartallmaras)
2122  nw = 6
2123  nt2 = 6
2124 
2125  eddymodel = .true.
2127 
2128  !===========================================================
2129 
2130  case (spalartallmarasedwards)
2131  nw = 6
2132  nt2 = 6
2133 
2134  eddymodel = .true.
2136 
2137  !===========================================================
2138 
2139  case (komegawilcox)
2140  nw = 7
2141  nt2 = 7
2142 
2143  kpresent = .true.
2144  eddymodel = .true.
2146 
2147  !===========================================================
2148 
2149  case (komegamodified)
2150  nw = 7
2151  nt2 = 7
2152 
2153  kpresent = .true.
2154  eddymodel = .true.
2156 
2157  !===========================================================
2158 
2159  case (mentersst)
2160  nw = 7
2161  nt2 = 7
2162 
2163  kpresent = .true.
2164  eddymodel = .true.
2166 
2167  !===========================================================
2168 
2169  case (ktau)
2170  nw = 7
2171  nt2 = 7
2172 
2173  kpresent = .true.
2174  eddymodel = .true.
2176 
2177  !===========================================================
2178 
2179  case (v2f)
2180  nw = 9
2181  nt2 = 9
2182 
2183  rvflimitk = 1.e-25_realtype
2184  rvflimite = 1.e-25_realtype
2185 
2186  if (rvfn == 6) then
2187  rvfcmu = rvfn6cmu
2188  rvfcl = rvfn6cl
2189  else
2190  rvfcmu = rvfn1cmu
2191  rvfcl = rvfn1cl
2192  end if
2193 
2194  kpresent = .true.
2195  eddymodel = .true.
2197 
2198  end select
2199 
2200  end select
2201 
2202  ! Determine the number of turbulent variables.
2203 
2204  nwt = nw - nwf
2205 
2206  end subroutine setequationparameters
2208  !
2209  ! setStageCoeffExplicitRK determines the coefficients of the
2210  ! stages for the explicit Runge Kutta time integration schemes
2211  ! for unsteady problems.
2212  !
2213  use constants
2216  use utils, only: terminate
2217  implicit none
2218  !
2219  ! Local variables.
2220  !
2221  integer :: ierr
2222 
2223  ! Determine the number of Runge Kutta stages as a function of
2224  ! the accuracy.
2225 
2226  select case (timeaccuracy)
2227  case (firstorder)
2228  nrkstagesunsteady = 1
2229 
2230  case (secondorder)
2231  nrkstagesunsteady = 2
2232 
2233  case (thirdorder)
2234  nrkstagesunsteady = 3
2235 
2236  case default
2237  call terminate("setStageCoeffExplicitRK", &
2238  "No higher order stuff yet")
2239  end select
2240 
2241  ! Allocate and determine betaRKUnsteady and gammaRKUnsteady.
2242 
2244  gammarkunsteady(nrkstagesunsteady), stat=ierr)
2245  if (ierr /= 0) &
2246  call terminate("setStageCoeffExplicitRK", &
2247  "Memory allocation failure for betaRKUnsteady &
2248  &and gammaRKUnsteady.")
2249 
2251 
2252  select case (timeaccuracy)
2253  case (firstorder)
2254 
2255  ! Just the forward Euler time integration scheme.
2256 
2257  betarkunsteady(1, 1) = 1.0_realtype
2258  gammarkunsteady(1) = 0.0_realtype
2259 
2260  !==============================================================
2261 
2262  case (secondorder)
2263 
2264  ! The TVD Runge Kutta scheme which allows for the maximum
2265  ! CFL number (1.0).
2266 
2267  betarkunsteady(1, 1) = 1.0_realtype
2268  betarkunsteady(2, 1) = -0.5_realtype
2269  betarkunsteady(2, 2) = 0.5_realtype
2270 
2271  gammarkunsteady(1) = 0.0_realtype
2272  gammarkunsteady(2) = 1.0_realtype
2273 
2274  !==============================================================
2275 
2276  case (thirdorder)
2277 
2278  ! Low storage (although not exploited in this implemetation)
2279  ! 3 stage scheme of Le and Moin.
2280 
2281  betarkunsteady(1, 1) = 8.0_realtype / 15.0_realtype
2282  betarkunsteady(2, 1) = -17.0_realtype / 60.0_realtype
2283  betarkunsteady(2, 2) = 5.0_realtype / 12.0_realtype
2284  betarkunsteady(3, 2) = -5.0_realtype / 12.0_realtype
2285  betarkunsteady(3, 3) = 3.0_realtype / 4.0_realtype
2286 
2287  gammarkunsteady(1) = 0.0_realtype
2288  gammarkunsteady(2) = 8.0_realtype / 15.0_realtype
2289  gammarkunsteady(3) = 2.0_realtype / 3.0_realtype
2290 
2291  ! The TVD Runge Kutta scheme which allows for the maximum
2292  ! CFL number (1.0).
2293 
2294  ! betaRKUnsteady(1,1) = 1.0_realType
2295  ! betaRKUnsteady(2,1) = -3.0_realType/ 4.0_realType
2296  ! betaRKUnsteady(2,2) = 1.0_realType/ 4.0_realType
2297  ! betaRKUnsteady(3,1) = -1.0_realType/12.0_realType
2298  ! betaRKUnsteady(3,2) = -1.0_realType/12.0_realType
2299  ! betaRKUnsteady(3,3) = 2.0_realType/ 3.0_realType
2300 
2301  ! gammaRKUnsteady(1) = 0.0_realType
2302  ! gammaRKUnsteady(2) = 1.0_realType
2303  ! gammaRKUnsteady(3) = 0.5_realType
2304 
2305  !==============================================================
2306 
2307  case default
2308  call terminate("setStageCoeffExplicitRK", &
2309  "No higher order stuff yet")
2310  end select
2311 
2312  end subroutine setstagecoeffexplicitrk
2313  subroutine surfacevariables(variables)
2314  !
2315  ! surfaceVariables extracts from the given string the surface
2316  ! variables to be written to the solution file.
2317  !
2318  use constants
2319  use extraoutput
2320  use utils, only: converttolowercase, terminate
2321  implicit none
2322  !
2323  ! Subroutine arguments.
2324  !
2325  character(len=*), intent(inout) :: variables
2326  !
2327  ! Local variables.
2328  !
2329  integer :: nVarSpecified, pos
2330 
2331  character(len=15) :: keyword
2332  character(len=maxStringLen) :: errorMessage
2333 
2334  ! Convert the string variables to lower case.
2335 
2336  call converttolowercase(variables)
2337 
2338  ! Initialize all the surface output variables to .false.
2339 
2340  surfwriterho = .false.
2341  surfwritep = .false.
2342  surfwritetemp = .false.
2343  surfwritevx = .false.
2344  surfwritevy = .false.
2345  surfwritevz = .false.
2346  surfwritervx = .false.
2347  surfwritervy = .false.
2348  surfwritervz = .false.
2349 
2350  surfwritecp = .false.
2351  surfwriteptotloss = .false.
2352  surfwritemach = .false.
2353  surfwritermach = .false.
2354 
2355  surfwritecf = .false.
2356  surfwritech = .false.
2357  surfwriteyplus = .false.
2358  surfwritecfx = .false.
2359  surfwritecfy = .false.
2360  surfwritecfz = .false.
2361  surfwriteforceindragdir = .false.
2362  surfwriteforceinliftdir = .false.
2363 
2364  surfwriteblank = .false.
2365  surfwritesepsensor = .false.
2366  surfwritesepsensorks = .false.
2367  surfwritesepsensorksarea = .false.
2368  surfwritecavitation = .false.
2369  surfwriteaxismoment = .false.
2370  surfwritegc = .false.
2371 
2372  ! Initialize nVarSpecified to 0. This serves as a test
2373  ! later on.
2374 
2375  nvarspecified = 0
2376 
2377  ! Loop to extract the info from the string variables.
2378 
2379  do
2380  ! Condition to exit the loop.
2381 
2382  if (len_trim(variables) == 0) exit
2383 
2384  ! Locate the first occurance of the _ in the string and
2385  ! determine the string keyword.
2386 
2387  pos = index(variables, "_")
2388  if (pos == 0) then
2389  keyword = variables
2390  variables = ""
2391  else
2392  keyword = variables(:pos - 1)
2393  variables = variables(pos + 1:)
2394  end if
2395 
2396  ! Check the keyword.
2397 
2398  select case (keyword)
2399  case ("")
2400  ! Multiple occurence of "_". Just ignore it.
2401 
2402  case ("rho")
2403  surfwriterho = .true.
2404  nvarspecified = nvarspecified + 1
2405 
2406  case ("p")
2407  surfwritep = .true.
2408  nvarspecified = nvarspecified + 1
2409 
2410  case ("temp")
2411  surfwritetemp = .true.
2412  nvarspecified = nvarspecified + 1
2413 
2414  case ("vx")
2415  surfwritevx = .true.
2416  nvarspecified = nvarspecified + 1
2417 
2418  case ("vy")
2419  surfwritevy = .true.
2420  nvarspecified = nvarspecified + 1
2421 
2422  case ("vz")
2423  surfwritevz = .true.
2424  nvarspecified = nvarspecified + 1
2425 
2426  case ("rvx")
2427  surfwritervx = .true.
2428  nvarspecified = nvarspecified + 1
2429 
2430  case ("rvy")
2431  surfwritervy = .true.
2432  nvarspecified = nvarspecified + 1
2433 
2434  case ("rvz")
2435  surfwritervz = .true.
2436  nvarspecified = nvarspecified + 1
2437 
2438  case ("cp")
2439  surfwritecp = .true.
2440  nvarspecified = nvarspecified + 1
2441 
2442  case ("ptloss")
2443  surfwriteptotloss = .true.
2444  nvarspecified = nvarspecified + 1
2445 
2446  case ("mach")
2447  surfwritemach = .true.
2448  nvarspecified = nvarspecified + 1
2449 
2450  case ("rmach")
2451  surfwritermach = .true.
2452  nvarspecified = nvarspecified + 1
2453 
2454  case ("cf")
2455  surfwritecf = .true.
2456  nvarspecified = nvarspecified + 1
2457 
2458  case ("ch")
2459  surfwritech = .true.
2460  nvarspecified = nvarspecified + 1
2461 
2462  case ("yplus")
2463  surfwriteyplus = .true.
2464  nvarspecified = nvarspecified + 1
2465 
2466  case ("cfx")
2467  surfwritecfx = .true.
2468  nvarspecified = nvarspecified + 1
2469 
2470  case ("cfy")
2471  surfwritecfy = .true.
2472  nvarspecified = nvarspecified + 1
2473 
2474  case ("cfz")
2475  surfwritecfz = .true.
2476  nvarspecified = nvarspecified + 1
2477 
2478  case ("forceindragdir")
2479  surfwriteforceindragdir = .true.
2480  nvarspecified = nvarspecified + 1
2481 
2482  case ("forceinliftdir")
2483  surfwriteforceinliftdir = .true.
2484  nvarspecified = nvarspecified + 1
2485 
2486  case ("blank")
2487  surfwriteblank = .true.
2488  nvarspecified = nvarspecified + 1
2489 
2490  case ("sepsensor")
2491  surfwritesepsensor = .true.
2492  nvarspecified = nvarspecified + 1
2493 
2494  case ("sepsensorks")
2495  surfwritesepsensorks = .true.
2496  nvarspecified = nvarspecified + 1
2497 
2498  case ("sepsensorksarea")
2499  surfwritesepsensorksarea = .true.
2500  nvarspecified = nvarspecified + 1
2501 
2502  case ("cavitation")
2503  surfwritecavitation = .true.
2504  nvarspecified = nvarspecified + 1
2505 
2506  case ("axismoment")
2507  surfwriteaxismoment = .true.
2508  nvarspecified = nvarspecified + 1
2509 
2510  case ("gc")
2511  surfwritegc = .true.
2512  nvarspecified = nvarspecified + 1
2513 
2514  case default
2515  pos = len_trim(keyword)
2516  write (errormessage, "(3a)") "Unknown surface output &
2517  &variable, ", trim(keyword), &
2518  ", specified"
2519  call terminate("surfaceVariables", errormessage)
2520 
2521  end select
2522 
2523  end do
2524 
2525  ! Set surfaceOutSpecified to .true. if variables were specified.
2526  ! If not, later on the defaults will be set.
2527 
2528  if (nvarspecified > 0) surfaceoutspecified = .true.
2529 
2530  end subroutine surfacevariables
2531 
2532  subroutine volumevariables(variables)
2533  !
2534  ! volumeVariables extracts from the given string the extra
2535  ! volume variables to be written to the solution file.
2536  !
2537  use constants
2538  use extraoutput
2539  use utils, only: converttolowercase, terminate
2540  implicit none
2541  !
2542  ! Subroutine arguments.
2543  !
2544  character(len=*), intent(inout) :: variables
2545  !
2546  ! Local variables.
2547  !
2548  integer :: nVarSpecified, pos
2549 
2550  character(len=15) :: keyword
2551  character(len=maxStringLen) :: errorMessage
2552 
2553  ! Convert the string variables to lower case.
2554 
2555  call converttolowercase(variables)
2556 
2557  ! Initialize all the volume output variables to .False.
2558 
2559  volwritemx = .false.
2560  volwritemy = .false.
2561  volwritemz = .false.
2562  volwriterhoe = .false.
2563  volwritetemp = .false.
2564  volwritevort = .false.
2565  volwritevortx = .false.
2566  volwritevorty = .false.
2567  volwritevortz = .false.
2568 
2569  volwritecp = .false.
2570  volwritemach = .false.
2571  volwritemachturb = .false.
2572  volwriteptotloss = .false.
2573 
2574  volwriteeddyvis = .false.
2575  volwriteratioeddyvis = .false.
2576  volwritedist = .false.
2577 
2578  volwriteresrho = .false.
2579  volwriteresmom = .false.
2580  volwriteresrhoe = .false.
2581  volwriteresturb = .false.
2582 
2583  volwriteshock = .false.
2584  volwritefilteredshock = .false.
2585 
2586  volwriteblank = .false.
2587  volwritegc = .false.
2588  volwritestatus = .false.
2589  volwriteintermittency = .false.
2590 
2591  ! Initialize nVarSpecified to 0. This serves as a test
2592  ! later on.
2593 
2594  nvarspecified = 0
2595 
2596  ! Loop to extract the info from the string variables.
2597 
2598  do
2599  ! Condition to exit the loop.
2600 
2601  if (len_trim(variables) == 0) exit
2602 
2603  ! Locate the first occurance of the _ in the string and
2604  ! determine the string keyword.
2605 
2606  pos = index(variables, "_")
2607  if (pos == 0) then
2608  keyword = variables
2609  variables = ""
2610  else
2611  keyword = variables(:pos - 1)
2612  variables = variables(pos + 1:)
2613  end if
2614 
2615  ! Check the keyword.
2616 
2617  select case (keyword)
2618  case ("")
2619  ! Multiple occurence of "_". Just ignore it.
2620 
2621  case ("mx")
2622  volwritemx = .true.
2623  nvarspecified = nvarspecified + 1
2624 
2625  case ("my")
2626  volwritemy = .true.
2627  nvarspecified = nvarspecified + 1
2628 
2629  case ("mz")
2630  volwritemz = .true.
2631  nvarspecified = nvarspecified + 1
2632 
2633  case ("rvx")
2634  volwritervx = .true.
2635  nvarspecified = nvarspecified + 1
2636 
2637  case ("rvy")
2638  volwritervy = .true.
2639  nvarspecified = nvarspecified + 1
2640 
2641  case ("rvz")
2642  volwritervz = .true.
2643  nvarspecified = nvarspecified + 1
2644 
2645  case ("rhoe")
2646  volwriterhoe = .true.
2647  nvarspecified = nvarspecified + 1
2648 
2649  case ("temp")
2650  volwritetemp = .true.
2651  nvarspecified = nvarspecified + 1
2652 
2653  case ("vort")
2654  volwritevort = .true.
2655  nvarspecified = nvarspecified + 1
2656 
2657  case ("vortx")
2658  volwritevortx = .true.
2659  nvarspecified = nvarspecified + 1
2660 
2661  case ("vorty")
2662  volwritevorty = .true.
2663  nvarspecified = nvarspecified + 1
2664 
2665  case ("vortz")
2666  volwritevortz = .true.
2667  nvarspecified = nvarspecified + 1
2668 
2669  case ("cp")
2670  volwritecp = .true.
2671  nvarspecified = nvarspecified + 1
2672 
2673  case ("mach")
2674  volwritemach = .true.
2675  nvarspecified = nvarspecified + 1
2676 
2677  case ("rmach")
2678  volwritermach = .true.
2679  nvarspecified = nvarspecified + 1
2680 
2681  case ("macht")
2682  volwritemachturb = .true.
2683  nvarspecified = nvarspecified + 1
2684 
2685  case ("ptloss")
2686  volwriteptotloss = .true.
2687  nvarspecified = nvarspecified + 1
2688 
2689  case ("eddy")
2690  volwriteeddyvis = .true.
2691  nvarspecified = nvarspecified + 1
2692 
2693  case ("eddyratio")
2694  volwriteratioeddyvis = .true.
2695  nvarspecified = nvarspecified + 1
2696 
2697  case ("dist")
2698  volwritedist = .true.
2699  nvarspecified = nvarspecified + 1
2700 
2701  case ("resrho")
2702  volwriteresrho = .true.
2703  nvarspecified = nvarspecified + 1
2704 
2705  case ("resmom")
2706  volwriteresmom = .true.
2707  nvarspecified = nvarspecified + 1
2708 
2709  case ("resrhoe")
2710  volwriteresrhoe = .true.
2711  nvarspecified = nvarspecified + 1
2712 
2713  case ("resturb")
2714  volwriteresturb = .true.
2715  nvarspecified = nvarspecified + 1
2716 
2717  case ("shock")
2718  volwriteshock = .true.
2719  nvarspecified = nvarspecified + 1
2720 
2721  case ("filteredshock")
2722  volwritefilteredshock = .true.
2723  nvarspecified = nvarspecified + 1
2724 
2725  case ("blank")
2726  volwriteblank = .true.
2727  nvarspecified = nvarspecified + 1
2728 
2729  case ("gc")
2730  volwritegc = .true.
2731  nvarspecified = nvarspecified + 1
2732 
2733  case ("status")
2734  volwritestatus = .true.
2735  nvarspecified = nvarspecified + 1
2736 
2737  case ("intermittency")
2738  volwriteintermittency = .true.
2739  nvarspecified = nvarspecified + 1
2740 
2741  case default
2742  pos = len_trim(keyword)
2743  write (errormessage, "(3a)") "Unknown extra volume output &
2744  &variable, ", trim(keyword), &
2745  ", specified"
2746  call terminate("volumeVariables", errormessage)
2747 
2748  end select
2749 
2750  end do
2751 
2752  ! Set volumeOutSpecified to .true. if variables were specified.
2753  ! If not, later on the defaults will be set.
2754 
2755  if (nvarspecified > 0) volumeoutspecified = .true.
2756 
2757  end subroutine volumevariables
2758 
2759  subroutine checkinputparam
2760  !
2761  ! checkInputParam checks if all necessary data has been
2762  ! specified. If some key data is missing an error message will
2763  ! be printed and the program will exit. Key data depends on the
2764  ! case to be solved. E.g. for the Navier Stokes equations it is
2765  ! necessary to specify the Reynolds number, but for Euler this
2766  ! can be omitted.
2767  ! Furthermore warnings are printed in case parameters have been
2768  ! specified that are ignored, e.g. Mach number for internal flow
2769  ! computations.
2770  ! Note that only processor 0 prints warning and error messages,
2771  ! such that the output does not become messy.
2772  !
2773  use constants
2774  ! --------- Bare imports...too many to list -------
2776  use inputio
2777  use inputiteration
2778  use inputmotion
2779  use inputoverset
2780  use inputparallel
2781  use inputphysics
2782  use inputtimespectral
2783  use inputunsteady
2784  use inputadjoint
2785  use inputtsstabderiv
2786  ! ------------------------------------------------
2788  use iteration, only: coeftime, coeftimeale, coefmeshale, &
2790  use monitor, only: ntimestepsrestart
2791  use utils, only: terminate
2792  implicit none
2793  !
2794  ! Local variables
2795  !
2796  integer :: ierr
2797 
2798  integer(kind=intType) :: nn, oldSolWrittenSize
2799 
2800  real(kind=realtype) :: veclength, dot
2801 
2802  logical :: gridPrecisionWarning, solPrecisionWarning
2803 
2804  ! Discretization parameters. Check if the key parameters have
2805  ! been specified and set some coarse grid parameters in case
2806  ! these have not been specified.
2807  !
2808  if (spacediscr == none) then
2809  if (myid == 0) &
2810  call terminate("checkInputParam", &
2811  "Discretization scheme not specified")
2812  call mpi_barrier(adflow_comm_world, ierr)
2813  end if
2814 
2816 
2818 
2819  ! Set dirScaling to .false. if a scheme other than scalar
2820  ! dissipation is used.
2821 
2822  if (spacediscr /= dissscalar) dirscaling = .false.
2823 
2824  ! Determine whether or not the spectral radIi are needed for
2825  ! the flux computations.
2826 
2827  radiineededfine = .false.
2828  if (spacediscr == dissscalar) radiineededfine = .true.
2829 
2830  radiineededcoarse = .false.
2832  !
2833  ! IO parameters. Check if the grid file has been specified
2834  ! Possibly correct the
2835  ! value of restart. Note that restart got the default value of
2836  ! .true. in case no restart file has been specified it is now
2837  ! set to false. Set the names of the solution files if not
2838  ! specified and check if a cp curve fit file has been specified
2839  ! if curve fits must be used.
2840  ! If the code has been compiled without cgns check that the file
2841  ! format is not cgns.
2842  ! Overwrite storeConvInnerIter to .true. if this is not an
2843  ! unsteady computation.
2844  !
2845  if (gridfile == "") then
2846  if (myid == 0) &
2847  call terminate("checkInputParam", "Grid file not specified")
2848  call mpi_barrier(adflow_comm_world, ierr)
2849  end if
2850 
2851  if (newgridfile == "") then
2852  newgridfile = "NewGrid.cgns"
2853  end if
2854 
2855  if (solfile == "") then
2856  solfile = "SolADflow.cgns"
2857  end if
2858 
2859  if (surfacesolfile == "") &
2860  surfacesolfile = trim(solfile)//"Surface"
2861 
2862  if (cpmodel == cptempcurvefits .and. cpfile == "") then
2863  if (myid == 0) &
2864  call terminate("checkInputParam", &
2865  "Cp curve fit file not specified")
2866  call mpi_barrier(adflow_comm_world, ierr)
2867  end if
2868 
2869 #ifdef USE_NO_CGNS
2870 
2871  if (fileformatread == cgnsformat .or. &
2872  fileformatwrite == cgnsformat) then
2873  if (myid == 0) &
2874  call terminate("checkInputParam", &
2875  "cgns support disabled during compile time")
2876  call mpi_barrier(adflow_comm_world, ierr)
2877  end if
2878 
2879 #endif
2880 
2881  if (equationmode == unsteady) then
2883  storeconvinneriter = .false.
2884  end if
2885  !
2886  ! Iteration parameters. Check if the key parameters have specified
2887  ! been and set some coarse grid parameters in case these
2888  ! have not been specified.
2889  !
2890  if (equationmode == unsteady .and. &
2892  smoother = none
2893  else
2894  if (smoother == none) then
2895  if (myid == 0) &
2896  call terminate("checkInputParam", "Smoother not specified")
2897  call mpi_barrier(adflow_comm_world, ierr)
2898  end if
2899 
2900  if (ncycles < 0) then
2901  if (myid == 0) &
2902  call terminate("checkInputParam", &
2903  "Number of multigrid cycles not or wrongly &
2904  &specified")
2905  call mpi_barrier(adflow_comm_world, ierr)
2906  end if
2907 
2908  if (cfl < zero) then
2909  if (myid == 0) &
2910  call terminate("checkInputParam", &
2911  "cfl number not or wrongly specified")
2912  call mpi_barrier(adflow_comm_world, ierr)
2913  end if
2914 
2915  if (l2conv <= zero .or. l2conv >= one) then
2916  if (myid == 0) &
2917  call terminate("checkInputParam", &
2918  "Relative L2 norm for convergence must be a &
2919  & number between 0 and 1.")
2920  call mpi_barrier(adflow_comm_world, ierr)
2921  end if
2922 
2923  if (l2convcoarse <= zero .or. l2convcoarse >= one) then
2924  if (myid == 0) &
2925  call terminate("checkInputParam", &
2926  "Relative L2 norm for convergence coarse grid &
2927  &must be a number between 0 and 1.")
2928  call mpi_barrier(adflow_comm_world, ierr)
2929  end if
2930  end if
2931  !
2932  ! Grid motion parameters. These can only be specified for an
2933  ! external flow problem.
2934  !
2935  if (flowtype == internalflow .and. gridmotionspecified) then
2936  if (myid == 0) &
2937  call terminate("checkInputParam", &
2938  "Grid motion specified for an internal flow; &
2939  &this is not possible")
2940  call mpi_barrier(adflow_comm_world, ierr)
2941  end if
2942  !
2943  ! Physics parameters. Check if the key parameters have been
2944  ! specified and set the unit vector for the free-stream velocity.
2945  !
2946  if (equations == none) then
2947  if (myid == 0) &
2948  call terminate("checkInputParam", "Equations not specified")
2949  call mpi_barrier(adflow_comm_world, ierr)
2950  end if
2951 
2952  if (equationmode == none) then
2953  if (myid == 0) &
2954  call terminate("checkInputParam", "Mode not specified")
2955  call mpi_barrier(adflow_comm_world, ierr)
2956  end if
2957 
2958  if (flowtype == none) then
2959  if (myid == 0) &
2960  call terminate("checkInputParam", "Flow type not specified")
2961  call mpi_barrier(adflow_comm_world, ierr)
2962  end if
2963 
2964  if (mach < zero .and. flowtype == externalflow) then
2965  if (myid == 0) &
2966  call terminate("checkInputParam", &
2967  "Mach not or wrongly specified")
2968  call mpi_barrier(adflow_comm_world, ierr)
2969  end if
2970 
2971  if (equations == ransequations .and. turbmodel == none) then
2972  if (myid == 0) &
2973  call terminate("checkInputParam", &
2974  "Turbulence model not specified")
2975  call mpi_barrier(adflow_comm_world, ierr)
2976  end if
2977 
2978  ! Create a unit vector for the free stream velocity. It is checked
2979  ! if the vector specified is a valid one. If not processor 0 prints
2980  ! an error message. Only for external flows.
2981 
2982  if (flowtype == externalflow) then
2983  veclength = sqrt(veldirfreestream(1) * veldirfreestream(1) &
2986  if (veclength < eps) then
2987  if (myid == 0) &
2988  call terminate("checkInputParam", &
2989  "Free stream velocity direction wrongly &
2990  &specified")
2991  call mpi_barrier(adflow_comm_world, ierr)
2992  end if
2993 
2994  veclength = one / veclength
2995  veldirfreestream(1) = veldirfreestream(1) * veclength
2996  veldirfreestream(2) = veldirfreestream(2) * veclength
2997  veldirfreestream(3) = veldirfreestream(3) * veclength
2998  else
2999  ! Internal flow; simply reset the velocity direction. The value
3000  ! will be determined later from the inflow boundary conditions.
3001 
3002  veldirfreestream(1) = one
3003  veldirfreestream(2) = zero
3004  veldirfreestream(3) = zero
3005  end if
3006 
3007  ! Set the drag direction to the velocity direction.
3008 
3010 
3011  ! Check the lift direction if it was specified for an external
3012  ! flow. Otherwise set the default direction.
3013 
3014  if (liftdirspecified .and. flowtype == externalflow) then
3015 
3016  ! Create a unit vector. Perform the same check as for
3017  ! for the free stream velocity direction.
3018 
3019  veclength = sqrt(liftdirection(1) * liftdirection(1) &
3020  + liftdirection(2) * liftdirection(2) &
3021  + liftdirection(3) * liftdirection(3))
3022  if (veclength < eps) then
3023  if (myid == 0) &
3024  call terminate("checkInputParam", &
3025  "Lift direction wrongly specified")
3026  call mpi_barrier(adflow_comm_world, ierr)
3027  end if
3028 
3029  veclength = one / veclength
3030  liftdirection(1) = liftdirection(1) * veclength
3031  liftdirection(2) = liftdirection(2) * veclength
3032  liftdirection(3) = liftdirection(3) * veclength
3033 
3034  ! Check the orthogonality with the drag direction.
3035 
3036  dot = liftdirection(1) * dragdirection(1) &
3037  + liftdirection(2) * dragdirection(2) &
3038  + liftdirection(3) * dragdirection(3)
3039 
3040  if (abs(dot) > 1.e-3_realtype) then
3041  if (myid == 0) &
3042  call terminate("checkInputParam", &
3043  "Lift direction not orthogonal to &
3044  &free-stream")
3045  call mpi_barrier(adflow_comm_world, ierr)
3046  end if
3047 
3048  else
3049 
3050  ! Lift direction not specified. Set the default direction.
3051  ! It will have a zero component in the y-direction and a positive
3052  ! one in the z-direction.
3053 
3054  liftdirection(1) = -dragdirection(3)
3055  liftdirection(2) = zero
3057 
3058  if (liftdirection(3) < zero) then
3059  liftdirection(1) = -liftdirection(1)
3060  liftdirection(3) = -liftdirection(3)
3061  end if
3062  end if
3063 
3064  ! Set the Mach number for the coefficients equal to the Mach
3065  ! number if it was not specified. For internal flow field this
3066  ! will again be changed in initFlo.
3067 
3068  if (machcoef < zero) machcoef = mach
3069  !
3070  ! Time spectral parameters. They only need to be specified for a
3071  ! time spectral computation.
3072  !
3073  testspectral: if (equationmode == timespectral) then
3074 
3075  ! Check if the number of time intervals was specified.
3076 
3077  if (ntimeintervalsspectral < 0) then
3078  if (myid == 0) &
3079  call terminate("checkInputParam", &
3080  "Number time intervals spectral not or &
3081  &wrongly specified")
3082  call mpi_barrier(adflow_comm_world, ierr)
3083  end if
3084 
3085  ! If an unsteady restart solution file must be written, check
3086  ! if the corresponding time step has been specified.
3087 
3089  if (dtunsteadyrestartspectral <= zero) then
3090  if (myid == 0) &
3091  call terminate("checkInputParam", &
3092  "Time step (in sec) for unsteady restart &
3093  &not or wrongly specified.")
3094  call mpi_barrier(adflow_comm_world, ierr)
3095  end if
3096  end if
3097 
3098  ! If solution files (for postprocessing) must be written,
3099  ! check if the number has been specified.
3100 
3101  if (writeunsteadyvolspectral .or. &
3103  if (nunsteadysolspectral <= 0) then
3104  if (myid == 0) &
3105  call terminate("checkInputParam", &
3106  "Number of unsteady solution files &
3107  &not or wrongly specified.")
3108  call mpi_barrier(adflow_comm_world, ierr)
3109  end if
3110  end if
3111 
3112  else testspectral
3113 
3114  ! No spectral method. Set nTimeIntervalsSpectral to 1.
3115 
3117 
3118  end if testspectral
3119  !
3120  ! Unsteady parameters. They only need to be specified for an
3121  ! unsteady computation.
3122  !
3123  testunsteady: if (equationmode == unsteady) then
3124 
3125  ! Physical time step parameters.
3126 
3127  if (ntimestepsfine < 0) then
3128  if (myid == 0) &
3129  call terminate("checkInputParam", &
3130  "Number of unsteady time steps fine grid &
3131  &not or wrongly specified")
3132  call mpi_barrier(adflow_comm_world, ierr)
3133  end if
3134 
3136 
3137  if (deltat < 0) then
3138  if (myid == 0) &
3139  call terminate("checkInputParam", &
3140  "Unsteady time step (in sec) &
3141  &not or wrongly specified")
3142  call mpi_barrier(adflow_comm_world, ierr)
3143  end if
3144 
3145  ! Check if the rigid body rotation parameters are consistent.
3146  ! The polynomial rotation coefficients.
3147 
3148  if (degreepolxrot >= 0 .and. &
3149  .not. allocated(coefpolxrot)) then
3150  if (myid == 0) &
3151  call terminate("checkInputParam", &
3152  "Polynomial coefficients x-rotation &
3153  &not specified")
3154  call mpi_barrier(adflow_comm_world, ierr)
3155  end if
3156 
3157  if (degreepolyrot >= 0 .and. &
3158  .not. allocated(coefpolyrot)) then
3159  if (myid == 0) &
3160  call terminate("checkInputParam", &
3161  "Polynomial coefficients y-rotation &
3162  &not specified")
3163  call mpi_barrier(adflow_comm_world, ierr)
3164  end if
3165 
3166  if (degreepolzrot >= 0 .and. &
3167  .not. allocated(coefpolzrot)) then
3168  if (myid == 0) &
3169  call terminate("checkInputParam", &
3170  "Polynomial coefficients z-rotation &
3171  &not specified")
3172  call mpi_barrier(adflow_comm_world, ierr)
3173  end if
3174 
3175  ! The fourier rotation coefficients.
3176 
3177  if (degreefourxrot >= 0 .and. &
3178  .not. allocated(coscoeffourxrot)) then
3179  if (myid == 0) &
3180  call terminate("checkInputParam", &
3181  "Fourier cosine coefficients x-rotation &
3182  &not specified")
3183  call mpi_barrier(adflow_comm_world, ierr)
3184  end if
3185 
3186  if (degreefourxrot >= 1 .and. &
3187  .not. allocated(sincoeffourxrot)) then
3188  if (myid == 0) &
3189  call terminate("checkInputParam", &
3190  "Fourier sine coefficients x-rotation &
3191  &not specified")
3192  call mpi_barrier(adflow_comm_world, ierr)
3193  end if
3194 
3195  if (degreefouryrot >= 0 .and. &
3196  .not. allocated(coscoeffouryrot)) then
3197  if (myid == 0) &
3198  call terminate("checkInputParam", &
3199  "Fourier cosine coefficients y-rotation &
3200  &not specified")
3201  call mpi_barrier(adflow_comm_world, ierr)
3202  end if
3203 
3204  if (degreefouryrot >= 1 .and. &
3205  .not. allocated(sincoeffouryrot)) then
3206  if (myid == 0) &
3207  call terminate("checkInputParam", &
3208  "Fourier sine coefficients y-rotation &
3209  &not specified")
3210  call mpi_barrier(adflow_comm_world, ierr)
3211  end if
3212 
3213  if (degreefourzrot >= 0 .and. &
3214  .not. allocated(coscoeffourzrot)) then
3215  if (myid == 0) &
3216  call terminate("checkInputParam", &
3217  "Fourier cosine coefficients z-rotation &
3218  &not specified")
3219  call mpi_barrier(adflow_comm_world, ierr)
3220  end if
3221 
3222  if (degreefourzrot >= 1 .and. &
3223  .not. allocated(sincoeffourzrot)) then
3224  if (myid == 0) &
3225  call terminate("checkInputParam", &
3226  "Fourier sine coefficients z-rotation &
3227  &not specified")
3228  call mpi_barrier(adflow_comm_world, ierr)
3229  end if
3230 
3231  end if testunsteady
3232  !
3233  ! Warning messages.
3234  !
3235  ! Check for an invisid problem if the Reynolds number is specified.
3236  ! If so, print a Warning that this info is ignored.
3237 
3238  if (myid == 0 .and. equations == eulerequations .and. &
3239  reynolds > zero) then
3240 
3241  print "(a)", "#"
3242  print "(a)", "# Warning"
3243  print "(a)", "# Reynolds number specified for the Euler &
3244  &equations."
3245  print "(a)", "# This information is ignored."
3246  print "(a)", "#"
3247 
3248  end if
3249 
3250  ! Check if the Mach and Reynolds number are specified for an
3251  ! internal flow problem. If so, print a Warning message that this
3252  ! info is ignored.
3253 
3254  if (flowtype == internalflow) then
3255 
3256  ! Check whether a viscous or an inviscid problem is to be solved.
3257  ! For an inviscid problem you do not want to mention that the
3258  ! Reynolds number is ignored, because this has already been
3259  ! taken care of.
3260 
3261  if ((equations == nsequations .or. &
3262  equations == ransequations) .and. &
3263  mach > zero .and. reynolds > zero) then
3264 
3265  ! Viscous problem, where both the Mach and Reynolds were
3266  ! specified. Processor 0 prints the Warning.
3267 
3268  if (myid == 0) then
3269  print "(a)", "#"
3270  print "(a)", "# Warning"
3271  print "(a)", "# Mach and Reynolds number specified &
3272  &for an internal flow problem."
3273  print "(a)", "# This information is ignored."
3274  print "(a)", "#"
3275  end if
3276 
3277  else if (mach > zero) then
3278 
3279  ! The Mach number has been specified. Processor 0 prints
3280  ! a Warning.
3281 
3282  if (myid == 0) then
3283  print "(a)", "#"
3284  print "(a)", "# Warning"
3285  print "(a)", "# Mach number specified for an internal &
3286  &flow problem."
3287  print "(a)", "# This information is ignored."
3288  print "(a)", "#"
3289  end if
3290 
3291  end if
3292 
3293  end if
3294 
3295  ! For a steady computation possible specified rigid body
3296  ! rotation info is ignored. Processor 0 will print the Warning.
3297 
3298  if (degreepolxrot >= 0 .or. degreepolyrot >= 0 .or. &
3299  degreepolzrot >= 0 .or. degreefourxrot >= 0 .or. &
3300  degreefouryrot >= 0 .or. degreefourzrot >= 0) then
3301 
3302  if (equationmode == steady .and. myid == 0) then
3303  print "(a)", "#"
3304  print "(a)", "# Warning"
3305  print "(a)", "# Rigid body rotation info specified for &
3306  &a steady computation."
3307  print "(a)", "# This information is ignored."
3308  print "(a)", "#"
3309  end if
3310  end if
3311 
3312  ! Print warning messages if the precision to be written
3313  ! is larger than the precision used in the computation.
3314 
3315  gridprecisionwarning = .false.
3316  solprecisionwarning = .false.
3317 
3318 #ifdef USE_SINGLE_PRECISION
3319  if (precisiongrid == precisiondouble) gridprecisionwarning = .true.
3320  if (precisionsol == precisiondouble) solprecisionwarning = .true.
3321 #endif
3322 
3323  if (gridprecisionwarning .and. myid == 0) then
3324  print "(a)", "#"
3325  print "(a)", "# Warning"
3326  print "(a)", "# Precision of the grid file to write is &
3327  &bigger than used in the computation."
3328  print "(a)", "# This does not make sense and is a waste &
3329  &of disk space"
3330  print "(a)", "#"
3331  end if
3332 
3333  if (solprecisionwarning .and. myid == 0) then
3334  print "(a)", "#"
3335  print "(a)", "# Warning"
3336  print "(a)", "# Precision of the solution file to write is &
3337  &bigger than used in the computation."
3338  print "(a)", "# This does not make sense and is a waste &
3339  &of disk space"
3340  print "(a)", "#"
3341  end if
3342  !
3343  ! Wall functions can only be used if the RANS equations are to
3344  ! be solved. If no wall functions are used the wall offset is
3345  ! set to zero.
3346  !
3347  if (equations /= ransequations) wallfunctions = .false.
3348  if (.not. wallfunctions) walloffset = zero
3349  !
3350  ! Check whether or not the wall distance is needed for the
3351  ! turbulence model.
3352  !
3353  if (equations == ransequations) then
3354 
3355  ! RANS simulation. Determine if the turbulence model is
3356  ! wall distance free. Note that updateWallDistanceUnsteady is
3357  ! NOT overruled, because this is just the case for which this
3358  ! parameter was intended.
3359 
3360  select case (turbmodel)
3362 
3363  ! Wall distance free turbulence models.
3364 
3365  walldistanceneeded = .false.
3366 
3367  !=============================================================
3368 
3369  case default
3370 
3371  ! The turbulence model needs the wall distance
3372 
3373  walldistanceneeded = .true.
3374 
3375  end select
3376 
3377  else
3378 
3379  ! Laminar or inviscid computation. Simply initialize the
3380  ! logicals for the wall distance to .false.
3381 
3382  walldistanceneeded = .false.
3383  updatewalldistanceunsteady = .false.
3384 
3385  end if
3386  !
3387  ! Parallelization parameters. Set the minimum load imbalance to
3388  ! 3 percent to avoid any problems.
3389  !
3390  loadimbalance = max(loadimbalance, 0.03_realtype)
3391  !
3392  ! Some default parameters, which depend on other parameters.
3393  ! Only if these have not been specified of course.
3394  !
3395  if (nsgstartup < 0) nsgstartup = 0
3397  if (cflcoarse < zero) cflcoarse = cfl
3398  if (betaturb < zero) betaturb = alfaturb
3399 
3400  if (turbrelax == turbrelaxnotdefined) then
3403  end if
3404 
3405  ! V2f should only be solved with explicit underrelaxation.
3406 
3407  if (equations == ransequations .and. turbmodel == v2f .and. &
3408  turbrelax == turbrelaximplicit) then
3409 
3411 
3412  if (myid == 0) then
3413  print "(a)", "#"
3414  print "(a)", "# Warning"
3415  print "(a)", "# Implicit underrelaxation specified for &
3416  &the v2f model."
3417  print "(a)", "# This is overwritten to explicit &
3418  &underrelaxation."
3419  print "(a)", "#"
3420  end if
3421 
3422  end if
3423 
3424  if (nsavevolume <= 0) then
3425  select case (equationmode)
3426  case (steady, timespectral)
3428 
3429  case (unsteady)
3431  + ntimestepsrestart + 1
3432  end select
3433  end if
3434 
3436 
3437  if (eddyvisinfratio < zero) then
3438 
3439  ! Default value depends on the turbulence model.
3440 
3441  select case (turbmodel)
3442 
3444  eddyvisinfratio = 0.009_realtype
3445 
3446  case default
3447  eddyvisinfratio = 0.1_realtype
3448 
3449  end select
3450  end if
3451  !
3452  ! Determine the number of old grid levels needed for the BDF
3453  ! time integration of unsteady problems and allocate the memory
3454  ! for the coefficients. The actual values are not yet set,
3455  ! because in the first (and possibly second) time step a reduced
3456  ! order must be used, because the older states are not available
3457  ! yet. Also allocate the memory for the logicals to indicate
3458  ! whether or not old solutions have been written.
3459  ! If a Runge Kutta scheme must be used for the time integration,
3460  ! either explicit or implicit, a separate routine is called to
3461  ! set all the necessary variables.
3462  !
3463  select case (timeintegrationscheme)
3464  case (bdf, md)
3465 
3466  ! First check if the accuracy is okay.
3467 
3468  if (timeaccuracy > thirdorder) then
3469  if (myid == 0) then
3470  print "(a)", "#"
3471  print "(a)", "# Warning"
3472  print "(a)", "# Maximum third order possible for BDF."
3473  print "(a)", "# Order has been reduced to third."
3474  print "(a)", "#"
3475  end if
3476 
3478  end if
3479 
3480  ! Determine the accuracy and set nOldLevels accordingly.
3481 
3482  select case (timeaccuracy)
3483  case (firstorder)
3484  noldlevels = 1
3485 
3486  case (secondorder)
3487  noldlevels = 2
3488 
3489  case (thirdorder)
3490  noldlevels = 3
3491  end select
3492 
3493  ! Allocate the memory for coefTime.
3494  if (allocated(coeftime)) deallocate (coeftime)
3495  allocate (coeftime(0:noldlevels), stat=ierr)
3496  if (ierr /= 0) &
3497  call terminate("checkInputParam", &
3498  "Memory allocation error for coefTime")
3499 
3500  ! Determine the accuracy and set ALE parameters accordingly.
3501  if (useale) then
3502  select case (timeaccuracy)
3503  case (firstorder)
3504  nalemeshes = 1
3505  nalesteps = 2
3506 
3507  case (secondorder)
3508  nalemeshes = 2
3509  nalesteps = 4
3510 
3511  case (thirdorder)
3512  call terminate("checkInputParam", &
3513  "ALE can only use 1st and 2nd order time accuracy")
3514  end select
3515 
3516  if (allocated(coeftimeale)) deallocate (coeftimeale)
3517  allocate (coeftimeale(1:nalesteps), stat=ierr)
3518  if (ierr /= 0) &
3519  call terminate("checkInputParam", &
3520  "Memory allocation error for coefTimeALE")
3521 
3522  if (allocated(coefmeshale)) deallocate (coefmeshale)
3523  allocate (coefmeshale(1:nalemeshes, 2), stat=ierr)
3524  if (ierr /= 0) &
3525  call terminate("checkInputParam", &
3526  "Memory allocation error for coefMeshALE")
3527  end if
3528 
3529  !===============================================================
3530 
3531  case (explicitrk)
3532  noldlevels = 1
3534 
3535  end select
3536 
3537  ! Set the logicals whether or not the old solutions have been
3538  ! written. Note that this is only used for the second and
3539  ! higher order BDF schemes. However it is allocated with a
3540  ! minimum size of 1 to avoid problems.
3541 
3542  oldsolwrittensize = max(noldlevels - 1_inttype, 1_inttype)
3543 
3544  !check allocations for multipile succesive calls
3545  if (allocated(oldsolwritten)) deallocate (oldsolwritten)
3546  allocate (oldsolwritten(oldsolwrittensize), stat=ierr)
3547  if (ierr /= 0) &
3548  call terminate("checkInputParam", &
3549  "Memory allocation error for oldSolWritten")
3550 
3551  do nn = 1, oldsolwrittensize
3552  oldsolwritten(nn) = .false.
3553  end do
3554  !
3555  ! Determine the values of the runge kutta parameters, depending
3556  ! on the number of stages specified.
3557  !
3558  ! Limit the number of stages between 1 and 6 and allocate the
3559  ! memory.
3560 
3561  nrkstages = min(6_inttype, max(1_inttype, nrkstages))
3562 
3563  !check allocations for multipile succesive calls
3564  if (allocated(etark)) deallocate (etark)
3565  if (allocated(cdisrk)) deallocate (cdisrk)
3566 
3567  allocate (etark(nrkstages), cdisrk(nrkstages), stat=ierr)
3568  if (ierr /= 0) &
3569  call terminate("checkInputParam", &
3570  "Memory allocation error for etaRK and cdisRK")
3571 
3572  ! Determine the case we are having here.
3573 
3574  select case (nrkstages)
3575  case (1_inttype)
3576  etark(1) = one
3577 
3578  cdisrk(1) = one
3579 
3580  case (2_inttype)
3581  etark(1) = 0.2222_realtype
3582  etark(2) = one
3583 
3584  cdisrk(1) = one
3585  cdisrk(2) = one
3586 
3587  case (3_inttype)
3588  etark(1) = 0.2846_realtype
3589  etark(2) = 0.6067_realtype
3590  etark(3) = one
3591 
3592  cdisrk(1) = one
3593  cdisrk(2) = one
3594  cdisrk(3) = one
3595 
3596  case (4_inttype)
3597  etark(1) = 0.33333333_realtype
3598  etark(2) = 0.26666667_realtype
3599  etark(3) = 0.55555555_realtype
3600  etark(4) = one
3601 
3602  cdisrk(1) = one
3603  cdisrk(2) = half
3604  cdisrk(3) = zero
3605  cdisrk(4) = zero
3606 
3607  case (5_inttype)
3608  etark(1) = fourth
3609  etark(2) = 0.16666667_realtype !1/6
3610  etark(3) = 0.37500000_realtype !3/8
3611  etark(4) = half
3612  etark(5) = one
3613 
3614  cdisrk(1) = one
3615  cdisrk(2) = zero
3616  cdisrk(3) = 0.56_realtype
3617  cdisrk(4) = zero
3618  cdisrk(5) = 0.44_realtype
3619 
3620  case (6_inttype)
3621  etark(1) = 0.0722_realtype
3622  etark(2) = 0.1421_realtype
3623  etark(3) = 0.2268_realtype
3624  etark(4) = 0.3425_realtype
3625  etark(5) = 0.5349_realtype
3626  etark(6) = one
3627 
3628  cdisrk(1) = one
3629  cdisrk(2) = one
3630  cdisrk(3) = one
3631  cdisrk(4) = one
3632  cdisrk(5) = one
3633  cdisrk(6) = one
3634  end select
3635  !
3636  ! To avoid any problems later on, allocate the memory for the
3637  ! rigid body motion parameters if these values were not present
3638  ! in the parameter file.
3639  !
3640  if (.not. allocated(coefpolxrot)) then
3641  allocate (coefpolxrot(0:0), stat=ierr)
3642  if (ierr /= 0) &
3643  call terminate("checkInputParam", &
3644  "Memory allocation failure for coefPolXRot")
3645  coefpolxrot = zero
3646  end if
3647 
3648  if (.not. allocated(coefpolyrot)) then
3649  allocate (coefpolyrot(0:0), stat=ierr)
3650  if (ierr /= 0) &
3651  call terminate("checkInputParam", &
3652  "Memory allocation failure for coefPolYRot")
3653  coefpolyrot = zero
3654  end if
3655 
3656  if (.not. allocated(coefpolzrot)) then
3657  allocate (coefpolzrot(0:0), stat=ierr)
3658  if (ierr /= 0) &
3659  call terminate("checkInputParam", &
3660  "Memory allocation failure for coefPolZRot")
3661  coefpolzrot = zero
3662  end if
3663 
3664  if (.not. allocated(coscoeffourxrot)) then
3665  allocate (coscoeffourxrot(0:0), stat=ierr)
3666  if (ierr /= 0) &
3667  call terminate("checkInputParam", &
3668  "Memory allocation failure for &
3669  &cosCoefFourXRot")
3671  end if
3672 
3673  if (.not. allocated(sincoeffourxrot)) then
3674  allocate (sincoeffourxrot(1), stat=ierr)
3675  if (ierr /= 0) &
3676  call terminate("checkInputParam", &
3677  "Memory allocation failure for &
3678  &sinCoefFourXRot")
3680  end if
3681 
3682  if (.not. allocated(coscoeffouryrot)) then
3683  allocate (coscoeffouryrot(0:0), stat=ierr)
3684  if (ierr /= 0) &
3685  call terminate("checkInputParam", &
3686  "Memory allocation failure for &
3687  &cosCoefFourYRot")
3689  end if
3690 
3691  if (.not. allocated(sincoeffouryrot)) then
3692  allocate (sincoeffouryrot(1), stat=ierr)
3693  if (ierr /= 0) &
3694  call terminate("checkInputParam", &
3695  "Memory allocation failure for &
3696  &sinCoefFourYRot")
3698  end if
3699 
3700  if (.not. allocated(coscoeffourzrot)) then
3701  allocate (coscoeffourzrot(0:0), stat=ierr)
3702  if (ierr /= 0) &
3703  call terminate("checkInputParam", &
3704  "Memory allocation failure for &
3705  &cosCoefFourZRot")
3707  end if
3708 
3709  if (.not. allocated(sincoeffourzrot)) then
3710  allocate (sincoeffourzrot(1), stat=ierr)
3711  if (ierr /= 0) &
3712  call terminate("checkInputParam", &
3713  "Memory allocation failure for &
3714  &sinCoefFourZRot")
3716  end if
3717 
3718  ! Allocate the memory for cpmin_family. We had to wait until
3719  ! nTimeIntervalsSpectral was set.
3720  if (.not. allocated(cpmin_family)) then
3721  allocate (cpmin_family(ntimeintervalsspectral), stat=ierr)
3722  if (ierr /= 0) &
3723  call terminate("checkInputParam", &
3724  "Memory allocation failure for &
3725  &cpmin_family")
3726  cpmin_family = zero
3727  end if
3728 
3729  ! Allocate the memory for sepsenmaxfamily. We had to wait until
3730  ! nTimeIntervalsSpectral was set.
3731  if (.not. allocated(sepsenmaxfamily)) then
3732  allocate (sepsenmaxfamily(ntimeintervalsspectral), stat=ierr)
3733  if (ierr /= 0) &
3734  call terminate("checkInputParam", &
3735  "Memory allocation failure for &
3736  &sepSenMaxFamily")
3738  end if
3739 
3740  end subroutine checkinputparam
3741  subroutine setdefaultvalues
3742  !
3743  ! setDefaultValues sets the default values for the input
3744  ! parameters where-ever possible. The parameters that must be
3745  ! set by the user are initialized such a check can be performed
3746  ! later.
3747  !
3748  use constants
3749 
3750  ! --------- Bare imports...too many to list -------
3752  use inputio
3753  use inputiteration
3754  use inputmotion
3755  use inputoverset
3756  use inputparallel
3757  use inputphysics
3758  use inputtimespectral
3759  use inputunsteady
3760  use inputadjoint
3761  use inputtsstabderiv
3762  ! ------------------------------------------------
3763  use flowvarrefstate, only: lref, lrefspecified, pref, rhoref, &
3764  tinfdim, tref
3767  use killsignals, only: fatalfail, routinefailed
3769  use inputcostfunctions
3770  implicit none
3771 
3772  ! Initialize boundary condition warning print outs
3773  printbcwarnings = .true.
3774 
3775  ! Initialize monitoring the turbulent residuals as well as the
3776  ! monitoring of mass flow of the sliding interfaces to .false.
3777 
3778  mondturb = .false.
3779  monmasssliding = .false.
3780 
3781  ! Initialize the logicals to check whether or not monitoring,
3782  ! surface output and volume output variables were specified to
3783  ! .false.
3784 
3785  monitorspecified = .false.
3786  surfaceoutspecified = .false.
3787  volumeoutspecified = .false.
3788  isooutspecified = .false.
3789  !
3790  ! Set the default values for the discretization parameters.
3791  !
3792  spacediscr = none ! Serves as a check later on.
3793  orderturb = firstorder ! First order discretization.
3794  ! Of turbulent advective terms.
3795  riemann = roe
3796  limiter = nolimiter ! No limiter in upwind schemes.
3797  precond = noprecond ! No preconditioning.
3798 
3799  eulerwallbctreatment = normalmomentum ! Normal momentum equation is
3800  ! Used to determine ghost
3801  ! cell pressure.
3802 
3803  viscwallbctreatment = constantpressure ! Normal momentum equation is
3804  ! Used to determine ghost
3805  ! cell pressure.
3806 
3807  outflowtreatment = constantextrapol ! Constant extrapolation at
3808  ! outflow boundaries.
3809 
3810  spacediscrcoarse = none ! Serves as a check. If nothing
3811  riemanncoarse = none ! is specified the fine grid
3812  ! parameter is taken.
3813 
3814  nonmatchtreatment = nonconservative ! Non conservative treatment
3815  ! of non-matching block to
3816  ! block boundaries.
3817 
3818  vortexcorr = .false. ! No vortex correction is
3819  ! applied.
3820 
3821  vis2 = half
3822  vis4 = one / 64.0_realtype
3823  vis2coarse = half
3824 
3825  dirscaling = .true. ! Apply isotropic directional
3826  adis = two * third ! scaling in the artificial
3827  ! dissipation schemes.
3828 
3829  hscalinginlet = .false. ! No total enthalpy scaling.
3830 
3831  kappacoef = third
3832  !
3833  ! Set the default values for the IO-parameters.
3834 
3835  gridfile = "" ! Serves as a check later on.
3836 
3837  checkrestartsol = .true. ! Restart solution is checked for
3838  ! correct nonDimensionalization.
3839 
3840  newgridfile = "" ! This will be corrected later on
3841  solfile = "" ! if nothing is specified. The
3842  ! default names depend on the
3843  ! format used
3844 
3845  surfacesolfile = "" ! This will be corrected later if no
3846  ! surface solution file is specified.
3847 
3848  storerindlayer = .true. ! No halo cells in solution files.
3849 
3850  autoparameterupdate = .true. ! Update the input parameter file
3851  ! when a restart file is written.
3852  writecoormeter = .false. ! Use original coordinate units
3853  ! when writing solution files.
3854 
3855  cpfile = "" ! Serves as a check later on.
3856 
3857  storeconvinneriter = .false. ! Do not store the convergence of
3858  ! iterations(inner iterations in unsteady mode).
3859 
3860 #ifdef USE_SINGLE_PRECISION
3861  precisiongrid = precisionsingle ! Default IO precision depends
3862  precisionsol = precisionsingle ! on the default floating
3863  ! point type used. Note that
3864 #else
3865  precisiongrid = precisiondouble ! for quadrupole precision the
3866  precisionsol = precisiondouble ! IO takes place in double
3867  ! precision.
3868 #endif
3869 
3870  ! Surface solution defaults to single precision
3873 
3874  !
3875  ! Set the default values for the iteration parameters.
3876  !
3877  ncycles = -1 ! Serves as a check later on.
3878  nsgstartup = 0 ! No single grid startup iterations.
3879  nsubiterturb = 0 ! No additional turbulent subiterations.
3880  nupdatebleeds = 50 ! Update the bleeds every 50 iterations.
3881 
3882  nsavevolume = 1 ! Only save at the end of the computation.
3883  nsavesurface = 1
3884 
3885  smoother = none
3886  nrkstages = 5
3887  nsubiterations = 1
3888 
3889  !resAveraging = noResAveraging ! No residual averaging.
3891  smoop = 1.5_realtype
3892 
3893  turbtreatment = decoupled ! Decoupled solver for the
3894  ! turbulent equations
3895  turbsmoother = adi ! solved using an adi scheme.
3896  freezeturbsource = .true. ! Freeze the coarse grid source
3897  ! terms for a coupled solver.
3898  turbrelax = turbrelaxnotdefined ! Will be set later, depending
3899  ! on the turbulence model.
3900 
3901  cfl = -one ! Serves as a check later on.
3902 
3903  relaxbleeds = 0.1_realtype ! Relaxation factor for the
3904  ! bleed boundary conditions.
3905 
3906  alfaturb = 0.8_realtype
3907  betaturb = -one ! Serves as a check later on.
3908 
3909  l2conv = 1.e-6_realtype ! Six orders of magnitude for
3910  ! convergence.
3911  l2convcoarse = 1.e-2_realtype ! Only two on coarse grids in
3912  ! full mg.
3913 
3914  maxl2deviationfactor = 1_realtype
3915  ncyclescoarse = -1 ! If these parameters are not
3916  cflcoarse = -one ! specified the corresponding fine
3917  ! grid values are taken.
3918 
3919  fcoll = one ! No relaxation when restricting the residuals.
3920 
3921  mgboundcorr = bcdirichlet0 ! Zero out the boundary halo's for
3922  ! the multigrid corrections.
3923 
3924  mgstartlevel = -1 ! Start at the coarsest grid of the mg cycle
3925  ! when no restart is performed.
3926  mgdescription = "sg" ! Single grid computation.
3927  !
3928  ! Set the default values for the motion parameters,
3929  ! i.e. no motion.
3930  !
3931  ! Translation data.
3932 
3933  ! Rotation data.
3934 
3935  rotpoint = zero
3936 
3937  degreepolxrot = -1 ! -1, because the start index is 0.
3938  degreepolyrot = -1
3939  degreepolzrot = -1
3940 
3941  degreefourxrot = -1 ! -1, because the start index is 0,
3942  ! at least of the cosine part.
3943  degreefouryrot = -1
3944  degreefourzrot = -1
3945 
3949 
3950  ! The logical to determine whether or not a motion is specified.
3951  ! Initialize it to .false.
3952 
3953  gridmotionspecified = .false.
3954  !
3955  ! Set the default values for the parallel parameters.
3956  !
3957  loadimbalance = 0.1_realtype ! Allow 10 percent load imbalance.
3958  splitblocks = .true. ! Allow the splitting of blocks to
3959  ! obtain a better load balancing.
3960  loadbalanceiter = 2 ! Do two iterations
3961  !
3962  ! Set the default values for the physics parameters.
3963  !
3964  equations = none ! These are parameters that must be
3965  equationmode = none ! specified. If not, the program
3966  flowtype = none ! exits.
3967  turbmodel = none
3968 
3969  cpmodel = cpconstant ! Constant cp.
3970 
3971  turbprod = strain ! Strain is used in the production
3972  ! term of transport turbulence models.
3973 
3974  wallfunctions = .false. ! No wall functions used.
3975 
3976  mach = -one ! Both parameters must be specified
3977  reynolds = -one ! for external flows. The -1. serves
3978  ! as a check later on.
3979 
3980  machcoef = -one ! If not specified MachCoef will
3981  ! be set to Mach.
3982 
3983  veldirfreestream(1) = one ! Free stream velocity
3984  veldirfreestream(2) = zero ! is specified in the
3985  veldirfreestream(3) = zero ! x-axis direction.
3986 
3987  liftdirspecified = .false. ! Lift direction not specified.
3988 
3990  tinfdim = 288.15_realtype
3991  gammaconstant = 1.4_realtype
3992  rgasdim = 287.87_realtype
3993 
3994  prandtl = 0.72_realtype
3995  prandtlturb = 0.90_realtype
3996  pklim = 20.0_realtype
3997  walloffset = zero
3998 
3999  ssuthdim = 110.55_realtype
4000  musuthdim = 1.716e-5_realtype
4001  tsuthdim = 273.15_realtype
4002 
4003  rvfn = 1 ! Version 1 of the v2f
4004  ! model is used.
4005  rvfb = .true. ! An upper bound is used
4006  ! in the v2f scales.
4007  eddyvisinfratio = -one ! Default value depends on
4008  ! the turbulence model.
4009  turbintensityinf = 0.001_realtype
4010 
4011  surfaceref = one
4012  lengthref = one
4013 
4014  pointref(1) = zero
4015  pointref(2) = zero
4016  pointref(3) = zero
4017 
4018  momentaxis(1, 1) = zero
4019  momentaxis(1, 2) = one
4020  momentaxis(2, 1) = zero
4021  momentaxis(2, 2) = zero
4022  momentaxis(3, 1) = zero
4023  momentaxis(3, 2) = zero
4024 
4025  !
4026  ! Set the default values for the time spectral parameters.
4027  !
4028  ntimeintervalsspectral = -1 ! Serves as a check later on.
4029 
4030  nunsteadysolspectral = -1 ! Serves as a check later on.
4031 
4032  writeunsteadyvolspectral = .false. ! No writing of the files
4033  writeunsteadysurfspectral = .false. ! for postprocessing.
4034 
4035  writeunsteadyrestartspectral = .false. ! No writing of an unsteady
4036  ! mode restart file.
4037 
4038  dtunsteadyrestartspectral = -one ! Is checked later on.
4039  !
4040  ! Set the default values for the unsteady parameters.
4041  !
4042  timeaccuracy = secondorder ! Second order time accuracy.
4043 
4044  ntimestepscoarse = -1 ! Serves as a check later on.
4045  ntimestepsfine = -1 ! Serves as a check later on.
4046 
4047  deltat = -one ! Serves as a check later on.
4048 
4049  useale = .true. ! Use the ALE scheme by default.
4050 
4051  updatewalldistanceunsteady = .true. ! This default value is
4052  ! overruled for models that
4053  ! are wall distance free.
4054  !
4055  ! The reference state variables. Set them to -1, such that they
4056  ! can be checked later on.
4057  !
4058  pref = -one
4059  rhoref = -one
4060  tref = -one
4061  !
4062  ! The conversion factor of the grid units to meters. Default 1.
4063  !
4064  lref = one
4065  lrefspecified = .false.
4066  !
4067  ! Initialization of some unsteady restart parameters. These will
4068  ! be overwritten when an actual unsteady restart is performed.
4069  !
4070  noldsolavail = 1
4071  ntimestepsrestart = 0
4073  !
4074  ! Variables needed for the writing of grid and solution files.
4075  !
4077 
4078  ! Additional Paramters Requiring Defaults
4079  printiterations = .true.
4080  routinefailed = .false.
4081  fatalfail = .false.
4082  lumpeddiss = .false.
4083  approxsa = .false.
4084  useapproxwalldistance = .false.
4085  updatewallassociations = .false.
4086  recomputeoverlapmatrix = .true.
4087  cfllimit = 3.0
4088  adjointpetscvarsallocated = .false.
4090  usematrixfreedrdw = .false.
4091  end subroutine setdefaultvalues
4092 
4093  subroutine initializeisosurfacevariables(values, nValues)
4094  !
4095  ! isoVariables extracts from the given string the extra
4096  ! iso surface variables to be written to the solution file.
4097  !
4098  use constants
4100  implicit none
4101  !
4102  ! Subroutine arguments.
4103  !
4104  integer(kind=intType), intent(in) :: nValues
4105  real(kind=realtype), dimension(nValues), intent(in) :: values
4106 
4107  ! Basically just copy into module
4108  if (allocated(isovalues)) then
4109  deallocate (isovalues)
4110  end if
4111 
4112  if (allocated(isosurfacenames)) then
4113  deallocate (isosurfacenames)
4114  end if
4115 
4116  nisosurface = nvalues
4117  allocate (isovalues(nisosurface))
4118  allocate (isosurfacenames(nisosurface))
4119 
4120  isovalues = values
4121 
4122  end subroutine initializeisosurfacevariables
4123 
4124  subroutine setisosurfacevariable(variable, iVar)
4125 
4126  ! Set variable to iVar. initializeIsoSurfaceVariables MUST be called
4127  ! first with the desired number of values to set.
4128 
4129  use constants
4130  use cgnsnames
4131  use extraoutput
4132  use communication, only: myid
4133  use utils, only: echk
4134  implicit none
4135  !
4136  ! Subroutine arguments.
4137  !
4138  character(len=*), intent(in) :: variable
4139  integer(kind=intType) :: iVar
4140 
4141  select case (variable)
4142  case ("rho")
4144  case ("vx")
4145  isosurfacenames(ivar) = cgnsvelx
4146  case ("vy")
4147  isosurfacenames(ivar) = cgnsvely
4148  case ("vz")
4149  isosurfacenames(ivar) = cgnsvelz
4150  case ("P")
4152  case ("mx")
4153  isosurfacenames(ivar) = cgnsmomx
4154  case ("my")
4155  isosurfacenames(ivar) = cgnsmomy
4156  case ("mz")
4157  isosurfacenames(ivar) = cgnsmomz
4158  case ("rvx")
4160  case ("rvy")
4162  case ("rvz")
4164  case ("rhoe")
4165  isosurfacenames(ivar) = cgnsenergy
4166  case ("temp")
4167  isosurfacenames(ivar) = cgnstemp
4168  case ("vort")
4170  case ("vortx")
4171  isosurfacenames(ivar) = cgnsvortx
4172  case ("vorty")
4173  isosurfacenames(ivar) = cgnsvorty
4174  case ("vortz")
4175  isosurfacenames(ivar) = cgnsvortz
4176  case ("cp")
4177  isosurfacenames(ivar) = cgnscp
4178  case ("mach")
4179  isosurfacenames(ivar) = cgnsmach
4180  case ("rmach")
4182  case ("macht")
4184  case ("ptloss")
4186  case ("eddy")
4187  isosurfacenames(ivar) = cgnseddy
4188  case ("eddyratio")
4190  case ("dist")
4192  case ("resrho")
4193  isosurfacenames(ivar) = cgnsresrho
4194  case ("shock")
4195  isosurfacenames(ivar) = cgnsshock
4196  case ("filteredShock")
4198  case default
4199 
4200  if (myid == 0) Then
4201  print *, 'Error: ', variable, 'cannot be used as an isoSurface'
4202  end if
4203  call echk(-99, __file__, __line__)
4204  end select
4205  end subroutine setisosurfacevariable
4206 
4207 end module inputparamroutines
logical adjointpetscvarsallocated
logical adjointpetscpreprocvarsallocated
character(len=maxcgnsnamelen), parameter cgnscl
Definition: cgnsNames.f90:235
character(len=maxcgnsnamelen), parameter cgnsl2resrho
Definition: cgnsNames.f90:208
character(len=maxcgnsnamelen), parameter cgnsrelvely
Definition: cgnsNames.f90:60
character(len=maxcgnsnamelen), parameter cgnsmachmax
Definition: cgnsNames.f90:265
character(len=maxcgnsnamelen), parameter cgnsl2resmomy
Definition: cgnsNames.f90:212
character(len=maxcgnsnamelen), parameter cgnscmy
Definition: cgnsNames.f90:256
character(len=maxcgnsnamelen), parameter cgnsyplusmax
Definition: cgnsNames.f90:267
character(len=maxcgnsnamelen), parameter cgnsl2resk
Definition: cgnsNames.f90:220
character(len=maxcgnsnamelen), parameter cgnscmx
Definition: cgnsNames.f90:254
character(len=maxcgnsnamelen), parameter cgnsmomz
Definition: cgnsNames.f90:33
character(len=maxcgnsnamelen), parameter cgnscfy
Definition: cgnsNames.f90:250
character(len=maxcgnsnamelen), parameter cgnsresrho
Definition: cgnsNames.f90:181
character(len=maxcgnsnamelen), parameter cgnssepsensorksarea
Definition: cgnsNames.f90:280
character(len=maxcgnsnamelen), parameter cgnsrelmach
Definition: cgnsNames.f90:76
character(len=maxcgnsnamelen), parameter cgnsdensity
Definition: cgnsNames.f90:27
character(len=maxcgnsnamelen), parameter cgnsl2resrhoe
Definition: cgnsNames.f90:216
character(len=maxcgnsnamelen), parameter cgnsshock
Definition: cgnsNames.f90:163
character(len=maxcgnsnamelen), parameter cgnsaxismoment
Definition: cgnsNames.f90:282
character(len=maxcgnsnamelen), parameter cgnsl2resv2
Definition: cgnsNames.f90:228
character(len=maxcgnsnamelen), parameter cgnsvelz
Definition: cgnsNames.f90:56
character(len=maxcgnsnamelen), parameter cgnsvortmagn
Definition: cgnsNames.f90:90
character(len=maxcgnsnamelen), parameter cgnsl2resmomx
Definition: cgnsNames.f90:210
character(len=maxcgnsnamelen), parameter cgnsl2resmomz
Definition: cgnsNames.f90:214
character(len=maxcgnsnamelen), parameter cgnsfilteredshock
Definition: cgnsNames.f90:166
character(len=maxcgnsnamelen), parameter cgnseddyratio
Definition: cgnsNames.f90:86
character(len=maxcgnsnamelen), parameter cgnstemp
Definition: cgnsNames.f90:70
character(len=maxcgnsnamelen), parameter cgnsmomy
Definition: cgnsNames.f90:31
character(len=maxcgnsnamelen), parameter cgnsvely
Definition: cgnsNames.f90:54
character(len=maxcgnsnamelen), parameter cgnsl2resomega
Definition: cgnsNames.f90:222
character(len=maxcgnsnamelen), parameter cgnsmachturb
Definition: cgnsNames.f90:78
character(len=maxcgnsnamelen), parameter cgnsl2restau
Definition: cgnsNames.f90:224
character(len=maxcgnsnamelen), parameter cgnseddy
Definition: cgnsNames.f90:84
character(len=maxcgnsnamelen), parameter cgnsclv
Definition: cgnsNames.f90:239
character(len=maxcgnsnamelen), parameter cgnssepsensor
Definition: cgnsNames.f90:278
character(len=maxcgnsnamelen), parameter cgnsvorty
Definition: cgnsNames.f90:94
character(len=maxcgnsnamelen), parameter cgnsclp
Definition: cgnsNames.f90:237
character(len=maxcgnsnamelen), parameter cgnsptotloss
Definition: cgnsNames.f90:98
character(len=maxcgnsnamelen), parameter cgnscmz
Definition: cgnsNames.f90:258
character(len=maxcgnsnamelen), parameter cgnscavitation
Definition: cgnsNames.f90:281
character(len=maxcgnsnamelen), parameter cgnsvortx
Definition: cgnsNames.f90:92
character(len=maxcgnsnamelen), parameter cgnseddymax
Definition: cgnsNames.f90:269
character(len=maxcgnsnamelen), parameter cgnsvelx
Definition: cgnsNames.f90:52
character(len=maxcgnsnamelen), parameter cgnsrelvelx
Definition: cgnsNames.f90:58
character(len=maxcgnsnamelen), parameter cgnsl2resf
Definition: cgnsNames.f90:230
character(len=maxcgnsnamelen), parameter cgnsrelvelz
Definition: cgnsNames.f90:62
character(len=maxcgnsnamelen), parameter cgnscd
Definition: cgnsNames.f90:241
character(len=maxcgnsnamelen), parameter cgnscp
Definition: cgnsNames.f90:72
character(len=maxcgnsnamelen), parameter cgnsmomx
Definition: cgnsNames.f90:29
character(len=maxcgnsnamelen), parameter cgnscfz
Definition: cgnsNames.f90:252
character(len=maxcgnsnamelen), parameter cgnscdp
Definition: cgnsNames.f90:243
character(len=maxcgnsnamelen), parameter cgnsl2resepsilon
Definition: cgnsNames.f90:226
character(len=maxcgnsnamelen), parameter cgnshdiffmax
Definition: cgnsNames.f90:263
character(len=maxcgnsnamelen), parameter cgnsenergy
Definition: cgnsNames.f90:35
character(len=maxcgnsnamelen), parameter cgnspressure
Definition: cgnsNames.f90:68
character(len=maxcgnsnamelen), parameter cgnsl2resnu
Definition: cgnsNames.f90:218
character(len=maxcgnsnamelen), parameter cgnsvortz
Definition: cgnsNames.f90:96
character(len=maxcgnsnamelen), parameter cgnscdv
Definition: cgnsNames.f90:245
character(len=maxcgnsnamelen), parameter cgnsmach
Definition: cgnsNames.f90:74
character(len=maxcgnsnamelen), parameter cgnscfx
Definition: cgnsNames.f90:248
character(len=maxcgnsnamelen), parameter cgnswalldist
Definition: cgnsNames.f90:88
integer adflow_comm_world
integer(kind=inttype), parameter strain
Definition: constants.F90:137
integer(kind=inttype), parameter spalartallmarasedwards
Definition: constants.F90:128
integer(kind=inttype), parameter spalartallmaras
Definition: constants.F90:128
integer(kind=inttype), parameter roe
Definition: constants.F90:155
integer(kind=inttype), parameter firstorder
Definition: constants.F90:142
integer(kind=inttype), parameter nonconservative
Definition: constants.F90:180
integer(kind=inttype), parameter cptempcurvefits
Definition: constants.F90:124
real(kind=realtype), parameter zero
Definition: constants.F90:71
integer(kind=inttype), parameter precisiondouble
Definition: constants.F90:184
integer(kind=inttype), parameter constantextrapol
Definition: constants.F90:176
real(kind=realtype), parameter third
Definition: constants.F90:81
integer(kind=inttype), parameter constantpressure
Definition: constants.F90:170
real(kind=realtype), parameter eps
Definition: constants.F90:23
integer(kind=inttype), parameter ktau
Definition: constants.F90:128
integer(kind=inttype), parameter md
Definition: constants.F90:189
integer(kind=inttype), parameter decoupled
Definition: constants.F90:207
integer(kind=inttype), parameter komegawilcox
Definition: constants.F90:128
integer(kind=inttype), parameter eulerequations
Definition: constants.F90:110
integer(kind=inttype), parameter timespectral
Definition: constants.F90:115
integer(kind=inttype), parameter komegamodified
Definition: constants.F90:128
integer(kind=inttype), parameter unsteady
Definition: constants.F90:115
integer(kind=inttype), parameter precisionsingle
Definition: constants.F90:184
integer(kind=inttype), parameter bcdirichlet0
Definition: constants.F90:214
integer(kind=inttype), parameter turbrelaxnotdefined
Definition: constants.F90:223
integer(kind=inttype), parameter noresaveraging
Definition: constants.F90:218
integer(kind=inttype), parameter noprecond
Definition: constants.F90:165
integer(kind=inttype), parameter bdf
Definition: constants.F90:189
real(kind=realtype), parameter one
Definition: constants.F90:72
integer, parameter maxstringlen
Definition: constants.F90:16
real(kind=realtype), parameter half
Definition: constants.F90:80
integer(kind=inttype), parameter turbrelaximplicit
Definition: constants.F90:223
integer(kind=inttype), parameter turbrelaxexplicit
Definition: constants.F90:223
integer(kind=inttype), parameter steady
Definition: constants.F90:115
integer(kind=inttype), parameter adi
Definition: constants.F90:210
real(kind=realtype), parameter two
Definition: constants.F90:73
integer(kind=inttype), parameter cpconstant
Definition: constants.F90:124
integer(kind=inttype), parameter explicitrk
Definition: constants.F90:189
real(kind=realtype), parameter fourth
Definition: constants.F90:82
integer(kind=inttype), parameter nolimiter
Definition: constants.F90:160
integer(kind=inttype), parameter mentersst
Definition: constants.F90:128
integer(kind=inttype), parameter thirdorder
Definition: constants.F90:142
integer(kind=inttype), parameter nsequations
Definition: constants.F90:110
integer(kind=inttype), parameter secondorder
Definition: constants.F90:142
integer(kind=inttype), parameter dissscalar
Definition: constants.F90:149
integer(kind=inttype), parameter externalflow
Definition: constants.F90:120
integer(kind=inttype), parameter ransequations
Definition: constants.F90:110
integer(kind=inttype), parameter normalmomentum
Definition: constants.F90:170
integer(kind=inttype), parameter internalflow
Definition: constants.F90:120
integer(kind=inttype), parameter v2f
Definition: constants.F90:128
real(kind=realtype) cvn
Definition: CpCurveFits.f90:58
real(kind=realtype), dimension(:), allocatable cptrange
Definition: CpCurveFits.f90:46
integer(kind=inttype) cpnparts
Definition: CpCurveFits.f90:44
real(kind=realtype), dimension(:), allocatable cphint
Definition: CpCurveFits.f90:48
real(kind=realtype) cv0
Definition: CpCurveFits.f90:58
type(cptempfittype), dimension(:), allocatable cptempfit
Definition: CpCurveFits.f90:49
real(kind=realtype), dimension(:), allocatable cpeint
Definition: CpCurveFits.f90:47
logical volwritervy
Definition: extraOutput.f90:30
logical volwritemy
Definition: extraOutput.f90:29
logical surfwritemach
Definition: extraOutput.f90:18
logical surfwritecavitation
Definition: extraOutput.f90:23
logical isowritevortx
Definition: extraOutput.f90:51
real(kind=realtype), dimension(:), allocatable isovalues
Definition: extraOutput.f90:61
logical isowritevz
Definition: extraOutput.f90:45
logical surfwritevy
Definition: extraOutput.f90:16
logical volwritegc
Definition: extraOutput.f90:38
logical volwriteintermittency
Definition: extraOutput.f90:39
logical surfwritecfx
Definition: extraOutput.f90:21
logical surfwritegc
Definition: extraOutput.f90:23
logical surfwriteyplus
Definition: extraOutput.f90:20
logical volwriteblank
Definition: extraOutput.f90:37
logical volwriteshock
Definition: extraOutput.f90:38
logical volwritermach
Definition: extraOutput.f90:33
logical isowritecp
Definition: extraOutput.f90:48
logical surfwriteforceindragdir
Definition: extraOutput.f90:24
logical isowritetemp
Definition: extraOutput.f90:48
logical surfwriteblank
Definition: extraOutput.f90:22
logical isowriterhoe
Definition: extraOutput.f90:48
logical isowritemx
Definition: extraOutput.f90:46
logical volwritervz
Definition: extraOutput.f90:30
logical isowriteeddyvis
Definition: extraOutput.f90:49
logical volwritedist
Definition: extraOutput.f90:34
logical isowritevortz
Definition: extraOutput.f90:52
logical volwritevorty
Definition: extraOutput.f90:35
logical isowritemach
Definition: extraOutput.f90:49
logical surfwritecfy
Definition: extraOutput.f90:21
logical volwriteresmom
Definition: extraOutput.f90:36
logical surfwritesepsensorks
Definition: extraOutput.f90:22
logical isowriteratioeddyvis
Definition: extraOutput.f90:51
logical surfwritecfz
Definition: extraOutput.f90:21
logical surfwritervx
Definition: extraOutput.f90:17
logical isowritervx
Definition: extraOutput.f90:47
logical volwriterhoe
Definition: extraOutput.f90:31
logical volwriteresrhoe
Definition: extraOutput.f90:37
logical surfwriteforceinliftdir
Definition: extraOutput.f90:24
logical isowriteresmom
Definition: extraOutput.f90:53
logical volwriteratioeddyvis
Definition: extraOutput.f90:34
logical volwriteresrho
Definition: extraOutput.f90:36
logical volwritestatus
Definition: extraOutput.f90:38
logical isowriteturb
Definition: extraOutput.f90:45
logical surfwritervz
Definition: extraOutput.f90:17
logical isowriteresturb
Definition: extraOutput.f90:54
logical isowriteresrhoe
Definition: extraOutput.f90:54
logical isowritermach
Definition: extraOutput.f90:50
logical isowriteshock
Definition: extraOutput.f90:55
logical isowriteblank
Definition: extraOutput.f90:54
logical surfwritevx
Definition: extraOutput.f90:16
logical isowritevx
Definition: extraOutput.f90:44
logical volwritecp
Definition: extraOutput.f90:31
logical volwriteptotloss
Definition: extraOutput.f90:36
logical surfwritep
Definition: extraOutput.f90:15
logical volwritemachturb
Definition: extraOutput.f90:32
logical surfwritesepsensorksarea
Definition: extraOutput.f90:22
logical isowriteptotloss
Definition: extraOutput.f90:53
logical isowritevorty
Definition: extraOutput.f90:52
logical volwriteeddyvis
Definition: extraOutput.f90:32
logical volwritemx
Definition: extraOutput.f90:29
logical volwritemach
Definition: extraOutput.f90:32
logical isowritep
Definition: extraOutput.f90:45
logical volwritervx
Definition: extraOutput.f90:30
logical surfwriteptotloss
Definition: extraOutput.f90:18
logical surfwritecf
Definition: extraOutput.f90:20
logical surfwritervy
Definition: extraOutput.f90:17
logical isowritemy
Definition: extraOutput.f90:46
logical surfwritesepsensor
Definition: extraOutput.f90:22
logical isowritefilteredshock
Definition: extraOutput.f90:55
logical surfwriteaxismoment
Definition: extraOutput.f90:23
logical isowritedist
Definition: extraOutput.f90:51
logical volwritevort
Definition: extraOutput.f90:35
logical isowritervy
Definition: extraOutput.f90:47
logical volwritemz
Definition: extraOutput.f90:29
logical volwritevortx
Definition: extraOutput.f90:34
logical surfwritevz
Definition: extraOutput.f90:16
logical volwriteresturb
Definition: extraOutput.f90:37
logical isowriterho
Definition: extraOutput.f90:44
logical isowritevort
Definition: extraOutput.f90:52
logical isowritervz
Definition: extraOutput.f90:47
logical surfwritermach
Definition: extraOutput.f90:19
character(len=maxcgnsnamelen), dimension(:), allocatable isosurfacenames
Definition: extraOutput.f90:62
logical volwritetemp
Definition: extraOutput.f90:31
logical volwritefilteredshock
Definition: extraOutput.f90:38
integer(kind=inttype) nisosurface
Definition: extraOutput.f90:60
logical surfwritech
Definition: extraOutput.f90:20
logical isowritemz
Definition: extraOutput.f90:46
logical volwritevortz
Definition: extraOutput.f90:35
logical isowriteresrho
Definition: extraOutput.f90:53
logical surfwritetemp
Definition: extraOutput.f90:15
logical isowritemachturb
Definition: extraOutput.f90:49
logical surfwriterho
Definition: extraOutput.f90:15
logical surfwritecp
Definition: extraOutput.f90:18
logical isowritevy
Definition: extraOutput.f90:44
integer(kind=inttype) nt1
real(kind=realtype) tinfdim
integer(kind=inttype) nwt
real(kind=realtype) rhoref
integer(kind=inttype) nwf
real(kind=realtype) tref
integer(kind=inttype) nw
real(kind=realtype) lref
real(kind=realtype) pref
integer(kind=inttype) nt2
logical usematrixfreedrdw
Definition: inputParam.F90:849
real(kind=realtype) vis2
Definition: inputParam.F90:78
logical radiineededcoarse
Definition: inputParam.F90:92
logical updatewallassociations
Definition: inputParam.F90:95
real(kind=realtype) vis2coarse
Definition: inputParam.F90:78
integer(kind=inttype) eulerwallbctreatment
Definition: inputParam.F90:75
integer(kind=inttype) orderturb
Definition: inputParam.F90:73
real(kind=realtype) adis
Definition: inputParam.F90:78
integer(kind=inttype) riemanncoarse
Definition: inputParam.F90:74
logical useapproxwalldistance
Definition: inputParam.F90:94
real(kind=realtype) vis4
Definition: inputParam.F90:78
real(kind=realtype) kappacoef
Definition: inputParam.F90:80
integer(kind=inttype) nonmatchtreatment
Definition: inputParam.F90:76
integer(kind=inttype) viscwallbctreatment
Definition: inputParam.F90:75
integer(kind=inttype) outflowtreatment
Definition: inputParam.F90:75
integer(kind=inttype) riemann
Definition: inputParam.F90:74
integer(kind=inttype) limiter
Definition: inputParam.F90:73
integer(kind=inttype) precond
Definition: inputParam.F90:74
integer(kind=inttype) spacediscrcoarse
Definition: inputParam.F90:72
integer(kind=inttype) spacediscr
Definition: inputParam.F90:72
logical storeconvinneriter
Definition: inputParam.F90:166
character(len=maxstringlen) solfile
Definition: inputParam.F90:160
character(len=maxstringlen) surfacesolfile
Definition: inputParam.F90:162
logical storerindlayer
Definition: inputParam.F90:164
character(len=maxstringlen) cpfile
Definition: inputParam.F90:162
character(len=maxstringlen) newgridfile
Definition: inputParam.F90:159
integer(kind=inttype) precisionsurfsol
Definition: inputParam.F90:157
integer(kind=inttype) precisionsol
Definition: inputParam.F90:156
character(len=maxstringlen) gridfile
Definition: inputParam.F90:158
logical autoparameterupdate
Definition: inputParam.F90:165
logical checkrestartsol
Definition: inputParam.F90:164
integer(kind=inttype) precisionsurfgrid
Definition: inputParam.F90:157
logical writecoormeter
Definition: inputParam.F90:165
integer(kind=inttype) precisiongrid
Definition: inputParam.F90:156
real(kind=realtype) betaturb
Definition: inputParam.F90:276
integer(kind=inttype) ncycles
Definition: inputParam.F90:262
integer(kind=inttype) smoother
Definition: inputParam.F90:264
real(kind=realtype) cflcoarse
Definition: inputParam.F90:275
integer(kind=inttype) nmgsteps
Definition: inputParam.F90:271
integer(kind=inttype) mgstartlevel
Definition: inputParam.F90:270
real(kind=realtype) maxl2deviationfactor
Definition: inputParam.F90:279
integer(kind=inttype) turbtreatment
Definition: inputParam.F90:269
integer(kind=inttype) nsavesurface
Definition: inputParam.F90:263
real(kind=realtype), dimension(:), allocatable cdisrk
Definition: inputParam.F90:283
character(len=maxstringlen) mgdescription
Definition: inputParam.F90:284
integer(kind=inttype) nsubiterturb
Definition: inputParam.F90:266
real(kind=realtype) smoop
Definition: inputParam.F90:275
real(kind=realtype) l2conv
Definition: inputParam.F90:277
logical printbcwarnings
Definition: inputParam.F90:292
integer(kind=inttype), dimension(:), allocatable cyclestrategy
Definition: inputParam.F90:273
integer(kind=inttype) nupdatebleeds
Definition: inputParam.F90:266
integer(kind=inttype) resaveraging
Definition: inputParam.F90:267
integer(kind=inttype) ncyclescoarse
Definition: inputParam.F90:262
integer(kind=inttype) nsubiterations
Definition: inputParam.F90:265
real(kind=realtype) cfllimit
Definition: inputParam.F90:268
integer(kind=inttype) nsavevolume
Definition: inputParam.F90:263
real(kind=realtype), dimension(:), allocatable etark
Definition: inputParam.F90:283
real(kind=realtype) l2convcoarse
Definition: inputParam.F90:277
real(kind=realtype) relaxbleeds
Definition: inputParam.F90:280
integer(kind=inttype) mgboundcorr
Definition: inputParam.F90:270
real(kind=realtype) fcoll
Definition: inputParam.F90:275
integer(kind=inttype) nrkstages
Definition: inputParam.F90:264
integer(kind=inttype) nmglevels
Definition: inputParam.F90:271
real(kind=realtype) alfaturb
Definition: inputParam.F90:276
logical printiterations
Definition: inputParam.F90:288
real(kind=realtype) cfl
Definition: inputParam.F90:275
integer(kind=inttype) turbsmoother
Definition: inputParam.F90:269
integer(kind=inttype) nsgstartup
Definition: inputParam.F90:264
logical freezeturbsource
Definition: inputParam.F90:287
integer(kind=inttype) turbrelax
Definition: inputParam.F90:269
integer(kind=inttype) degreefouryrot
Definition: inputParam.F90:354
integer(kind=inttype) degreefourxrot
Definition: inputParam.F90:353
integer(kind=inttype) degreepolxrot
Definition: inputParam.F90:337
real(kind=realtype) omegafouryrot
Definition: inputParam.F90:363
integer(kind=inttype) degreepolyrot
Definition: inputParam.F90:338
real(kind=realtype), dimension(:), allocatable coefpolxrot
Definition: inputParam.F90:345
real(kind=realtype) omegafourzrot
Definition: inputParam.F90:364
real(kind=realtype) omegafourxrot
Definition: inputParam.F90:362
real(kind=realtype), dimension(:), allocatable sincoeffouryrot
Definition: inputParam.F90:385
real(kind=realtype), dimension(:), allocatable coscoeffourxrot
Definition: inputParam.F90:373
real(kind=realtype), dimension(:), allocatable sincoeffourzrot
Definition: inputParam.F90:386
integer(kind=inttype) degreepolzrot
Definition: inputParam.F90:339
logical gridmotionspecified
Definition: inputParam.F90:481
real(kind=realtype), dimension(:), allocatable coscoeffouryrot
Definition: inputParam.F90:374
integer(kind=inttype) degreefourzrot
Definition: inputParam.F90:355
real(kind=realtype), dimension(:), allocatable coefpolzrot
Definition: inputParam.F90:347
real(kind=realtype), dimension(:), allocatable coefpolyrot
Definition: inputParam.F90:346
real(kind=realtype), dimension(3) rotpoint
Definition: inputParam.F90:330
real(kind=realtype), dimension(:), allocatable coscoeffourzrot
Definition: inputParam.F90:375
real(kind=realtype), dimension(:), allocatable sincoeffourxrot
Definition: inputParam.F90:384
logical recomputeoverlapmatrix
Definition: inputParam.F90:894
integer(kind=inttype) loadbalanceiter
Definition: inputParam.F90:502
real(realtype) loadimbalance
Definition: inputParam.F90:500
logical splitblocks
Definition: inputParam.F90:501
recursive subroutine setentrieswcycle(counter, nLevels)
logical function digitsonlyinstring(string)
subroutine isovariables(variables)
subroutine monitorvariables(variables)
subroutine findnextinfoline(readUnit, string)
subroutine surfacevariables(variables)
subroutine setisosurfacevariable(variable, iVar)
subroutine volumevariables(variables)
recursive integer(kind=inttype) function computenstepswcycle(nLevels)
subroutine initializeisosurfacevariables(values, nValues)
integer(kind=inttype), parameter none
real(kind=realtype) ssuthdim
Definition: inputParam.F90:604
real(kind=realtype) turbintensityinf
Definition: inputParam.F90:597
real(kind=realtype) gammaconstant
Definition: inputParam.F90:595
real(kind=realtype) eddyvisinfratio
Definition: inputParam.F90:597
integer(kind=inttype) equations
Definition: inputParam.F90:583
integer(kind=inttype) equationmode
Definition: inputParam.F90:583
real(kind=realtype), dimension(:), allocatable sepsenmaxfamily
Definition: inputParam.F90:609
real(kind=realtype) tsuthdim
Definition: inputParam.F90:604
real(kind=realtype) reynolds
Definition: inputParam.F90:594
real(kind=realtype), dimension(3) pointref
Definition: inputParam.F90:602
real(kind=realtype), dimension(3, 2) momentaxis
Definition: inputParam.F90:603
real(kind=realtype) prandtlturb
Definition: inputParam.F90:596
logical walldistanceneeded
Definition: inputParam.F90:589
real(kind=realtype), dimension(3) dragdirection
Definition: inputParam.F90:601
real(kind=realtype) reynoldslength
Definition: inputParam.F90:594
logical rvfb
Definition: inputParam.F90:586
integer(kind=inttype) turbprod
Definition: inputParam.F90:584
integer(kind=inttype) turbmodel
Definition: inputParam.F90:584
real(kind=realtype), dimension(:), allocatable cpmin_family
Definition: inputParam.F90:607
real(kind=realtype) lengthref
Definition: inputParam.F90:598
logical wallfunctions
Definition: inputParam.F90:589
real(kind=realtype) machcoef
Definition: inputParam.F90:593
real(kind=realtype) prandtl
Definition: inputParam.F90:596
real(kind=realtype), dimension(3) liftdirection
Definition: inputParam.F90:600
real(kind=realtype) pklim
Definition: inputParam.F90:596
integer(kind=inttype) flowtype
Definition: inputParam.F90:583
real(kind=realtype) surfaceref
Definition: inputParam.F90:598
integer(kind=inttype) cpmodel
Definition: inputParam.F90:584
real(kind=realtype) mach
Definition: inputParam.F90:593
real(kind=realtype) rgasdim
Definition: inputParam.F90:595
real(kind=realtype), dimension(3) veldirfreestream
Definition: inputParam.F90:599
real(kind=realtype) musuthdim
Definition: inputParam.F90:604
integer(kind=inttype) rvfn
Definition: inputParam.F90:585
real(kind=realtype) walloffset
Definition: inputParam.F90:596
logical writeunsteadysurfspectral
Definition: inputParam.F90:682
logical writeunsteadyvolspectral
Definition: inputParam.F90:681
real(kind=realtype) dtunsteadyrestartspectral
Definition: inputParam.F90:668
integer(kind=inttype) ntimeintervalsspectral
Definition: inputParam.F90:645
integer(kind=inttype) nunsteadysolspectral
Definition: inputParam.F90:680
logical writeunsteadyrestartspectral
Definition: inputParam.F90:669
integer(kind=inttype) ntimestepscoarse
Definition: inputParam.F90:731
real(kind=realtype), dimension(:), allocatable gammarkunsteady
Definition: inputParam.F90:745
logical useale
Definition: inputParam.F90:754
integer(kind=inttype) nrkstagesunsteady
Definition: inputParam.F90:742
real(kind=realtype) deltat
Definition: inputParam.F90:733
integer(kind=inttype) timeintegrationscheme
Definition: inputParam.F90:719
logical updatewalldistanceunsteady
Definition: inputParam.F90:765
integer(kind=inttype) timeaccuracy
Definition: inputParam.F90:730
real(kind=realtype), dimension(:, :), allocatable betarkunsteady
Definition: inputParam.F90:744
integer(kind=inttype) ntimestepsfine
Definition: inputParam.F90:731
integer(kind=inttype) noldlevels
Definition: iteration.f90:79
real(kind=realtype), dimension(:, :), allocatable coefmeshale
Definition: iteration.f90:109
integer(kind=inttype) nalemeshes
Definition: iteration.f90:107
real(kind=realtype), dimension(:), allocatable coeftime
Definition: iteration.f90:80
real(kind=realtype), dimension(:), allocatable coeftimeale
Definition: iteration.f90:108
integer(kind=inttype) nalesteps
Definition: iteration.f90:107
logical, dimension(:), allocatable oldsolwritten
Definition: iteration.f90:123
integer(kind=inttype) noldsolavail
Definition: iteration.f90:79
logical timespectralgridsnotwritten
Definition: iteration.f90:121
logical routinefailed
Definition: killSignals.f90:36
logical fatalfail
Definition: killSignals.f90:37
integer nmon
Definition: monitor.f90:30
integer nmonmax
Definition: monitor.f90:30
real(kind=realtype), dimension(:), allocatable monloc
Definition: monitor.f90:39
logical monmachorhmax
Definition: monitor.f90:55
integer nmonsum
Definition: monitor.f90:30
logical showcpu
Definition: monitor.f90:56
character(len=maxcgnsnamelen), dimension(:), allocatable monnames
Definition: monitor.f90:46
real(kind=realtype) timeunsteadyrestart
Definition: monitor.f90:98
integer(kind=inttype) ntimestepsrestart
Definition: monitor.f90:97
logical monmasssliding
Definition: monitor.f90:63
real(kind=realtype), dimension(:), allocatable monglob
Definition: monitor.f90:40
real(kind=realtype), dimension(:), allocatable monref
Definition: monitor.f90:41
real(kind=realtype), parameter rvfn6cmu
Definition: paramTurb.F90:75
real(kind=realtype) rvflimite
Definition: paramTurb.F90:80
real(kind=realtype), parameter rvfn1cmu
Definition: paramTurb.F90:71
real(kind=realtype), parameter rvfn6cl
Definition: paramTurb.F90:78
real(kind=realtype) rvfcmu
Definition: paramTurb.F90:81
real(kind=realtype) rvfcl
Definition: paramTurb.F90:80
real(kind=realtype), parameter rvfn1cl
Definition: paramTurb.F90:74
real(kind=realtype) rvflimitk
Definition: paramTurb.F90:80
subroutine qsortintegers(arr, nn)
Definition: sorting.F90:101
integer(kind=inttype) function bsearchintegers(key, base)
Definition: sorting.F90:18
subroutine initcurvefitdatakw
subroutine initcurvefitdatasst
subroutine initcurvefitdatakwmod
subroutine initcurvefitdataktau
subroutine initcurvefitdatasae
subroutine initcurvefitdatavf
subroutine initcurvefitdatasa
Definition: utils.F90:1
subroutine echk(errorcode, file, line)
Definition: utils.F90:5722
subroutine converttolowercase(string)
Definition: utils.F90:5756
subroutine terminate(routineName, errorMessage)
Definition: utils.F90:502