79 TYPE(t_region
),
INTENT(INOUT),
TARGET :: region
80 INTEGER,
INTENT(IN) :: iinrt
83 INTEGER :: ipcls,iplag,ipeul,iedge
86 INTEGER,
PARAMETER :: max_nodes = 101
88 CHARACTER(CHRLEN) :: rcsidentstring
92 INTEGER :: npcls,nplag,npeul,nintl,ninputedges,nnodes,
nedges
93 INTEGER :: indmixt,indplag0,indpeul0,indintl
94 INTEGER :: indplagvapor,indplagn,indpeuln
95 INTEGER :: indcp,gasmodel,
ic,inod,off1beg,ic1beg
99 INTEGER :: tedge,
inode(2),token(2)
100 INTEGER,
POINTER :: pcvplagmass(:), aiv(:,:)
102 REAL(RFREAL) :: temp1,temp2,spht,massdot,hcapdot,enerdot
103 REAL(RFREAL) :: kinedot1,kinedot2,thrmdot1,thrmdot2,enerdot1,enerdot2
104 REAL(RFREAL) :: intlmass,intlener,intltemp,intlhcap,contfac
105 REAL(RFREAL) :: sphtplag(max_nodes),sphtpeul(max_nodes)
106 REAL(RFREAL),
DIMENSION(3) :: velo1,velo2,intlvelo,intlmome
107 REAL(RFREAL),
DIMENSION(3) :: momedot,momedot1,momedot2
108 REAL(RFREAL) :: src(max_nodes,5)
109 REAL(RFREAL),
DIMENSION(:),
POINTER :: p1begmixttemp,pplagtemp
110 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: p1begmixtvelo,pplagvelo
111 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pmixtrhs,pplagrhs,ppeulrhs
112 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: gv,arv,primary
116 TYPE(t_mixt),
POINTER :: pmixt
119 TYPE(t_plag),
POINTER :: pplag
122 TYPE(t_peul),
POINTER :: ppeul
126 TYPE(t_plag),
POINTER :: pplag
127 TYPE(t_spec),
POINTER :: ppeul
133 rcsidentstring =
'$RCSfile: INRT_AugmentDisSources.F90,v $ $Revision: 1.5 $'
135 global => region%global
138 'INRT_AugmentDisSources.F90' )
148 ilev = region%currLevel
149 IF (global%plagUsed) npcls = region%levels(ilev)%plag%nPcls
152 IF (global%plagUsed) npcls = region%plag%nPcls
155 IF (npcls < 1) go to 999
160 IF ( region%mixt%cvState /= cv_mixt_state_duvwp )
THEN
161 CALL
errorstop(global,err_cv_state_invalid,__line__)
167 input => region%inrtInput
168 inrt =>
input%inrts(iinrt)
174 ninputedges = inrt%nInputEdges
176 indmixt =
input%indMixt
177 indplag0 =
input%indPlag0
178 indpeul0 =
input%indPeul0
179 indintl =
input%indIntl
181 indplagvapor =
input%indPlagVapor
183 indplagn = indplag0 + nplag
184 indpeuln = indpeul0 + npeul
186 nnodes =
input%nNodes
187 IF (nnodes > max_nodes .OR. nplag > max_nodes .OR. npeul > max_nodes) &
188 CALL
errorstop( global,err_exceeds_decl_mem,__line__ )
192 computeaux =
input%computeAux
197 pmixt => region%levels(ilev)%mixt
198 pplag => region%levels(ilev)%plag
200 ppeul => region%levels(ilev)%peul
209 indcp = region%mixtInput%indCp
212 pcvplagmass => pplag%cvPlagMass
222 p1begmixtvelo => pmixt%dv(dv_mixt_uvel:dv_mixt_wvel,:)
223 off1beg = lbound(p1begmixtvelo,2) - lbound(pmixt%dv,2)
226 p1begmixtvelo => pmixt%cv(cv_mixt_xvel:cv_mixt_zvel,:)
227 off1beg = lbound(p1begmixtvelo,2) - lbound(pmixt%cv,2)
230 IF (ubound(p1begmixtvelo,1) /= 3)
THEN
231 CALL
errorstop( global,err_inrt_indexrange,__line__ )
234 p1begmixttemp => pmixt%dv(dv_mixt_temp,:)
236 IF (off1beg /= lbound(p1begmixttemp,1) - lbound(pmixt%dv,2))
THEN
237 CALL
errorstop( global,err_inrt_indexrange,__line__ )
242 pplagvelo => pplag%dv(dv_plag_uvel:dv_plag_wvel,:)
244 IF (ubound(pplagvelo,1) /= 3)
THEN
245 CALL
errorstop( global,err_inrt_indexrange,__line__ )
248 IF (lbound(pplagvelo,2) /= lbound(pplag%dv,2))
THEN
249 CALL
errorstop( global,err_inrt_indexrange,__line__ )
252 pplagtemp => pplag%dv(dv_plag_temp,:)
254 IF (lbound(pplagtemp,1) /= lbound(pplag%dv,2))
THEN
255 CALL
errorstop( global,err_inrt_indexrange,__line__ )
258 pmixtrhs => pmixt%rhs
259 pplagrhs => pplag%rhs
262 ppeulrhs => ppeul%rhs
266 ppeulrhs => ppeul%rhs
268 gasmodel = region%mixtInput%gasModel
271 IF (nplag > 0) sphtplag(1:nplag) = region%plagInput%spht(1:nplag)
276 sphtpeul(ipeul) = region%peulInput%ptypes(ipeul)%material%spht
281 sphtpeul(ipeul) = region%specInput%specType(ipeul)%pMaterial%spht
285 primary => pplag%inrtSources
289 ic = aiv(aiv_plag_icells,ipcls)
290 ic1beg =
ic + off1beg
296 src(:nnodes,:) = 0._rfreal
301 tedge = inrt%edges(iedge)%tEdge
302 inode = inrt%edges(iedge)%iNode
303 token = inrt%edges(iedge)%token
309 CASE (inrt_edge_mass)
311 massdot = primary(iedge,ipcls)
312 IF (massdot == 0._rfreal) cycle
319 IF (
inode(1) == indintl)
THEN
325 IF (inod == indmixt)
THEN
327 SELECT CASE (gasmodel)
329 CASE (gas_model_tcperf)
330 spht = gv(gv_mixt_cp,indcp*
ic)
333 CALL
errorstop( global,err_reached_default,__line__ )
337 ELSE IF (inod <= indplagn)
THEN
338 spht = sphtplag(inod-indplag0)
340 ELSE IF (inod == indintl .OR. inod == indplagvapor)
THEN
341 CALL
errorstop( global,err_inrt_indexrange,__line__ )
344 spht = sphtpeul(inod-indpeul0)
350 hcapdot = spht * massdot
357 IF (inod == indmixt)
THEN
358 velo1 = p1begmixtvelo(:,ic1beg)
359 temp1 = p1begmixttemp(ic1beg)
360 ELSE IF (inod <= indplagn)
THEN
361 velo1 = pplagvelo(:,ipcls)
362 temp1 = pplagtemp(ipcls)
363 ELSE IF (inod == indplagvapor)
THEN
364 CALL
errorstop( global,err_inrt_indexrange,__line__ )
365 ELSE IF (inod <= indpeuln)
THEN
366 velo1 = p1begmixtvelo(:,ic1beg)
367 temp1 = p1begmixttemp(ic1beg)
381 IF (inod == indmixt)
THEN
382 velo2 = p1begmixtvelo(:,ic1beg)
383 temp2 = p1begmixttemp(ic1beg)
384 ELSE IF (inod <= indplagn)
THEN
385 velo2 = pplagvelo(:,ipcls)
386 temp2 = pplagtemp(ipcls)
387 ELSE IF (inod == indplagvapor)
THEN
388 CALL
errorstop( global,err_inrt_indexrange,__line__ )
389 ELSE IF (inod <= indpeuln)
THEN
390 velo2 = p1begmixtvelo(:,ic1beg)
391 temp2 = p1begmixttemp(ic1beg)
396 intlhcap = intlhcap + hcapdot
404 momedot1 = massdot * velo1
405 momedot2 = massdot * velo2
410 thrmdot1 = hcapdot * temp1
411 thrmdot2 = hcapdot * temp2
428 SELECT CASE(token(1))
430 CASE(inrt_perm_pmass)
432 src(
inode(1),2:4) = src(
inode(1),2:4) - momedot1
433 src(
inode(1),5 ) = src(
inode(1),5 ) - kinedot1 - thrmdot1
435 CASE(inrt_perm_pmome)
437 src(
inode(1),2:4) = src(
inode(1),2:4) - momedot2
438 src(
inode(1),5 ) = src(
inode(1),5 ) - kinedot2 - thrmdot1
442 src(
inode(1),2:4) = src(
inode(1),2:4) - momedot2
443 src(
inode(1),5 ) = src(
inode(1),5 ) - kinedot2 - thrmdot2
449 SELECT CASE(token(2))
451 CASE(inrt_perm_pmass)
453 src(
inode(2),2:4) = src(
inode(2),2:4) + momedot2
454 src(
inode(2),5 ) = src(
inode(2),5 ) + kinedot2 + thrmdot2
456 CASE(inrt_perm_pmome)
458 src(
inode(2),2:4) = src(
inode(2),2:4) + momedot1
459 src(
inode(2),5 ) = src(
inode(2),5 ) + kinedot1 + thrmdot2
463 src(
inode(2),2:4) = src(
inode(2),2:4) + momedot1
464 src(
inode(2),5 ) = src(
inode(2),5 ) + kinedot1 + thrmdot1
470 CASE (inrt_edge_mome)
472 momedot = primary(iedge:iedge+2,ipcls)
478 IF (inod == indmixt)
THEN
479 velo1 = p1begmixtvelo(:,ic1beg)
480 ELSE IF (inod <= indplagn)
THEN
481 velo1 = pplagvelo(:,ipcls)
482 ELSE IF (inod == indplagvapor)
THEN
483 CALL
errorstop( global,err_inrt_indexrange,__line__ )
484 ELSE IF (inod <= indpeuln)
THEN
485 velo1 = p1begmixtvelo(:,ic1beg)
496 IF (inod == indmixt)
THEN
497 velo2 = p1begmixtvelo(:,ic1beg)
498 ELSE IF (inod <= indplagn)
THEN
499 velo2 = pplagvelo(:,ipcls)
500 ELSE IF (inod == indplagvapor)
THEN
501 CALL
errorstop( global,err_inrt_indexrange,__line__ )
502 ELSE IF (inod <= indpeuln)
THEN
503 velo2 = p1begmixtvelo(:,ic1beg)
524 SELECT CASE(token(1))
526 CASE(inrt_perm_pmome)
527 src(
inode(1),2:4) = src(
inode(1),2:4) - momedot
528 src(
inode(1),5 ) = src(
inode(1),5 ) - enerdot1
531 src(
inode(1),2:4) = src(
inode(1),2:4) - momedot
532 src(
inode(1),5 ) = src(
inode(1),5 ) - enerdot2
538 SELECT CASE(token(2))
540 CASE(inrt_perm_pmome)
541 src(
inode(2),2:4) = src(
inode(2),2:4) + momedot
545 src(
inode(2),2:4) = src(
inode(2),2:4) + momedot
552 CASE (inrt_edge_mome_dum)
557 CASE (inrt_edge_ener)
559 enerdot = primary(iedge,ipcls)
561 IF (token(1) == inrt_perm_pall) &
564 IF (token(2) == inrt_perm_pall) &
569 CASE (inrt_edge_mass_gho)
573 IF (token(1) >= inrt_perm_pmass)
THEN
575 massdot = primary(iedge,ipcls)
581 CALL
errorstop( global,err_reached_default,__line__ )
588 IF (iedge == ninputedges)
THEN
590 intlmass = src(indintl,1)
591 intlmome = src(indintl,2:4)
592 intlener = src(indintl,5)
594 IF (intlmass > 0._rfreal)
THEN
595 intlvelo = intlmome / intlmass
600 IF (intlhcap > 0._rfreal)
THEN
601 intltemp = (intlener - 0.5_rfreal*
dot_product(intlmome, &
602 intlvelo)) / intlhcap
623 contfac = arv(arv_plag_spload,ipcls)
627 pmixtrhs( cv_mixt_dens ,
ic) = &
628 pmixtrhs(cv_mixt_dens ,
ic) - contfac*src(indmixt,1 )
630 pmixtrhs( cv_mixt_xmom:cv_mixt_zmom,
ic) = &
631 pmixtrhs(cv_mixt_xmom:cv_mixt_zmom,
ic) - contfac*src(indmixt,2:4)
633 pmixtrhs( cv_mixt_ener ,
ic) = &
634 pmixtrhs(cv_mixt_ener ,
ic) - contfac*src(indmixt,5 )
640 pplagrhs( pcvplagmass(iplag) ,ipcls) = &
641 pplagrhs(pcvplagmass(iplag) ,ipcls) - src(indplag0+iplag,1)
643 pplagrhs( cv_plag_xmom:cv_plag_zmom,ipcls) = &
644 pplagrhs(cv_plag_xmom:cv_plag_zmom,ipcls) - src(indplag0+iplag,2:4)
646 pplagrhs( cv_plag_ener ,ipcls) = &
647 pplagrhs(cv_plag_ener ,ipcls) - src(indplag0+iplag,5)
653 pplagrhs( cv_plag_enervapor,ipcls) = &
654 pplagrhs(cv_plag_enervapor,ipcls) - src(indplagvapor,5)
660 ppeulrhs(ipeul,
ic) = ppeulrhs(ipeul,
ic) - contfac * src(indpeul0+ipeul,1)
666 ppeulrhs(ipeul,
ic) = ppeulrhs(ipeul,
ic) - contfac * src(indpeul0+ipeul,1)
**********************************************************************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 inode
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 ic
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine errorstop(global, errorCode, errorLine, addMessage)
long double dot_product(pnt vec1, pnt vec2)
subroutine deregisterfunction(global)
subroutine inrt_augmentdissources(region, iInrt)