62 TYPE(t_region
),
POINTER :: regions(:)
63 INTEGER,
INTENT(IN) :: tbctype
66 INTEGER :: ireg, ipatch,
n
69 INTEGER,
PARAMETER :: nvals_max = 10
71 CHARACTER(10) :: keys(nvals_max), bcvar, pwisestr
72 CHARACTER(32) :: bctitle
73 CHARACTER(256) :: fname,
line
76 INTEGER :: n1, n2, ioff, ijbeg, ijend, errorflag
77 INTEGER :: ftype, bccode, var, nswitches, nparams, nsvals, nbvals, ndata
78 INTEGER :: switches(nvals_max), njumps
80 LOGICAL :: defined(nvals_max)
82 REAL(RFREAL) :: vals(nvals_max)
83 REAL(RFREAL),
ALLOCATABLE :: holdvals(:), morevals(:)
92 global => regions(1)%global
95 'RFLO_ReadTbcSection.F90' )
97 IF (global%flowType == flow_steady) &
98 CALL
errorstop( global,err_steady,__line__ )
103 READ(if_input,
'(A256)',err=10,
end=10)
line
104 IF (len_trim(
line) > 0)
EXIT
107 READ(
line,*) bctitle, bcvar
114 SELECT CASE(trim(bctitle))
121 CALL
errorstop( global,err_bc_varname,__line__,
'SLIPW' )
125 bccode = bc_noslipwall
127 SELECT CASE(trim(bcvar))
129 var = bcdat_noslip_twall
131 CALL
errorstop( global,err_bc_varname,__line__,
'NOSLIP' )
134 CASE (
'INFLOW_TOTANG')
138 SELECT CASE(trim(bcvar))
140 var = bcdat_inflow_ptot
142 var = bcdat_inflow_ttot
144 var = bcdat_inflow_betah
146 var = bcdat_inflow_betav
148 var = bcdat_inflow_mach
150 CALL
errorstop( global,err_bc_varname,__line__,
'INFLOW' )
153 CASE (
'INFLOW_VELTEMP')
157 SELECT CASE(trim(bcvar))
169 CALL
errorstop( global,err_bc_varname,__line__,
'INFLOW_VELTEMP' )
172 CASE (
'INFLOW_VELPRESS')
176 SELECT CASE(trim(bcvar))
188 CALL
errorstop( global,err_bc_varname,__line__,
'INFLOW_VELPRESS' )
195 SELECT CASE(trim(bcvar))
197 var = bcdat_outflow_press
199 CALL
errorstop( global,err_bc_varname,__line__,
'OUTFLOW' )
206 SELECT CASE(trim(bcvar))
208 var = bcdat_farf_mach
210 var = bcdat_farf_attack
212 var = bcdat_farf_slip
214 var = bcdat_farf_press
216 var = bcdat_farf_temp
218 CALL
errorstop( global,err_bc_varname,__line__,
'FARF' )
223 bccode = bc_injection
225 SELECT CASE(trim(bcvar))
227 var = bcdat_inject_mfrate
229 var = bcdat_inject_temp
231 var = bcdat_inject_rfvfu
233 var = bcdat_inject_rfvfv
235 var = bcdat_inject_rfvfw
237 CALL
errorstop( global,err_bc_varname,__line__,
'INJECT' )
250 IF (bcvar(1:4) ==
'DENS')
THEN
251 IF (len_trim(bcvar) == 4)
THEN
252 WRITE(*,*)
'### WARNING: Improper specification in PEUL_INFLOW TBC'
253 WRITE(*,*)
' assuming DENS to mean DENS1'
256 READ(bcvar(5:),*) var
259 CALL
errorstop( global,err_bc_varname,__line__,
'PEUL_INFLOW' )
266 IF (bcvar(1:4) ==
'DENS')
THEN
267 IF (len_trim(bcvar) == 4)
THEN
268 WRITE(*,*)
'### WARNING: Improper specification in PEUL_FARF TBC'
269 WRITE(*,*)
' assuming DENS to mean DENS1'
272 READ(bcvar(5:),*) var
275 CALL
errorstop( global,err_bc_varname,__line__,
'PEUL_FARF' )
280 bccode = bc_injection
282 IF (bcvar(1:4) ==
'FRAC')
THEN
283 IF (len_trim(bcvar) == 4)
THEN
284 WRITE(*,*)
'### WARNING: Improper specification in PEUL_INJECT TBC'
285 WRITE(*,*)
' assuming FRAC to mean FRAC1'
288 READ(bcvar(5:),*) var
291 CALL
errorstop( global,err_bc_varname,__line__,
'PEUL_INJECT' )
298 CALL
errorstop( global,err_unknown_bc,__line__ )
304 keys(tbcdat_ontime) =
'ONTIME'
305 keys(tbcdat_offtime) =
'OFFTIME'
306 keys(tbcdat_amp) =
'AMP'
308 SELECT CASE ( tbctype )
310 CASE ( tbc_sinusoidal )
311 keys(tbcdat_freq) =
'FREQ'
312 keys(tbcdat_phase) =
'PHASE'
315 CASE ( tbc_stochastic )
316 keys(tbcdat_timecor) =
'TIMECOR'
317 keys(tbcdat_shape) =
'SHAPE'
318 keys(tbcdat_mincut) =
'MINCUT'
319 keys(tbcdat_maxcut) =
'MAXCUT'
322 CASE ( tbc_whitenoise )
326 CASE ( tbc_piecewise )
332 CALL
errorstop( global,err_reached_default,__line__ )
339 IF (.NOT. defined(tbcdat_ontime)) vals(tbcdat_ontime) = -1.e20_rfreal
340 IF (vals(tbcdat_ontime) < 0.0_rfreal) vals(tbcdat_ontime) = -1.e20_rfreal
342 IF (.NOT. defined(tbcdat_offtime)) vals(tbcdat_offtime) = 1.e20_rfreal
343 IF (vals(tbcdat_offtime) < 0.0_rfreal) vals(tbcdat_offtime) = 1.e20_rfreal
345 IF (tbctype /= tbc_piecewise)
THEN
346 IF (.NOT. defined(tbcdat_amp)) &
347 CALL
errorstop( global,err_bcval_missing,__line__ )
349 IF (vals(tbcdat_amp) <= 0.0_rfreal) &
350 CALL
errorstop( global,err_val_bcval,__line__ )
355 SELECT CASE ( tbctype )
357 CASE ( tbc_sinusoidal )
364 IF (.NOT. defined(tbcdat_freq)) &
365 CALL
errorstop( global,err_bcval_missing,__line__ )
367 IF (.NOT. defined(tbcdat_phase)) vals(tbcdat_phase) = 0.0_rfreal
368 vals(tbcdat_phase) = vals(tbcdat_phase)*global%rad
370 CASE ( tbc_stochastic )
377 IF (.NOT. defined(tbcdat_timecor)) &
378 CALL
errorstop( global,err_bcval_missing,__line__ )
380 IF (vals(tbcdat_timecor) <= 0.0_rfreal) &
381 CALL
errorstop( global,err_val_bcval,__line__ )
383 IF (.NOT. defined(tbcdat_shape)) vals(tbcdat_shape) = 1.0_rfreal
385 IF (vals(tbcdat_shape) < 0.1_rfreal .OR. vals(tbcdat_shape) > 10.0_rfreal) &
386 CALL
errorstop( global,err_val_bcval,__line__ )
388 IF (.NOT. defined(tbcdat_mincut)) vals(tbcdat_mincut) = -1.0_rfreal
389 IF (.NOT. defined(tbcdat_maxcut)) vals(tbcdat_maxcut) = -1.0_rfreal
391 CASE ( tbc_whitenoise )
398 IF (.NOT. defined(4)) switches(tbcswi_substep) = tbcopt_step
399 IF (vals(4) < 0.1_rfreal)
THEN
400 switches(tbcswi_substep) = tbcopt_step
402 switches(tbcswi_substep) = tbcopt_substep
405 CASE ( tbc_piecewise )
411 IF (.NOT. defined(3)) switches(tbcswi_order) = tbcopt_constant
412 IF (vals(3) < 0.1_rfreal)
THEN
413 switches(tbcswi_order) = tbcopt_constant
415 switches(tbcswi_order) = tbcopt_linear
418 IF (.NOT. defined(4)) &
419 CALL
errorstop( global,err_bcval_missing,__line__ )
420 njumps = nint(vals(4))
421 switches(tbcswi_njumps) = njumps
422 IF (njumps < 1 .OR. njumps > 1000000) &
423 CALL
errorstop( global,err_val_bcval,__line__ )
425 SELECT CASE (switches(tbcswi_order))
426 CASE (tbcopt_constant)
427 nparams = tbcdat_dat0 + 2*njumps+1
429 nparams = tbcdat_dat0 + 2*njumps
432 ALLOCATE( morevals(nparams),stat=errorflag )
433 global%error = errorflag
434 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
436 morevals(1:tbcdat_dat0) = vals(1:tbcdat_dat0)
437 DO n=tbcdat_dat0+1,nparams
439 READ(if_input,
'(A256)',err=10,
end=10)
line
440 IF (len_trim(
line) > 0)
EXIT
442 IF (
line(1:1) ==
'#') goto 10
444 READ(
line,*) pwisestr, morevals(
n)
449 DO n=tbcdat_dat0+4,nparams,2
450 IF (morevals(
n) .le. morevals(
n-2)) &
451 CALL
errorstop( global,err_val_bcval,__line__ )
455 READ(if_input,
'(A256)',err=10,
end=10)
line
456 IF (
line(1:1) ==
'#')
EXIT
460 CALL
errorstop( global,err_reached_default,__line__ )
469 patch => regions(ireg)%levels(1)%patches(ipatch)
471 IF ((
patch%bcType>=bccode .AND. &
472 patch%bcType<=bccode+bc_range) .AND. &
473 regions(ireg)%procid==global%myProcid .AND. &
474 regions(ireg)%active==active)
THEN
479 ijbeg = indij( 0, 0,ioff)
480 ijend = indij(n1,n2,ioff)
495 CALL
errorstop( global,err_reached_default,__line__ )
502 IF (.NOT. bc%bcSet) &
503 CALL
errorstop( global,err_no_bcspecified,__line__ )
505 IF (var > ndata)
THEN
506 WRITE(*,*)
'ftype, bcCode, nData, var: ', ftype, bccode, ndata, var
507 CALL
errorstop( global,err_bc_varname,__line__ )
510 IF (tbc%tbcType /= tbc_none) &
511 CALL
errorstop( global,err_patch_overspec,__line__,
'TBC' )
513 tbc%tbcType = tbctype
515 IF (nswitches > 0)
THEN
516 ALLOCATE( tbc%switches(nswitches),stat=errorflag )
517 tbc%switches = switches(1:nswitches)
520 IF (nparams > 0)
THEN
521 ALLOCATE( tbc%params(nparams),stat=errorflag )
522 IF (tbctype == tbc_piecewise)
THEN
523 tbc%params = morevals(1:nparams)
525 tbc%params = vals(1:nparams)
530 ALLOCATE( tbc%svals(nsvals),stat=errorflag )
531 tbc%svals = 0.0_rfreal
535 ALLOCATE( tbc%bvals(nbvals,ijbeg:ijend),stat=errorflag )
536 tbc%bvals = 0.0_rfreal
537 IF (tbctype == tbc_stochastic) &
538 tbc%bvals(tbcsto_val,:) = 0.5_rfreal * tbc%params(tbcdat_amp)**2
543 IF (tbctype == tbc_stochastic .OR. &
544 tbctype == tbc_whitenoise) bc%distrib = bcdat_distrib
546 IF (bc%distrib == bcdat_distrib)
THEN
547 ALLOCATE( tbc%mean(ijbeg:ijend),stat=errorflag )
549 ALLOCATE( tbc%mean(0:1),stat=errorflag )
552 global%error = errorflag
553 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
558 IF (bc%distrib == bcdat_distrib .AND. distrib == bcdat_constant)
THEN
560 ALLOCATE( holdvals(ndata),stat=errorflag )
561 global%error = errorflag
562 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
563 holdvals = bc%vals(:,1)
565 DEALLOCATE( bc%vals,stat=errorflag )
566 global%error = errorflag
567 IF (global%error /= 0) CALL
errorstop(global,err_deallocate,__line__)
569 ALLOCATE( bc%vals(ndata,ijbeg:ijend),stat=errorflag )
570 global%error = errorflag
571 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
573 bc%vals(
n,:) = holdvals(
n)
576 DEALLOCATE ( holdvals,stat=errorflag )
577 global%error = errorflag
578 IF (global%error /= 0) CALL
errorstop(global,err_deallocate,__line__)
582 tbc%mean = bc%vals(var,:)
589 IF (
ALLOCATED(morevals))
THEN
590 DEALLOCATE ( morevals,stat=errorflag )
591 global%error = errorflag
592 IF (global%error /= 0) CALL
errorstop(global,err_deallocate,__line__)
600 CALL
errorstop( global,err_file_read,__line__ )
CImg< T > & line(const unsigned int y0)
Get a line.
subroutine registerfunction(global, funName, fileName)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE brbeg
subroutine readpatchsection(global, fileID, nvals, keys, vals, brbeg, brend, prbeg, prend, distrib, profType, fname, defined)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE USE ModDataTypes USE prend
subroutine rflo_readtbcsection(regions, tbcType)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE USE ModDataTypes USE prbeg
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE USE ModDataTypes USE nvals
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)