-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmanufacmod.f
268 lines (268 loc) · 8.74 KB
/
manufacmod.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
* © 2023. Triad National Security, LLC. All rights reserved.
* This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National
* Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of
* Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad
* National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration.
* The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up,
* irrevocable worldwide license in this material to reproduce, prepare. derivative works, distribute
* copies to the public, perform publicly and display publicly, and to permit others to do so.
*This file is part of SuperNu. SuperNu is released under the terms of the GNU GPLv3, see COPYING.
*Copyright (c) 2013-2022 Ryan T. Wollaeger and Daniel R. van Rossum. All rights reserved.
module manufacmod
c -----------------
implicit none
************************************************************************
* any constants or factors from particular manufactured solutions
* to be used in source
************************************************************************
c
c
c-- max and min values for constant linear profile function
real*8,parameter,private :: mnf_aa11 = 1.371d14*2.997924562d10 !erg/cm^2/s
real*8,parameter,private :: mnf_aa22 = 1.371d12*2.997924562d10 !erg/cm^2/s
c
c-- a uniform temperature value (or possibly nominal temperature value)
! real*8,parameter :: mnf_temp0 = 1.1602621d7 !K
real*8,parameter,private :: mnf_temp0 = 1.160237998048407d7 !K
c
save
c
contains
c
c
c
subroutine check_manufacpars
c ----------------------------!{{{
use miscmod, only:warn
use inputparmod
implicit none
************************************************************************
* check relevant input parameters for consistency with manufactured
* solution constraints
************************************************************************
c
if(in_opacanaltype=='none')
& stop 'check_manufacpars: invalid in_opacanaltype'
if(.not.in_nobbopac)
& stop 'check_manufacpars: invalid in_nobbopac'
if(.not.in_nobfopac)
& stop 'check_manufacpars: invalid in_nobfopac'
if(.not.in_noffopac)
& stop 'check_manufacpars: invalid in_noffopac'
if(.not.in_nothmson)
& stop 'check_manufacpars: invalid in_nothmson'
if(in_str_dentype/='unif')
& call warn('check_manufacpars','in_str_dentype/=unif')
c!}}}
end subroutine check_manufacpars
c
c
subroutine generate_manuradsrc(totmass,sigcoef,texp,dt)
c ------------------------------!{{{
use miscmod, only:warn
use physconstmod
use gridmod
use gasmod
use inputparmod
implicit none
real*8,intent(in) :: totmass,sigcoef,texp,dt
************************************************************************
* calculate finite volume manufactured radiation source per cell
* per group in ergs with manufactured parameters
************************************************************************
integer :: i,l
c
c-- verify applicable input pars
call check_manufacpars
c
c-- determine manufacture type
if(in_isvelocity) then
c
c-- implement/modify velocity dependent manufactured radiation source
select case (in_opacanaltype)
case ('grey')
c-- grey solution
do i=1,grd_nx
l = grd_icell(i,1,1)
grd_emitex(l)= (1d0/dt)*(
& log((texp+dt)/texp)
& *(4d0*mnf_aa11/pc_c)+
& (3d0*totmass*sigcoef/
& (8d0*pc_pi*in_str_velout))*
& ((in_str_velout*texp)**(-2d0)-
& (in_str_velout*(texp+dt))**(-2d0))*
& (mnf_aa11-pc_acoef*pc_c*mnf_temp0**4)
& )
!
enddo
grd_emitex = grd_emitex*grd_vol*dt
c--
case ('mono')
stop 'generate_manuradsrc: in_opacanaltype=mono'
case ('pick')
stop 'generate_manuradsrc: in_opacanaltype=pick'
case ('line')
c-- line solution
stop 'generate_manuradsrc: in_opacanaltype=line'
case default
stop 'in_opacanaltype unknown'
end select
c
c
else
c
c-- implement/modify static manufactured radiation source
stop 'generate_manuradsrc: no static sources'
c
c
endif
c!}}}
end subroutine generate_manuradsrc
c
c
subroutine generate_manutempsrc(totmass,sigcoef,texp,dt)
c -------------------------------!{{{
use physconstmod
use gasmod
use inputparmod
implicit none
real*8,intent(in) :: totmass,sigcoef,texp,dt
************************************************************************
* calculate finite volume manufactured temperature source
* (gas_matsrc) in ergs/cm^3/s with manufactured parameters
************************************************************************
c
c-- verify applicable input pars
call check_manufacpars
c
c-- determine manufacture type
if(in_isvelocity) then
c
c-- implement/modify velocity dependent manufactured temperature source
select case (in_opacanaltype)
case ('grey')
c-- grey solution
gas_matsrc = (1d0/dt)*
& (3d0*totmass*sigcoef/(8d0*pc_pi*in_str_velout))*
& ((in_str_velout*texp)**(-2d0)-
& (in_str_velout*(texp+dt))**(-2d0))*
& (pc_acoef*pc_c*mnf_temp0**4d0-mnf_aa11)
c
case ('mono')
stop 'generate_manutempsrc: in_opacanaltype=mono'
case ('pick')
stop 'generate_manutempsrc: in_opacanaltype=pick'
case ('line')
c-- line solution
gas_matsrc = 0d0 !already set zero in gasmod
c
case default
stop 'in_opacanaltype unknown'
end select
c
c
else
c
c-- implement/modify static manufactured temperature source
stop 'generate_manutempsrc: no static sources'
c
c
endif
c!}}}
end subroutine generate_manutempsrc
c
c
subroutine init_manuprofile
c ---------------------------
use physconstmod
use inputparmod
use gridmod
implicit none
************************************************************************
* calculate finite volume manufactured initial energy per cell per group
* in ergs with manufactured parameters
************************************************************************
c-- verify applicable input pars
call check_manufacpars
c
c-- determine manufacture type
if(.not.in_isvelocity) then
c-- implement/modify static manufactured temperature source
stop 'init_manuprofile: no static sources'
else
c
c-- implement/modify velocity dependent manufactured initial profile
select case (in_opacanaltype)
case ('grey')
c-- grey solution
grd_evolinit = (mnf_aa11/pc_c) * grd_vol
c
case ('mono')
stop 'init_manuprofile: in_opacanaltype=mono'
case ('pick')
stop 'init_manuprofile: in_opacanaltype=pick'
case ('line')
c-- line solution
stop 'init_manuprofile: in_opacanaltype=line ! implemented'
case default
stop 'in_opacanaltype unknown'
end select
endif
c
end subroutine init_manuprofile
c
c
subroutine init_manutemp
c ---------------------------
use physconstmod
use gridmod
use inputparmod
use gasmod
use groupmod
implicit none
************************************************************************
* calculate initial temperature in Kelvin
* with manufactured parameters
************************************************************************
c
c-- verify applicable input pars
call check_manufacpars
c
c-- determine manufacture type
if(in_isvelocity) then
c
c-- implement/modify velocity dependent manufactured initial profile
select case (in_opacanaltype)
case ('grey')
c-- grey solution (uniform nominal temperature)
gas_temp = mnf_temp0
c
case ('mono')
stop 'init_manutemp: in_opacanaltype=mono'
case ('pick')
stop 'init_manutemp: in_opacanaltype=pick'
case ('line')
c-- line solution
if(grp_ng/=2)
& stop 'init_manutemp: in_opacanaltype=line'
if(in_ldisp1/in_ldisp2>=1d-3)
& stop 'init_manutemp: in_ldisp1/in_ldisp2>=1d-3'
c
gas_temp = mnf_temp0
c
case default
stop 'in_opacanaltype unknown'
end select
c
c
else
c
c-- implement/modify static manufactured initial temperature
stop 'init_manutemp: no static solution'
c
endif
c
end subroutine init_manutemp
c
end module manufacmod
c vim: fdm=marker