Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
APN_input_0d.f90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !
24 ! ---------------------------------------------------------------------------
25 !
26 ! SUBROUTINE : APN_input_0d
27 !
28 ! This subroutine read inputs for burning rate model Rocburn_1D_APN
29 !
30 ! Authors :
31 !
32 ! Creation Date : Sep. 10, 2002
33 !
34 ! Modifications :
35 !
36 ! No. Date Authors Description
37 !
38 !
39 ! ---------------------------------------------------------------------------
40 !
41 !
42 ! arguments :
43 !
44 ! G_APN : Global variables for Rocburn_1D_APN
45 ! Indir : directory for input data file
46 !
47 ! ---------------------------------------------------------------------------
48 !
49  SUBROUTINE apn_input_0d(G_APN, Indir)
50 
52 
53  IMPLICIT NONE
54  include 'mpif.h'
55 
56 !
57 ! Global data for Rocburn_1D_APN passed as a pointer
58 !
59 
60  TYPE (g_burn_1d), POINTER :: g_apn
61 !
62 ! arguments
63 !
64  CHARACTER(*), INTENT(IN) :: indir
65  CHARACTER(*), PARAMETER :: controlfile = "RocburnAPNControl.txt"
66 
67 !
68 !
69 !
70 !
71 ! ----------------------------------------------------------------
72 ! local variables
73  CHARACTER(LEN=80) :: infile
74 
75  INTEGER :: ir, ioerr
76  INTEGER :: mat
77 
78 !
79 ! read propellant thermophysical properties
80 !
81 
82  ir = 10
83 
84  if (indir(len_trim(indir):len_trim(indir)) == '/') then
85  infile= trim(indir) // controlfile
86  else
87  infile= trim(indir) // '/' // controlfile
88  endif
89 
90  OPEN (unit=ir,file=infile,status='old')
91 
92 !RAF
93 !RAF Extend for multiple propellants, but keep it backward compatible
94 !RAF Specify same value for nxmax and To for all materials.
95 !RAF
96 
97  DO mat = 1, matmax
98  READ(ir,*,iostat=ioerr) g_apn%a_p(mat)
99  IF (ioerr /= 0) THEN
100  g_apn%nmat = mat - 1
101  EXIT
102  ENDIF
103  g_apn%nmat = mat
104  READ(ir,*) g_apn%n_p(mat)
105  READ(ir,*) g_apn%nxmax
106  READ(ir,*) g_apn%Tf_adiabatic(mat)
107  READ(ir,*) g_apn%To
108  READ(ir,*,iostat=ioerr) g_apn%xmax(mat)
109  IF (ioerr /= 0) THEN
110  g_apn%xmax(mat) = 1.0e+15
111  ENDIF
112  IF (ioerr /= 0) EXIT
113  END DO
114 
115  READ(ir,*,iostat=ioerr) g_apn%verbosity
116  IF(ioerr /= 0) THEN
117  g_apn%verbosity = 1
118  ENDIF
119 
120  CLOSE(ir)
121 
122  IF(g_apn%rank .eq. 0 .AND. g_apn%verbosity .gt. 0) THEN
123  WRITE(6,'(A)') 'RocburnAPN: *********** Using APN Burn Model **************'
124  ENDIF
125  IF(g_apn%rank .eq. 0 .AND. g_apn%verbosity .gt. 1) THEN
126  WRITE(6,'(A,i3,A)') 'RocburnAPN: Found a total of ',g_apn%nmat,' materials'
127  DO mat = 1, g_apn%nmat
128  WRITE(6,'(A,i3,A,f12.4)') 'RocburnAPN: a_p(',mat,') =',g_apn%a_p(mat)
129  WRITE(6,'(A,i3,A,f12.4)') 'RocburnAPN: n_p(',mat,') =',g_apn%n_p(mat)
130  WRITE(6,'(A,i3)') 'RocburnAPN: nxmax= ',g_apn%nxmax
131  WRITE(6,'(A,i3,A,f12.4)') 'RocburnAPN: Tf_adiabatic(',mat,') = ',&
132  g_apn%Tf_adiabatic(mat)
133  WRITE(6,'(A,f12.4)') 'RocburnAPN: To= ',g_apn%To
134  WRITE(6,'(A,i3,A,f12.4)') 'RocburnAPN: xmax(',mat,') =',&
135  g_apn%xmax(mat)
136  END DO
137  END IF
138 
139  IF (g_apn%verbosity.gt.2) print *,'RocburnAPN: rank=',g_apn%rank, &
140  ' done input ', controlfile
141 
142  RETURN
143 
144  END SUBROUTINE apn_input_0d
145 
146 
147 
148 
149 
150 
subroutine apn_input_0d(G_APN, Indir)
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
const std::string & unit() const
Obtain the unit of the attribute.
Definition: Attribute.h:200
virtual std::ostream & print(std::ostream &os) const