68 INTEGER,
INTENT(IN) :: tbctype
69 TYPE(t_region
),
POINTER :: pregion
75 INTEGER,
PARAMETER :: nvals_max = 10
77 LOGICAL :: defined(nvals_max)
78 CHARACTER(10) :: keys(nvals_max),bcvar,pwisestr
79 CHARACTER(32) :: bctitle
80 CHARACTER(256) :: fname,
line
81 CHARACTER(CHRLEN) :: bcname,rcsidentstring
82 INTEGER :: bccode,distrib,errorflag,ftype,ipatch,ireg,
n,nbvals,ndata, &
84 INTEGER :: switches(nvals_max)
85 REAL(RFREAL) :: vals(nvals_max)
86 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: holdvals,morevals
87 TYPE(t_patch),
POINTER :: ppatch
96 rcsidentstring =
'$RCSfile: RFLU_ReadTbcSection.F90,v $ $Revision: 1.12 $'
98 global => pregion%global
101 'RFLU_ReadTbcSection.F90' )
103 IF ( global%flowType == flow_steady )
THEN
104 CALL
errorstop( global,err_steady,__line__ )
112 READ(if_input,
'(A256)',err=10,
end=10)
line
113 IF ( len_trim(
line) > 0 )
THEN
118 READ(
line,*) bctitle,bcvar
127 SELECT CASE( trim(bctitle) )
140 CALL
errorstop(global,err_bc_varname,__line__,
'SLIPW')
148 bccode = bc_noslipwall
150 SELECT CASE(trim(bcvar))
152 var = bcdat_noslip_twall
154 CALL
errorstop(global,err_bc_varname,__line__,
'NOSLIP')
161 CASE (
'INFLOW_TOTANG')
163 bccode = bc_inflow_totang
165 SELECT CASE(trim(bcvar))
167 var = bcdat_inflow_ptot
169 var = bcdat_inflow_ttot
171 var = bcdat_inflow_betah
173 var = bcdat_inflow_betav
175 var = bcdat_inflow_mach
177 CALL
errorstop(global,err_bc_varname,__line__,
'INFLOW_TOTANG')
184 CASE (
'INFLOW_VELTEMP')
186 bccode = bc_inflow_veltemp
188 SELECT CASE(trim(bcvar))
200 CALL
errorstop(global,err_bc_varname,__line__,
'INFLOW_VELTEMP')
211 SELECT CASE(trim(bcvar))
213 var = bcdat_outflow_press
215 CALL
errorstop(global,err_bc_varname,__line__,
'OUTFLOW')
226 SELECT CASE(trim(bcvar))
228 var = bcdat_farf_mach
230 var = bcdat_farf_attack
232 var = bcdat_farf_slip
234 var = bcdat_farf_press
236 var = bcdat_farf_temp
238 CALL
errorstop(global,err_bc_varname,__line__,
'FARF')
247 bccode = bc_injection
249 SELECT CASE(trim(bcvar))
251 var = bcdat_inject_mfrate
253 var = bcdat_inject_temp
255 CALL
errorstop(global,err_bc_varname,__line__,
'INJECT')
280 IF ( bcvar(1:4) ==
'SPEC' )
THEN
281 IF ( len_trim(bcvar) == 4 )
THEN
282 global%warnCounter = global%warnCounter + 1
284 WRITE(stdout,
'(A,1X,A)') solver_name, &
285 '*** WARNING *** Improper specification in SPEC_INFLOW TBC.'
286 WRITE(stdout,
'(A,1X,A)') solver_name, &
287 ' Assuming SPEC to mean SPEC1.'
291 READ(bcvar(5:),*) var
294 CALL
errorstop(global,err_bc_varname,__line__,
'SPEC_INFLOW')
305 IF ( bcvar(1:4) ==
'SPEC' )
THEN
306 IF ( len_trim(bcvar) == 4 )
THEN
307 global%warnCounter = global%warnCounter + 1
309 WRITE(stdout,
'(A,1X,A)') solver_name, &
310 '*** WARNING *** Improper specification in SPEC_FARF TBC.'
311 WRITE(stdout,
'(A,1X,A)') solver_name, &
312 ' Assuming SPEC to mean SPEC1.'
316 READ(bcvar(5:),*) var
319 CALL
errorstop(global,err_bc_varname,__line__,
'SPEC_FARF')
328 bccode = bc_injection
330 IF ( bcvar(1:4) ==
'SPEC' )
THEN
331 IF ( len_trim(bcvar) == 4 )
THEN
332 global%warnCounter = global%warnCounter + 1
334 WRITE(stdout,
'(A,1X,A)') solver_name, &
335 '*** WARNING *** Improper specification in SPEC_INJECT TBC.'
336 WRITE(stdout,
'(A,1X,A)') solver_name, &
337 ' Assuming SPEC to mean SPEC1.'
341 READ(bcvar(5:),*) var
344 CALL
errorstop(global,err_bc_varname,__line__,
'SPEC_INJECT')
358 CALL
errorstop(global,err_unknown_bc,__line__)
365 keys(tbcdat_ontime) =
'ONTIME'
366 keys(tbcdat_offtime) =
'OFFTIME'
367 keys(tbcdat_amp) =
'AMP'
369 SELECT CASE ( tbctype )
370 CASE ( tbc_sinusoidal )
371 keys(tbcdat_freq) =
'FREQ'
372 keys(tbcdat_phase) =
'PHASE'
374 CASE ( tbc_stochastic )
375 keys(tbcdat_timecor) =
'TIMECOR'
376 keys(tbcdat_shape) =
'SHAPE'
377 keys(tbcdat_mincut) =
'MINCUT'
378 keys(tbcdat_maxcut) =
'MAXCUT'
380 CASE ( tbc_whitenoise )
383 CASE ( tbc_piecewise )
388 CALL
errorstop(global,err_reached_default,__line__)
392 distrib,fname,bcname,defined)
394 IF (.NOT. defined(tbcdat_ontime)) vals(tbcdat_ontime) = -1.e20_rfreal
395 IF (vals(tbcdat_ontime) < 0.0_rfreal) vals(tbcdat_ontime) = -1.e20_rfreal
397 IF (.NOT. defined(tbcdat_offtime)) vals(tbcdat_offtime) = 1.e20_rfreal
398 IF (vals(tbcdat_offtime) < 0.0_rfreal) vals(tbcdat_offtime) = 1.e20_rfreal
400 IF (tbctype /= tbc_piecewise)
THEN
401 IF (.NOT. defined(tbcdat_amp)) &
402 CALL
errorstop(global,err_bcval_missing,__line__)
404 IF (vals(tbcdat_amp) <= 0.0_rfreal) &
405 CALL
errorstop(global,err_val_bcval,__line__)
412 SELECT CASE ( tbctype )
418 CASE ( tbc_sinusoidal )
424 IF (.NOT. defined(tbcdat_freq)) &
425 CALL
errorstop(global,err_bcval_missing,__line__)
427 IF (.NOT. defined(tbcdat_phase)) vals(tbcdat_phase) = 0.0_rfreal
429 vals(tbcdat_phase) = vals(tbcdat_phase)*global%deg2rad
435 CASE ( tbc_stochastic )
441 IF (.NOT. defined(tbcdat_timecor)) &
442 CALL
errorstop(global,err_bcval_missing,__line__)
444 IF (vals(tbcdat_timecor) <= 0.0_rfreal) &
445 CALL
errorstop(global,err_val_bcval,__line__)
447 IF (.NOT. defined(tbcdat_shape)) vals(tbcdat_shape) = 1.0_rfreal
449 IF (vals(tbcdat_shape) < 0.1_rfreal .OR. vals(tbcdat_shape) > 10.0_rfreal) &
450 CALL
errorstop(global,err_val_bcval,__line__)
452 IF (.NOT. defined(tbcdat_mincut)) vals(tbcdat_mincut) = -1.0_rfreal
454 IF (.NOT. defined(tbcdat_maxcut)) vals(tbcdat_maxcut) = -1.0_rfreal
460 CASE ( tbc_whitenoise )
466 IF (.NOT. defined(4)) switches(tbcswi_substep) = tbcopt_step
468 IF ( vals(4) < 0.1_rfreal )
THEN
469 switches(tbcswi_substep) = tbcopt_step
471 switches(tbcswi_substep) = tbcopt_substep
478 CASE ( tbc_piecewise )
483 IF (.NOT. defined(3)) switches(tbcswi_order) = tbcopt_constant
485 IF (vals(3) < 0.1_rfreal)
THEN
486 switches(tbcswi_order) = tbcopt_constant
488 switches(tbcswi_order) = tbcopt_linear
491 IF (.NOT. defined(4))
THEN
492 CALL
errorstop( global,err_bcval_missing,__line__ )
495 njumps = nint(vals(4))
496 switches(tbcswi_njumps) = njumps
498 IF (njumps < 1 .OR. njumps > 1000000) &
499 CALL
errorstop(global,err_val_bcval,__line__)
501 SELECT CASE (switches(tbcswi_order))
502 CASE (tbcopt_constant)
503 nparams = tbcdat_dat0 + 2*njumps+1
505 nparams = tbcdat_dat0 + 2*njumps
508 ALLOCATE(morevals(nparams),stat=errorflag)
509 global%error = errorflag
510 IF ( global%error /= err_none )
THEN
511 CALL
errorstop(global,err_allocate,__line__)
514 morevals(1:tbcdat_dat0) = vals(1:tbcdat_dat0)
516 DO n=tbcdat_dat0+1,nparams
518 READ(if_input,
'(A256)',err=10,
end=10)
line
519 IF (len_trim(
line) > 0)
EXIT
522 IF (
line(1:1) ==
'#') goto 10
524 READ(
line,*) pwisestr, morevals(
n)
529 DO n=tbcdat_dat0+4,nparams,2
530 IF (morevals(
n) .le. morevals(
n-2)) &
531 CALL
errorstop(global,err_val_bcval,__line__)
535 READ(if_input,
'(A256)',err=10,
end=10)
line
536 IF (
line(1:1) ==
'#')
EXIT
544 CALL
errorstop(global,err_reached_default,__line__)
551 DO ipatch = 1,pregion%grid%nPatches
552 ppatch => pregion%patches(ipatch)
558 IF ( (ppatch%bcType >= bccode .AND. &
559 ppatch%bcType <= bccode+bc_range) .AND. &
560 (ppatch%iPatchGlobal >=
prbeg .AND. &
561 ppatch%iPatchGlobal <=
prend) )
THEN
572 CALL
errorstop(global,err_reached_default,__line__)
578 IF ( var > ndata )
THEN
579 CALL
errorstop(global,err_bc_varname,__line__)
582 IF ( tbc%tbcType /= tbc_none )
THEN
583 CALL
errorstop(global,err_patch_overspec,__line__,
'TBC')
586 tbc%tbcType = tbctype
588 IF ( nswitches > 0 )
THEN
589 ALLOCATE(tbc%switches(nswitches),stat=errorflag)
590 global%error = errorflag
591 IF ( global%error /= err_none )
THEN
592 CALL
errorstop(global,err_allocate,__line__)
595 tbc%switches = switches(1:nswitches)
598 IF ( nparams > 0 )
THEN
599 ALLOCATE(tbc%params(nparams),stat=errorflag)
600 global%error = errorflag
601 IF ( global%error /= err_none )
THEN
602 CALL
errorstop(global,err_allocate,__line__)
605 IF (tbctype == tbc_piecewise)
THEN
606 tbc%params = morevals(1:nparams)
608 tbc%params = vals(1:nparams)
613 ALLOCATE(tbc%svals(nsvals),stat=errorflag)
614 global%error = errorflag
615 IF ( global%error /= err_none )
THEN
616 CALL
errorstop(global,err_allocate,__line__)
619 tbc%svals = 0.0_rfreal
623 ALLOCATE(tbc%bvals(nbvals,ppatch%nBFaces),stat=errorflag)
624 global%error = errorflag
625 IF ( global%error /= err_none )
THEN
626 CALL
errorstop(global,err_allocate,__line__)
629 tbc%bvals = 0.0_rfreal
631 IF ( tbctype == tbc_stochastic )
THEN
632 tbc%bvals(tbcsto_val,:) = 0.5_rfreal * tbc%params(tbcdat_amp)**2
638 IF (tbctype == tbc_stochastic .OR. &
639 tbctype == tbc_whitenoise) bc%distrib = bcdat_distrib
641 IF ( bc%distrib == bcdat_distrib )
THEN
642 ALLOCATE(tbc%mean(ppatch%nBFaces),stat=errorflag)
644 ALLOCATE(tbc%mean(0:1),stat=errorflag)
647 global%error = errorflag
648 IF ( global%error /= err_none )
THEN
649 CALL
errorstop(global,err_allocate,__line__)
657 IF ( bc%distrib == bcdat_distrib .AND. distrib == bcdat_constant )
THEN
658 ALLOCATE( holdvals(ndata),stat=errorflag )
659 global%error = errorflag
660 IF ( global%error /= err_none )
THEN
661 CALL
errorstop(global,err_allocate,__line__)
664 holdvals = bc%vals(:,1)
666 DEALLOCATE(bc%vals,stat=errorflag)
667 global%error = errorflag
668 IF ( global%error /= err_none )
THEN
669 CALL
errorstop(global,err_deallocate,__line__)
672 ALLOCATE(bc%vals(ndata,ppatch%nBFaces),stat=errorflag)
673 global%error = errorflag
674 IF ( global%error /= err_none )
THEN
675 CALL
errorstop(global,err_allocate,__line__)
679 bc%vals(
n,:) = holdvals(
n)
682 DEALLOCATE (holdvals,stat=errorflag)
683 global%error = errorflag
684 IF ( global%error /= err_none )
THEN
685 CALL
errorstop(global,err_deallocate,__line__)
690 tbc%mean = bc%vals(var,:)
692 IF ( global%error /= err_none )
THEN
693 CALL
errorstop(global,err_allocate,__line__)
699 IF (
ALLOCATED(morevals) .EQV. .true. )
THEN
700 DEALLOCATE(morevals,stat=errorflag)
701 global%error = errorflag
702 IF ( global%error /= err_none )
THEN
703 CALL
errorstop(global,err_deallocate,__line__)
714 CALL
errorstop(global,err_file_read,__line__)
CImg< T > & line(const unsigned int y0)
Get a line.
subroutine registerfunction(global, funName, fileName)
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 rflu_readtbcsection(pRegion, 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
**********************************************************************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)