66 TYPE(t_region
),
POINTER :: pregion
72 CHARACTER(CHRLEN) :: errorstring,rcsidentstring
75 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvmixt,pcvspec
77 TYPE(t_grid),
POINTER :: pgrid
85 '$RCSfile: SPEC_RFLU_InitFlowHardCode.F90,v $ $Revision: 1.17 $'
87 global => pregion%global
90 'SPEC_RFLU_InitFlowHardCode.F90')
92 IF ( global%verbLevel > verbose_none )
THEN
93 WRITE(stdout,
'(A,1X,A)') solver_name, &
94 'Initializing species flow field from hard code...'
96 IF ( global%verbLevel > verbose_low )
THEN
97 WRITE(stdout,
'(A,3X,A,A)') solver_name,
'Case: ',trim(global%casename)
105 pgrid => pregion%grid
106 pcvmixt => pregion%mixt%cv
107 pcvspec => pregion%spec%cv
108 pmixtinput => pregion%mixtInput
110 pregion%spec%cvState = cv_mixt_state_prim
116 SELECT CASE ( global%casename )
123 IF ( pregion%specInput%nSpecies /= 2 )
THEN
124 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
125 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
128 DO icg = 1,pgrid%nCellsTot
129 x = pgrid%cofg(xcoord,icg)
130 y = pgrid%cofg(ycoord,icg)
132 IF ( (
x < pmixtinput%prepRealVal1) .AND. &
133 (
y < pmixtinput%prepRealVal2) )
THEN
134 pcvspec(1,icg) = 0.04_rfreal
135 pcvspec(2,icg) = 0.96_rfreal
137 pcvspec(1,icg) = 1.0_rfreal
138 pcvspec(2,icg) = 0.0_rfreal
147 IF ( pregion%specInput%nSpecies /= 2 )
THEN
148 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
149 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
152 DO icg = 1,pgrid%nCellsTot
153 x = pgrid%cofg(xcoord,icg)
155 IF (
x < 0.0_rfreal )
THEN
156 pcvspec(1,icg) = 0.5_rfreal
157 pcvspec(2,icg) = 0.5_rfreal
159 pcvspec(1,icg) = 1.0_rfreal
160 pcvspec(2,icg) = 0.0_rfreal
168 CASE (
"kjet2v3mp",
"kjet2v4mp",
"kjet2v5mp" )
169 IF ( pregion%specInput%nSpecies /= 2 )
THEN
170 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
171 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
174 DO icg = 1,pgrid%nCellsTot
175 x = pgrid%cofg(xcoord,icg)
177 IF (
x < pmixtinput%prepRealVal8 )
THEN
178 pcvspec(1,icg) = pmixtinput%prepRealVal9
179 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal9
181 pcvspec(1,icg) = pmixtinput%prepRealVal10
182 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal10
190 CASE (
"MShock_H2O_Air001", &
191 "MShock_H2O_Air002" )
192 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
193 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
194 'Case initialization only valid with gas-liq model.')
197 IF ( pregion%specInput%nSpecies /= 2 )
THEN
198 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
199 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
202 DO icg = 1,pgrid%nCellsTot
203 x = pgrid%cofg(xcoord,icg)
205 IF (
x < 0.7_rfreal )
THEN
206 pcvspec(1,icg) = 0.0_rfreal
207 pcvspec(2,icg) = 0.0_rfreal
209 pcvspec(1,icg) = 1.0_rfreal
210 pcvspec(2,icg) = 0.0_rfreal
218 CASE (
"MShock_Air_Air_He001" )
219 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
220 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
221 'Case initialization only valid with gas-liq model.')
224 IF ( pregion%specInput%nSpecies /= 2 )
THEN
225 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
226 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
229 DO icg = 1,pgrid%nCellsTot
230 x = pgrid%cofg(xcoord,icg)
232 IF (
x < 0.25_rfreal )
THEN
233 pcvspec(1,icg) = 1.0_rfreal
234 pcvspec(2,icg) = 0.0_rfreal
235 ELSE IF (
x > 0.25_rfreal .AND.
x < 0.5_rfreal )
THEN
236 pcvspec(1,icg) = 1.0_rfreal
237 pcvspec(2,icg) = 0.0_rfreal
239 pcvspec(1,icg) = 0.0_rfreal
240 pcvspec(2,icg) = 1.0_rfreal
250 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
251 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
252 'Case initialization only valid with gas-liq model.')
255 IF ( pregion%specInput%nSpecies /= 2 )
THEN
256 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
257 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
260 DO icg = 1,pgrid%nCellsTot
261 x = pgrid%cofg(xcoord,icg)
263 IF (
x <= 3.0e-03_rfreal )
THEN
264 pcvspec(1,icg) = 0.0_rfreal
265 pcvspec(2,icg) = 0.0_rfreal
267 pcvspec(1,icg) = 1.0_rfreal
268 pcvspec(2,icg) = 0.0_rfreal
276 CASE (
"ShockBubble" )
277 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
278 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
279 'Case initialization only valid with gas-liq model.')
282 IF ( pregion%specInput%nSpecies /= 2 )
THEN
283 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
284 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
287 DO icg = 1,pgrid%nCellsTot
288 x = pgrid%cofg(xcoord,icg)
289 y = pgrid%cofg(ycoord,icg)
291 IF ( ((
x-0.085_rfreal)**2 +
y**2) <= 6.25e-04_rfreal )
THEN
292 pcvspec(1,icg) = 0.0_rfreal
293 pcvspec(2,icg) = 1.0_rfreal
294 ELSE IF (
x < 0.050_rfreal )
THEN
295 pcvspec(1,icg) = 1.0_rfreal
296 pcvspec(2,icg) = 0.0_rfreal
298 pcvspec(1,icg) = 1.0_rfreal
299 pcvspec(2,icg) = 0.0_rfreal
311 CASE (
"stg1d",
"stg2d" )
312 IF ( pregion%specInput%nSpecies /= 2 )
THEN
313 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
314 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
317 DO icg = 1,pgrid%nCellsTot
318 x = pgrid%cofg(xcoord,icg)
320 IF (
x < pmixtinput%prepRealVal8 )
THEN
321 pcvspec(1,icg) = pmixtinput%prepRealVal9
322 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal9
323 ELSE IF ( (
x >= pmixtinput%prepRealVal8 ) .AND. &
324 (
x < pmixtinput%prepRealVal15) )
THEN
325 pcvspec(1,icg) = pmixtinput%prepRealVal10
326 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal10
328 pcvspec(1,icg) = pmixtinput%prepRealVal16
329 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal16
337 CASE (
"st_sod1_mp2",
"st_sod2_mp2" )
338 IF ( pregion%specInput%nSpecies /= 2 )
THEN
339 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
340 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
343 DO icg = 1,pgrid%nCellsTot
344 x = pgrid%cofg(xcoord,icg)
346 IF (
x < 0.0_rfreal )
THEN
347 pcvspec(1,icg) = pmixtinput%prepRealVal1
348 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal1
350 pcvspec(1,icg) = pmixtinput%prepRealVal2
351 pcvspec(2,icg) = 1.0_rfreal - pmixtinput%prepRealVal2
359 CASE (
"Two_Rarefaction" )
360 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
361 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
362 'Case initialization only valid with gas-liq model.')
365 IF ( pregion%specInput%nSpecies /= 2 )
THEN
366 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
367 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
370 DO icg = 1,pgrid%nCellsTot
371 x = pgrid%cofg(xcoord,icg)
373 IF (
x < 0.5_rfreal )
THEN
374 pcvspec(1,icg) = 0.01098577_rfreal
375 pcvspec(2,icg) = 0.0_rfreal
377 pcvspec(1,icg) = 0.01098577_rfreal
378 pcvspec(2,icg) = 0.0_rfreal
386 CASE (
"volcmod2dv3" )
387 IF ( pregion%mixtInput%gasModel == gas_model_mixt_tcperf .OR. &
388 pregion%mixtInput%gasModel == gas_model_mixt_pseudo )
THEN
389 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
390 'Case initialization not valid with mixture gas model.')
393 DO icg = 1,pgrid%nCellsTot
394 y = pgrid%cofg(ycoord,icg)
396 IF (
y < -500.0_rfreal )
THEN
397 DO ispec = 1,pregion%specInput%nSpecies
398 pcvspec(ispec,icg) = 1.0_rfreal
401 DO ispec = 1,pregion%specInput%nSpecies
402 pcvspec(ispec,icg) = 0.0_rfreal
411 CASE (
"2DShock001" )
412 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
413 CALL
errorstop(global,err_gasmodel_invalid,__line__, &
414 'Case initialization only valid with gas-liq model.')
417 IF ( pregion%specInput%nSpecies /= 2 )
THEN
418 WRITE(errorstring,
'(A,1X,I2)')
'Should be:',pregion%specInput%nSpecies
419 CALL
errorstop(global,err_spec_nspec_invalid,__line__,trim(errorstring))
422 DO icg = 1,pgrid%nCellsTot
423 x = pgrid%cofg(xcoord,icg)
425 IF (
x < 0.5_rfreal )
THEN
426 pcvspec(1,icg) = 1.0_rfreal
427 pcvspec(2,icg) = 0.0_rfreal
429 pcvspec(1,icg) = 1.0_rfreal
430 pcvspec(2,icg) = 0.0_rfreal
439 CALL
errorstop(global,err_reached_default,__line__)
446 IF ( global%verbLevel > verbose_none )
THEN
447 WRITE(stdout,
'(A,1X,A)') solver_name, &
448 'Initializing species flow field from hard code done.'
void int int REAL REAL * y
subroutine spec_rflu_initflowhardcode(pRegion)
subroutine registerfunction(global, funName, fileName)
void int int int REAL REAL REAL * z
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)