61 CHARACTER(CHRLEN) :: &
62 RCSIdentString =
'$RCSfile: RFLU_ModConstraintUtils.F90,v $ $Revision: 1.7 $'
106 INTEGER,
INTENT(IN) :: ifl,var
107 TYPE(t_patch),
POINTER :: ppatch
108 TYPE(t_region
),
POINTER :: pregion
114 INTEGER ::
dist,indcp,indmol,gasmodel
115 REAL(RFREAL) :: eqtol,minj,nx,ny,nz,rl
122 global => pregion%global
125 'RFLU_ModConstraintUtils.F90')
127 eqtol = 1.0e-6_rfreal
144 SELECT CASE ( ppatch%bcType )
145 CASE ( bc_injection )
146 dist = ppatch%mixt%distrib
148 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
150 IF ( minj > 0.0_rfreal )
THEN
164 SELECT CASE ( ppatch%bcType )
166 nx = ppatch%fn(xcoord,ifl)
168 IF (
floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. )
THEN
173 CASE ( bc_noslipwall_hflux )
175 CASE ( bc_noslipwall_temp )
177 CASE ( bc_injection )
178 nx = ppatch%fn(xcoord,ifl)
180 IF (
floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. )
THEN
194 SELECT CASE ( ppatch%bcType )
196 ny = ppatch%fn(ycoord,ifl)
198 IF (
floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. )
THEN
203 CASE ( bc_noslipwall_hflux )
205 CASE ( bc_noslipwall_temp )
207 CASE ( bc_injection )
208 ny = ppatch%fn(ycoord,ifl)
210 IF (
floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. )
THEN
224 SELECT CASE ( ppatch%bcType )
226 nz = ppatch%fn(zcoord,ifl)
228 IF (
floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. )
THEN
233 CASE ( bc_noslipwall_hflux )
235 CASE ( bc_noslipwall_temp )
237 CASE ( bc_injection )
238 nz = ppatch%fn(zcoord,ifl)
240 IF (
floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. )
THEN
254 SELECT CASE ( ppatch%bcType )
255 CASE ( bc_noslipwall_hflux )
257 CASE ( bc_noslipwall_temp )
259 CASE ( bc_injection )
260 dist = ppatch%mixt%distrib
262 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
264 IF ( minj > 0.0_rfreal )
THEN
270 IF ( pregion%mixtInput%flowModel == flow_euler )
THEN
286 CASE ( v_spec_var1:v_spec_var9 )
287 SELECT CASE ( ppatch%bcType )
288 CASE ( bc_inflow_totang )
290 CASE ( bc_inflow_veltemp )
292 CASE ( bc_injection )
362 INTEGER,
INTENT(IN) :: ifl,var
363 TYPE(t_patch),
POINTER :: ppatch
364 TYPE(t_region
),
POINTER :: pregion
370 INTEGER ::
dist,icg,indcp,indgs,indmol,gasmodel
374 REAL(RFREAL) :: cp,eqtol,fs,fsu,hflux,hl,minj,mm,nx,ny,nz,pl,rl,tinj,ul,vl,wl
384 global => pregion%global
387 'RFLU_ModConstraintUtils.F90')
389 eqtol = 1.0e-6_rfreal
391 indcp = pregion%mixtInput%indCp
392 indmol = pregion%mixtInput%indMol
393 gasmodel = pregion%mixtInput%gasModel
395 indgs = pregion%grid%indGs
412 SELECT CASE ( ppatch%bcType )
413 CASE ( bc_injection )
414 nx = ppatch%fn(xcoord,ifl)
415 ny = ppatch%fn(ycoord,ifl)
416 nz = ppatch%fn(zcoord,ifl)
418 dist = ppatch%mixt%distrib
420 IF ( gasmodel == gas_model_tcperf )
THEN
421 icg = ppatch%bf2c(ifl)
423 fs = ppatch%gs(indgs*ifl)
426 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
427 mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
429 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
431 IF ( minj > 0.0_rfreal )
THEN
432 tinj = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
434 pl = pregion%mixt%dv(dv_mixt_pres,icg)
437 pl,fsu,rl,ul,vl,wl,hl)
441 CALL
errorstop(global,err_reached_default,__line__)
444 CALL
errorstop(global,err_reached_default,__line__)
447 CALL
errorstop(global,err_reached_default,__line__)
455 SELECT CASE ( ppatch%bcType )
457 nx = ppatch%fn(xcoord,ifl)
459 IF (
floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. )
THEN
462 CALL
errorstop(global,err_reached_default,__line__)
464 CASE ( bc_noslipwall_hflux )
466 CASE ( bc_noslipwall_temp )
468 CASE ( bc_injection )
469 nx = ppatch%fn(xcoord,ifl)
470 ny = ppatch%fn(ycoord,ifl)
471 nz = ppatch%fn(zcoord,ifl)
473 IF (
floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. )
THEN
474 dist = ppatch%mixt%distrib
476 IF ( gasmodel == gas_model_tcperf )
THEN
477 icg = ppatch%bf2c(ifl)
479 fs = ppatch%gs(indgs*ifl)
482 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
483 mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
485 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
487 IF ( minj > 0.0_rfreal )
THEN
488 tinj = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
490 pl = pregion%mixt%dv(dv_mixt_pres,icg)
493 pl,fsu,rl,ul,vl,wl,hl)
500 CALL
errorstop(global,err_reached_default,__line__)
503 CALL
errorstop(global,err_reached_default,__line__)
506 CALL
errorstop(global,err_reached_default,__line__)
514 SELECT CASE ( ppatch%bcType )
516 ny = ppatch%fn(ycoord,ifl)
518 IF (
floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. )
THEN
521 CALL
errorstop(global,err_reached_default,__line__)
523 CASE ( bc_noslipwall_hflux )
525 CASE ( bc_noslipwall_temp )
527 CASE ( bc_injection )
528 nx = ppatch%fn(xcoord,ifl)
529 ny = ppatch%fn(ycoord,ifl)
530 nz = ppatch%fn(zcoord,ifl)
532 IF (
floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. )
THEN
533 dist = ppatch%mixt%distrib
535 IF ( gasmodel == gas_model_tcperf )
THEN
536 icg = ppatch%bf2c(ifl)
538 fs = ppatch%gs(indgs*ifl)
541 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
542 mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
544 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
546 IF ( minj > 0.0_rfreal )
THEN
547 tinj = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
549 pl = pregion%mixt%dv(dv_mixt_pres,icg)
552 pl,fsu,rl,ul,vl,wl,hl)
559 CALL
errorstop(global,err_reached_default,__line__)
562 CALL
errorstop(global,err_reached_default,__line__)
565 CALL
errorstop(global,err_reached_default,__line__)
573 SELECT CASE ( ppatch%bcType )
575 nz = ppatch%fn(zcoord,ifl)
577 IF (
floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. )
THEN
580 CALL
errorstop(global,err_reached_default,__line__)
582 CASE ( bc_noslipwall_hflux )
584 CASE ( bc_noslipwall_temp )
586 CASE ( bc_injection )
587 nx = ppatch%fn(xcoord,ifl)
588 ny = ppatch%fn(ycoord,ifl)
589 nz = ppatch%fn(zcoord,ifl)
591 IF (
floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. )
THEN
592 dist = ppatch%mixt%distrib
594 IF ( gasmodel == gas_model_tcperf )
THEN
595 icg = ppatch%bf2c(ifl)
597 fs = ppatch%gs(indgs*ifl)
600 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
601 mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
603 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
605 IF ( minj > 0.0_rfreal )
THEN
606 tinj = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
608 pl = pregion%mixt%dv(dv_mixt_pres,icg)
611 pl,fsu,rl,ul,vl,wl,hl)
618 CALL
errorstop(global,err_reached_default,__line__)
621 CALL
errorstop(global,err_reached_default,__line__)
624 CALL
errorstop(global,err_reached_default,__line__)
632 SELECT CASE ( ppatch%bcType )
633 CASE ( bc_noslipwall_hflux )
634 SELECT CASE ( ppatch%mixt%distrib )
635 CASE ( bcdat_constant )
636 icg = ppatch%bf2c(ifl)
637 hflux = ppatch%mixt%vals(bcdat_noslip_q,0)
640 CASE ( bcdat_distrib )
641 icg = ppatch%bf2c(ifl)
642 hflux = ppatch%mixt%vals(bcdat_noslip_q,ifl)
646 CALL
errorstop(global,err_reached_default,__line__)
648 CASE ( bc_noslipwall_temp )
649 SELECT CASE ( ppatch%mixt%distrib )
650 CASE ( bcdat_constant )
652 CASE ( bcdat_distrib )
655 CALL
errorstop(global,err_reached_default,__line__)
657 CASE ( bc_injection )
658 dist = ppatch%mixt%distrib
660 minj = ppatch%mixt%vals(bcdat_inject_mfrate,
dist*ifl)
663 IF ( minj > 0.0_rfreal )
THEN
664 tinj = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
668 CALL
errorstop(global,err_reached_default,__line__)
671 IF ( pregion%mixtInput%flowModel == flow_euler )
THEN
672 CALL
errorstop(global,err_reached_default,__line__)
674 tb = ppatch%mixt%vals(bcdat_inject_temp,
dist*ifl)
680 CALL
errorstop(global,err_reached_default,__line__)
688 CASE ( v_spec_var1:v_spec_var9 )
689 ispec = var - v_spec_var1 + 1
691 SELECT CASE ( ppatch%bcType )
692 CASE ( bc_inflow_totang )
693 SELECT CASE ( ppatch%spec%distrib )
694 CASE ( bcdat_constant )
696 CASE ( bcdat_distrib )
699 CALL
errorstop(global,err_reached_default,__line__)
701 CASE ( bc_inflow_veltemp )
702 SELECT CASE ( ppatch%spec%distrib )
703 CASE ( bcdat_constant )
705 CASE ( bcdat_distrib )
708 CALL
errorstop(global,err_reached_default,__line__)
710 CASE ( bc_injection )
711 SELECT CASE ( ppatch%spec%distrib )
712 CASE ( bcdat_constant )
714 CASE ( bcdat_distrib )
717 CALL
errorstop(global,err_reached_default,__line__)
720 CALL
errorstop(global,err_reached_default,__line__)
729 CALL
errorstop(global,err_reached_default,__line__)
subroutine, public rflu_setrindstateinjectperf(cpGas, mmGas, nx, ny, nz, mInj, tInj, pl, fs, rl, ul, vl, wl, Hl)
subroutine registerfunction(global, funName, fileName)
INTEGER function, public rflu_getconstrtype(pRegion, pPatch, var, ifl)
real(rfreal) function, public rflu_descalegridspeed(pRegion, fs)
real(rfreal) function, public rflu_getconstrvalue(pRegion, pPatch, var, ifl)
subroutine errorstop(global, errorCode, errorLine, addMessage)
long double dist(long double *coord1, long double *coord2, int size)
subroutine deregisterfunction(global)