68 CHARACTER(CHRLEN) :: &
69 RCSIdentString =
'$RCSfile: RFLU_ModResidual.F90,v $ $Revision: 1.18 $'
121 TYPE(t_region
),
POINTER :: pregion
128 INTEGER :: varinfogradcells(cv_mixt_dens:cv_mixt_pres), &
129 varinfogradfaces(cv_mixt_xvel:cv_mixt_temp)
131 TYPE(t_mixt),
POINTER :: pmixt
133 TYPE(t_patch),
POINTER :: ppatch
139 global => pregion%global
142 'RFLU_ModResidual.F90')
148 pmixt => pregion%mixt
149 pmixtinput => pregion%mixtInput
162 IF ( pmixtinput%spaceOrder > discr_order_1 )
THEN
165 varinfogradcells(cv_mixt_dens) = v_mixt_dens
166 varinfogradcells(cv_mixt_xvel) = v_mixt_xvel
167 varinfogradcells(cv_mixt_yvel) = v_mixt_yvel
168 varinfogradcells(cv_mixt_zvel) = v_mixt_zvel
169 varinfogradcells(cv_mixt_pres) = v_mixt_pres
172 grc_mixt_dens,grc_mixt_pres, &
173 varinfogradcells,pmixt%cv,pmixt%gradCell)
175 SELECT CASE ( pregion%mixtInput%reconst )
176 CASE ( reconst_none )
177 CASE ( reconst_weno_simple )
179 pregion%mixt%gradCell)
181 grc_mixt_dens,grc_mixt_pres, &
182 pregion%mixt%cv,pregion%mixt%cvInfo, &
183 pregion%mixt%gradCell)
184 CASE ( reconst_weno_xyz )
186 pregion%mixt%gradCell)
188 grc_mixt_dens,grc_mixt_pres, &
189 pregion%mixt%cv,pregion%mixt%cvInfo, &
190 pregion%mixt%gradCell)
191 CASE ( reconst_lim_barthjesp )
195 grc_mixt_dens,grc_mixt_pres, &
197 pregion%mixt%gradCell, &
200 pregion%mixt%gradCell,pregion%mixt%lim)
202 CASE ( reconst_lim_venkat )
206 grc_mixt_dens,grc_mixt_pres, &
207 pregion%mixt%cv,pregion%mixt%gradCell, &
210 pregion%mixt%gradCell,pregion%mixt%lim)
213 CALL
errorstop(global,err_reached_default,__line__)
223 IF ( pmixtinput%flowModel == flow_navst )
THEN
226 varinfogradfaces(cv_mixt_xvel) = v_mixt_xvel
227 varinfogradfaces(cv_mixt_yvel) = v_mixt_yvel
228 varinfogradfaces(cv_mixt_zvel) = v_mixt_zvel
229 varinfogradfaces(cv_mixt_temp) = v_mixt_temp
232 grf_mixt_xvel,grf_mixt_temp, &
233 pregion%mixt%cv,pregion%mixt%gradFace)
235 IF ( pregion%grid%nFacesConstr > 0 )
THEN
237 grf_mixt_xvel,grf_mixt_temp, &
238 varinfogradfaces,pregion%mixt%cv, &
239 pregion%mixt%gradFace)
242 DO ipatch = 1,pregion%grid%nPatches
243 ppatch => pregion%patches(ipatch)
247 cv_mixt_temp,grbf_mixt_xvel, &
248 grbf_mixt_temp,pregion%mixt%cv, &
249 ppatch%mixt%gradFace)
250 IF ( ppatch%cReconst /= constr_none )
THEN
252 cv_mixt_temp,grbf_mixt_xvel, &
253 grbf_mixt_temp,varinfogradfaces, &
255 ppatch%mixt%gradFace)
260 IF ( pmixtinput%turbModel == turb_model_none )
THEN
266 CALL
errorstop(global,err_reached_default,__line__)
342 INTEGER,
INTENT(IN) :: icg
343 INTEGER,
INTENT(INOUT) :: rssizemax
344 INTEGER,
INTENT(OUT) :: rssize
345 INTEGER,
DIMENSION(:) ::
rs
346 TYPE(t_region
),
POINTER :: pregion
352 INTEGER :: c1,c2,errorflag,icl,ict,ifg,ifl,ipatch,
nfaces
353 INTEGER,
DIMENSION(:,:),
POINTER :: pc2f
355 TYPE(t_grid),
POINTER :: pgrid
356 TYPE(t_patch),
POINTER :: ppatch
362 global => pregion%global
365 'RFLU_ModResidual.F90')
367 pgrid => pregion%grid
373 ict = pgrid%cellGlob2Loc(1,icg)
374 icl = pgrid%cellGlob2Loc(2,icg)
377 CASE ( cell_type_tet )
378 pc2f => pgrid%tet2f(:,:,icl)
379 CASE ( cell_type_hex )
380 pc2f => pgrid%hex2f(:,:,icl)
381 CASE ( cell_type_pri )
382 pc2f => pgrid%pri2f(:,:,icl)
383 CASE ( cell_type_pyr )
384 pc2f => pgrid%pyr2f(:,:,icl)
386 CALL
errorstop(global,err_reached_default,__line__)
407 IF ( ipatch == 0 )
THEN
408 c1 = pgrid%f2c(1,ifg)
409 c2 = pgrid%f2c(2,ifg)
411 IF ( c1 == icg )
THEN
412 IF ( rssize < rssizemax )
THEN
416 WRITE(*,*)
'ERROR - About to exceed size of array rs!'
422 ELSE IF ( c2 == icg )
THEN
423 IF ( rssize < rssizemax )
THEN
427 WRITE(*,*)
'ERROR - About to exceed size of array rs!'
434 CALL
errorstop(global,err_reached_default,__line__)
498 INTEGER,
INTENT(IN) :: icg
499 INTEGER,
INTENT(INOUT) :: rssizemax
500 INTEGER,
INTENT(OUT) :: rssize
501 INTEGER,
DIMENSION(:) ::
rs
502 TYPE(t_region
),
POINTER :: pregion
508 INTEGER :: errorflag,icg2,icg3,ilevel,iloc,irs,isl,nlevels,rssavesize, &
509 rssavesizemax,rstempsize,rstempsizemax
510 INTEGER,
DIMENSION(:),
ALLOCATABLE :: rssave,rstemp
512 TYPE(t_grid),
POINTER :: pgrid
518 global => pregion%global
521 'RFLU_ModResidual.F90')
523 pgrid => pregion%grid
532 ALLOCATE(rssave(rssavesizemax),stat=errorflag)
533 global%error = errorflag
534 IF ( global%error /= err_none )
THEN
535 CALL
errorstop(global,err_allocate,__line__,
'rsSave')
538 ALLOCATE(rstemp(rstempsizemax),stat=errorflag)
539 global%error = errorflag
540 IF ( global%error /= err_none )
THEN
541 CALL
errorstop(global,err_allocate,__line__,
'rsTemp')
560 DO isl = 1,pgrid%c2cs(icg)%nCellMembs
561 IF ( rssize < rssizemax )
THEN
564 rs(rssize) = pgrid%c2cs(icg)%cellMembs(isl)
567 WRITE(*,*)
'ERROR - About to exceed size of array rs!'
579 DO irs = 1,rssavesize
580 rssave(irs) =
rs(irs)
589 DO ilevel = 2,nlevels
596 DO irs = 1,rssavesize
603 DO isl = 1,pgrid%c2cs(icg2)%nCellMembs
604 icg3 = pgrid%c2cs(icg2)%cellMembs(isl)
610 IF ( iloc == element_not_found )
THEN
611 IF ( rstempsize > 1 )
THEN
614 iloc = element_not_found
617 IF ( iloc == element_not_found )
THEN
618 IF ( rstempsize < rstempsizemax )
THEN
619 rstempsize = rstempsize + 1
621 rstemp(rstempsize) = icg3
623 IF ( rstempsize > 1 )
THEN
628 WRITE(*,*)
'ERROR - About to exceed size of array rsTemp!'
641 DO irs = 1,rstempsize
642 rssave(irs) = rstemp(irs)
644 IF ( rssize < rssizemax )
THEN
647 rs(rssize) = rstemp(irs)
650 WRITE(*,*)
'ERROR - About to exceed size of array rs!'
656 rssavesize = rstempsize
669 DEALLOCATE(rssave,stat=errorflag)
670 global%error = errorflag
671 IF ( global%error /= err_none )
THEN
672 CALL
errorstop(global,err_deallocate,__line__,
'rsSave')
675 DEALLOCATE(rstemp,stat=errorflag)
676 global%error = errorflag
677 IF ( global%error /= err_none )
THEN
678 CALL
errorstop(global,err_deallocate,__line__,
'rsTemp')
728 TYPE (t_region
),
POINTER :: pregion
736 TYPE(t_grid),
POINTER :: pgrid
737 TYPE(t_mixt),
POINTER :: pmixt
743 global => pregion%global
746 'RFLU_ModResidual.F90')
752 pgrid => pregion%grid
753 pmixt => pregion%mixt
759 DO icg = 1,pgrid%nCellsTot
760 pmixt%cvOld(cv_mixt_dens,icg) = pmixt%cv(cv_mixt_dens,icg)
761 pmixt%cvOld(cv_mixt_xmom,icg) = pmixt%cv(cv_mixt_xmom,icg)
762 pmixt%cvOld(cv_mixt_ymom,icg) = pmixt%cv(cv_mixt_ymom,icg)
763 pmixt%cvOld(cv_mixt_zmom,icg) = pmixt%cv(cv_mixt_zmom,icg)
764 pmixt%cvOld(cv_mixt_ener,icg) = pmixt%cv(cv_mixt_ener,icg)
810 TYPE (t_region
),
POINTER :: pregion
818 TYPE(t_grid),
POINTER :: pgrid
819 TYPE(t_mixt),
POINTER :: pmixt
825 global => pregion%global
828 'RFLU_ModResidual.F90')
834 pgrid => pregion%grid
835 pmixt => pregion%mixt
841 IF ( pregion%irkStep == 1 )
THEN
842 DO icg = 1,pgrid%nCellsTot
843 pmixt%diss(cv_mixt_dens,icg) = 0.0_rfreal
844 pmixt%diss(cv_mixt_xmom,icg) = 0.0_rfreal
845 pmixt%diss(cv_mixt_ymom,icg) = 0.0_rfreal
846 pmixt%diss(cv_mixt_zmom,icg) = 0.0_rfreal
847 pmixt%diss(cv_mixt_ener,icg) = 0.0_rfreal
894 TYPE (t_region
),
POINTER :: pregion
902 TYPE(t_grid),
POINTER :: pgrid
903 TYPE(t_mixt),
POINTER :: pmixt
909 global => pregion%global
912 'RFLU_ModResidual.F90')
918 pgrid => pregion%grid
919 pmixt => pregion%mixt
925 DO icg = 1,pgrid%nCellsTot
926 pmixt%rhs(cv_mixt_dens,icg) = -pmixt%diss(cv_mixt_dens,icg)
927 pmixt%rhs(cv_mixt_xmom,icg) = -pmixt%diss(cv_mixt_xmom,icg)
928 pmixt%rhs(cv_mixt_ymom,icg) = -pmixt%diss(cv_mixt_ymom,icg)
929 pmixt%rhs(cv_mixt_zmom,icg) = -pmixt%diss(cv_mixt_zmom,icg)
930 pmixt%rhs(cv_mixt_ener,icg) = -pmixt%diss(cv_mixt_ener,icg)
subroutine, public rflu_destroylimiter(pRegion, lim)
subroutine, public rflu_computegradfaceswrapper(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_computelimitervenkat(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad, lim)
subroutine, public rflu_computelimiterbarthjesp(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad, lim)
subroutine, public rflu_createlimiter(pRegion, iBegGrad, iEndGrad, lim)
subroutine, public rflu_viscousfluxespatches(pRegion, tv, tvIndxVisc, tvIndxCond)
subroutine rs(nm, n, a, w, matz, z, fv1, fv2, ierr)
subroutine, public rflu_res_setcvold(pRegion)
subroutine, public rflu_res_computeresidual(pRegion)
LOGICAL function rflu_decideneedbgradface(pRegion, pPatch)
subroutine, public rflu_computebfgradconstrwrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine rflu_computefluxinv(pRegion, fluxPart)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflu_enforceheatflux(pRegion, tv, tvIndxCond)
subroutine, public rflu_getresidualsupport1(pRegion, icg, rs, rsSizeMax, rsSize)
subroutine, public rflu_res_setrhs(pRegion)
subroutine quicksortinteger(a, n)
subroutine, public rflu_computegradfacesconstr(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine, public rflu_limitgradcells(pRegion, iBegGrad, iEndGrad, grad, lim)
subroutine binarysearchinteger(a, n, v, i, j)
subroutine, public rflu_limitgradcellssimple(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, varInfo, grad)
subroutine, public rflu_computegradbfaceswrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_convertcvcons2prim(pRegion, cvStateFuture)
subroutine, public rflu_res_setdiss(pRegion)
subroutine, public rflu_convertcvprim2cons(pRegion, cvStateFuture)
subroutine, public rflu_wenogradcellswrapper(pRegion, iBegGrad, iEndGrad, grad)
subroutine, public rflu_getresidualsupport2(pRegion, icg, rs, rsSizeMax, rsSize)
subroutine, public rflu_wenogradcellsxyzwrapper(pRegion, iBegGrad, iEndGrad, grad)
subroutine, public rflu_computegradcellswrapper(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine, public rflu_viscousfluxes(pRegion, tv, tvIndxVisc, tvIndxCond)