25 real(dp),
dimension(:),
pointer :: conc => null()
26 integer(I4B),
dimension(:),
pointer :: icbund => null()
30 integer(I4B),
pointer :: thermivisc => null()
31 integer(I4B),
pointer :: idxtmpr => null()
32 integer(I4B),
pointer :: ioutvisc => null()
33 integer(I4B),
pointer :: iconcset => null()
34 integer(I4B),
pointer :: ireadelev => null()
35 integer(I4B),
dimension(:),
pointer,
contiguous :: ivisc => null()
36 real(dp),
pointer :: viscref => null()
37 real(dp),
dimension(:),
pointer,
contiguous :: visc => null()
38 real(dp),
dimension(:),
pointer,
contiguous :: elev => null()
39 integer(I4B),
dimension(:),
pointer :: ibound => null()
41 integer(I4B),
pointer :: nviscspecies => null()
42 real(dp),
dimension(:),
pointer,
contiguous :: dviscdc => null()
43 real(dp),
dimension(:),
pointer,
contiguous :: cviscref => null()
44 real(dp),
dimension(:),
pointer,
contiguous :: ctemp => null()
45 character(len=LENMODELNAME),
dimension(:),
allocatable :: cmodelname
46 character(len=LENAUXNAME),
dimension(:),
allocatable :: cauxspeciesname
47 character(len=LENAUXNAME) :: name_temp_spec =
'TEMPERATURE'
50 real(dp),
pointer :: a2 => null()
51 real(dp),
pointer :: a3 => null()
52 real(dp),
pointer :: a4 => null()
56 real(dp),
dimension(:),
pointer,
contiguous :: k11 => null()
57 real(dp),
dimension(:),
pointer,
contiguous :: k22 => null()
58 real(dp),
dimension(:),
pointer,
contiguous :: k33 => null()
59 real(dp),
dimension(:),
pointer,
contiguous :: k11input => null()
60 real(dp),
dimension(:),
pointer,
contiguous :: k22input => null()
61 real(dp),
dimension(:),
pointer,
contiguous :: k33input => null()
62 integer(I4B),
pointer :: kchangeper => null()
63 integer(I4B),
pointer :: kchangestp => null()
64 integer(I4B),
dimension(:),
pointer,
contiguous :: nodekchange => null()
97 function calc_visc(ivisc, viscref, dviscdc, cviscref, conc, &
98 a2, a3, a4)
result(visc)
100 integer(I4B),
dimension(:),
intent(in) :: ivisc
101 real(dp),
intent(in) :: viscref
102 real(dp),
dimension(:),
intent(in) :: dviscdc
103 real(dp),
dimension(:),
intent(in) :: cviscref
104 real(dp),
dimension(:),
intent(in) :: conc
105 real(dp),
intent(in) :: a2, a3, a4
109 integer(I4B) :: nviscspec
114 nviscspec =
size(dviscdc)
118 if (ivisc(i) == 1)
then
119 visc = visc + dviscdc(i) * (conc(i) - cviscref(i))
121 expon = -1 * a3 * ((conc(i) - cviscref(i)) / &
122 ((conc(i) + a4) * (cviscref(i) + a4)))
123 mu_t = viscref * a2**expon
129 visc = (visc - viscref) + mu_t
139 subroutine vsc_cr(vscobj, name_model, inunit, iout)
142 character(len=*),
intent(in) :: name_model
143 integer(I4B),
intent(in) :: inunit
144 integer(I4B),
intent(in) :: iout
150 call vscobj%set_names(1, name_model,
'VSC',
'VSC')
153 call vscobj%allocate_scalars()
156 vscobj%inunit = inunit
160 call vscobj%parser%Initialize(vscobj%inunit, vscobj%iout)
173 character(len=*),
parameter :: fmtvsc = &
174 "(1x,/1x,'VSC -- Viscosity Package, version 1, 11/15/2022', &
175 &' input read from unit ', i0, //)"
178 write (this%iout, fmtvsc) this%inunit
183 if (.not.
present(vsc_input))
then
186 call this%read_options()
189 call this%read_dimensions()
192 call this%set_options(vsc_input)
193 this%nviscspecies = vsc_input%nviscspecies
197 call this%allocate_arrays(dis%nodes)
199 if (.not.
present(vsc_input))
then
202 call this%read_packagedata()
205 call this%set_packagedata(vsc_input)
217 integer(I4B),
dimension(:),
pointer :: ibound
220 this%ibound => ibound
223 call this%set_npf_pointers()
243 class(
bndtype),
pointer :: packobj
246 select case (packobj%filtyp)
250 select type (packobj)
252 call packobj%bnd_activate_viscosity()
257 select type (packobj)
259 call packobj%bnd_activate_viscosity()
264 select type (packobj)
266 call packobj%bnd_activate_viscosity()
271 select type (packobj)
273 call packobj%lak_activate_viscosity()
278 select type (packobj)
280 call packobj%sfr_activate_viscosity()
285 select type (packobj)
287 call packobj%maw_activate_viscosity()
304 character(len=LENMEMPATH) :: npfMemoryPath
309 call mem_setptr(this%k11,
'K11', npfmemorypath)
310 call mem_setptr(this%k22,
'K22', npfmemorypath)
311 call mem_setptr(this%k33,
'K33', npfmemorypath)
312 call mem_setptr(this%k11input,
'K11INPUT', npfmemorypath)
313 call mem_setptr(this%k22input,
'K22INPUT', npfmemorypath)
314 call mem_setptr(this%k33input,
'K33INPUT', npfmemorypath)
315 call mem_setptr(this%kchangeper,
'KCHANGEPER', npfmemorypath)
316 call mem_setptr(this%kchangestp,
'KCHANGESTP', npfmemorypath)
317 call mem_setptr(this%nodekchange,
'NODEKCHANGE', npfmemorypath)
330 character(len=LINELENGTH) :: errmsg
333 character(len=*),
parameter :: fmtc = &
334 "('Viscosity Package does not have a concentration set &
335 &for species ',i0,'. One or more model names may be specified &
336 &incorrectly in the PACKAGEDATA block or a GWF-GWT exchange may need &
341 do i = 1, this%nviscspecies
342 if (.not.
associated(this%modelconc(i)%conc))
then
343 write (errmsg, fmtc) i
348 call this%parser%StoreErrorUnit()
363 call this%vsc_calcvisc()
376 class(
bndtype),
pointer :: packobj
377 real(DP),
intent(in),
dimension(:) :: hnew
380 integer(I4B) :: n, locvisc, locelev
381 integer(I4B),
dimension(:),
allocatable :: locconc
386 allocate (locconc(this%nviscspecies))
390 do n = 1, packobj%naux
391 if (packobj%auxname(n) ==
'VISCOSITY')
then
393 else if (packobj%auxname(n) ==
'ELEVATION')
then
399 do i = 1, this%nviscspecies
401 do j = 1, packobj%naux
402 if (this%cauxspeciesname(i) == packobj%auxname(j))
then
407 if (locconc(i) == 0)
then
415 select case (packobj%filtyp)
416 case (
'GHB',
'DRN',
'RIV')
420 locelev, locvisc, locconc, this%dviscdc, &
421 this%cviscref, this%ivisc, this%a2, this%a3, &
428 call vsc_ad_lak(packobj, this%visc, this%viscref, this%elev, locvisc, &
429 locconc, this%dviscdc, this%cviscref, this%ivisc, &
430 this%a2, this%a3, this%a4, this%ctemp)
436 call vsc_ad_sfr(packobj, this%visc, this%viscref, this%elev, locvisc, &
437 locconc, this%dviscdc, this%cviscref, this%ivisc, &
438 this%a2, this%a3, this%a4, this%ctemp)
442 call vsc_ad_maw(packobj, this%visc, this%viscref, this%elev, locvisc, &
443 locconc, this%dviscdc, this%cviscref, this%ivisc, &
444 this%a2, this%a3, this%a4, this%ctemp)
463 locvisc, locconc, dviscdc, cviscref, &
464 ivisc, a2, a3, a4, ctemp)
470 class(
bndtype),
pointer :: packobj
472 real(DP),
intent(in),
dimension(:) :: hnew
473 real(DP),
intent(in),
dimension(:) :: visc
474 real(DP),
intent(in) :: a2, a3, a4
475 real(DP),
intent(in) :: viscref
476 integer(I4B),
intent(in) :: locelev
477 integer(I4B),
intent(in) :: locvisc
478 integer(I4B),
dimension(:),
intent(in) :: locconc
479 integer(I4B),
dimension(:),
intent(in) :: ivisc
480 real(DP),
dimension(:),
intent(in) :: dviscdc
481 real(DP),
dimension(:),
intent(in) :: cviscref
482 real(DP),
dimension(:),
intent(inout) :: ctemp
489 do n = 1, packobj%nbound
490 node = packobj%nodelist(n)
493 if (packobj%ibound(node) <= 0) cycle
497 cviscref, ctemp, ivisc, a2, a3, a4, &
501 select case (packobj%filtyp)
503 select type (packobj)
506 packobj%condinput(n))
509 select type (packobj)
512 packobj%condinput(n))
515 select type (packobj)
518 packobj%condinput(n))
522 packobj%condinput(n))
533 subroutine vsc_ad_sfr(packobj, visc, viscref, elev, locvisc, locconc, &
534 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
538 class(
bndtype),
pointer :: packobj
540 real(DP),
intent(in) :: viscref
541 real(DP),
intent(in) :: a2, a3, a4
542 integer(I4B),
intent(in) :: locvisc
543 integer(I4B),
dimension(:),
intent(in) :: locconc
544 integer(I4B),
dimension(:),
intent(in) :: ivisc
545 real(DP),
dimension(:),
intent(in) :: visc
546 real(DP),
dimension(:),
intent(in) :: elev
547 real(DP),
dimension(:),
intent(in) :: dviscdc
548 real(DP),
dimension(:),
intent(in) :: cviscref
549 real(DP),
dimension(:),
intent(inout) :: ctemp
556 select type (packobj)
558 do n = 1, packobj%nbound
561 node = packobj%nodelist(n)
564 if (packobj%ibound(node) <= 0) cycle
570 cviscref, ctemp, ivisc, a2, a3, a4, &
587 subroutine vsc_ad_lak(packobj, visc, viscref, elev, locvisc, locconc, &
588 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
592 class(
bndtype),
pointer :: packobj
594 real(DP),
intent(in) :: viscref
595 real(DP),
intent(in) :: a2, a3, a4
596 integer(I4B),
intent(in) :: locvisc
597 integer(I4B),
dimension(:),
intent(in) :: locconc
598 integer(I4B),
dimension(:),
intent(in) :: ivisc
599 real(DP),
dimension(:),
intent(in) :: visc
600 real(DP),
dimension(:),
intent(in) :: elev
601 real(DP),
dimension(:),
intent(in) :: dviscdc
602 real(DP),
dimension(:),
intent(in) :: cviscref
603 real(DP),
dimension(:),
intent(inout) :: ctemp
610 select type (packobj)
612 do n = 1, packobj%nbound
615 node = packobj%nodelist(n)
618 if (packobj%ibound(node) <= 0) cycle
624 cviscref, ctemp, ivisc, a2, a3, a4, &
641 subroutine vsc_ad_maw(packobj, visc, viscref, elev, locvisc, locconc, &
642 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
646 class(
bndtype),
pointer :: packobj
648 real(DP),
intent(in) :: viscref
649 real(DP),
intent(in) :: a2, a3, a4
650 integer(I4B),
intent(in) :: locvisc
651 integer(I4B),
dimension(:),
intent(in) :: locconc
652 integer(I4B),
dimension(:),
intent(in) :: ivisc
653 real(DP),
dimension(:),
intent(in) :: visc
654 real(DP),
dimension(:),
intent(in) :: elev
655 real(DP),
dimension(:),
intent(in) :: dviscdc
656 real(DP),
dimension(:),
intent(in) :: cviscref
657 real(DP),
dimension(:),
intent(inout) :: ctemp
664 select type (packobj)
666 do n = 1, packobj%nbound
669 node = packobj%nodelist(n)
672 if (packobj%ibound(node) <= 0) cycle
678 cviscref, ctemp, ivisc, a2, a3, a4, &
697 real(dp),
intent(in) :: viscref
698 real(dp),
intent(in) :: bndvisc
699 real(dp),
intent(in) :: spcfdcond
702 real(dp) :: updatedcond
707 updatedcond = vscratio * spcfdcond
714 real(dp),
intent(in) :: viscref
715 real(dp),
intent(in) :: bndvisc
717 real(dp) :: viscratio
719 viscratio = viscref / bndvisc
731 ctemp, ivisc, a2, a3, a4, auxvar)
result(viscbnd)
734 integer(I4B),
intent(in) :: n
735 integer(I4B),
intent(in) :: locvisc
736 real(dp),
intent(in) :: a2, a3, a4
737 integer(I4B),
dimension(:),
intent(in) :: ivisc
738 integer(I4B),
dimension(:),
intent(in) :: locconc
739 real(dp),
intent(in) :: viscref
740 real(dp),
dimension(:),
intent(in) :: dviscdc
741 real(dp),
dimension(:),
intent(in) :: cviscref
742 real(dp),
dimension(:),
intent(inout) :: ctemp
743 real(dp),
dimension(:, :),
intent(in) :: auxvar
750 if (locvisc > 0)
then
752 viscbnd = auxvar(locvisc, n)
753 else if (locconc(1) > 0)
then
755 do i = 1,
size(locconc)
757 if (locconc(i) > 0)
then
758 ctemp(i) = auxvar(locconc(i), n)
761 viscbnd =
calc_visc(ivisc, viscref, dviscdc, cviscref, ctemp, a2, a3, a4)
780 integer(I4B),
intent(in) :: n, m
781 real(DP),
intent(in) :: gwhdn, gwhdm
782 real(DP),
intent(inout) :: viscratio
784 integer(I4B) :: cellid
787 if (gwhdm > gwhdn)
then
789 else if (gwhdn >= gwhdm)
then
792 call this%calc_q_visc(cellid, viscratio)
804 integer(I4B),
intent(in) :: cellid
806 real(DP),
intent(inout) :: viscratio
811 visc = this%visc(cellid)
829 real(DP) :: viscratio
834 do n = 1, this%dis%nodes
835 call this%calc_q_visc(n, viscratio)
836 this%k11(n) = this%k11input(n) * viscratio
837 this%k22(n) = this%k22input(n) * viscratio
838 this%k33(n) = this%k33input(n) * viscratio
839 this%nodekchange(n) = 1
843 call this%vsc_set_changed_at(
kper,
kstp)
854 integer(I4B),
intent(in) :: kper
855 integer(I4B),
intent(in) :: kstp
857 this%kchangeper = kper
858 this%kchangestp = kstp
868 integer(I4B),
intent(in) :: idvfl
870 character(len=1) :: cdatafmp =
' ', editdesc =
' '
871 integer(I4B) :: ibinun
872 integer(I4B) :: iprint
873 integer(I4B) :: nvaluesp
874 integer(I4B) :: nwidthp
878 if (this%ioutvisc /= 0)
then
883 if (idvfl == 0) ibinun = 0
886 if (ibinun /= 0)
then
891 if (this%ioutvisc /= 0)
then
892 ibinun = this%ioutvisc
893 call this%dis%record_array(this%visc, this%iout, iprint, ibinun, &
894 ' VISCOSITY', cdatafmp, nvaluesp, &
895 nwidthp, editdesc, dinact)
909 if (this%inunit > 0)
then
915 deallocate (this%cmodelname)
916 deallocate (this%cauxspeciesname)
917 deallocate (this%modelconc)
936 nullify (this%k11input)
937 nullify (this%k22input)
938 nullify (this%k33input)
939 nullify (this%kchangeper)
940 nullify (this%kchangestp)
941 nullify (this%nodekchange)
944 call this%NumericalPackageType%da()
956 character(len=LINELENGTH) :: errmsg, keyword
958 logical :: isfound, endOfBlock
961 call this%parser%GetBlock(
'DIMENSIONS', isfound, ierr, &
962 supportopenclose=.true.)
966 write (this%iout,
'(/1x,a)')
'Processing VSC DIMENSIONS block'
968 call this%parser%GetNextLine(endofblock)
970 call this%parser%GetStringCaps(keyword)
971 select case (keyword)
972 case (
'NVISCSPECIES')
973 this%nviscspecies = this%parser%GetInteger()
974 write (this%iout,
'(4x,a,i0)')
'NVISCSPECIES = ', this%nviscspecies
976 write (errmsg,
'(a,a)') &
977 'Unknown VSC dimension: ', trim(keyword)
979 call this%parser%StoreErrorUnit()
982 write (this%iout,
'(1x,a)')
'End of VSC DIMENSIONS block'
984 call store_error(
'Required VSC DIMENSIONS block not found.')
985 call this%parser%StoreErrorUnit()
989 if (this%nviscspecies < 1)
then
990 call store_error(
'NVISCSPECIES must be greater than zero.')
991 call this%parser%StoreErrorUnit()
1003 character(len=LINELENGTH) :: errmsg
1004 character(len=LINELENGTH) :: line
1005 integer(I4B) :: ierr
1006 integer(I4B) :: iviscspec
1007 logical :: isfound, endOfBlock
1008 logical :: blockrequired
1009 integer(I4B),
dimension(:),
allocatable :: itemp
1010 character(len=10) :: c10
1011 character(len=16) :: c16
1013 character(len=*),
parameter :: fmterr = &
1014 "('Invalid value for IRHOSPEC (',i0,') detected in VSC Package. &
1015 &IRHOSPEC must be > 0 and <= NVISCSPECIES, and duplicate values &
1016 &are not allowed.')"
1019 allocate (itemp(this%nviscspecies))
1023 blockrequired = .true.
1024 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
1025 blockrequired=blockrequired, &
1026 supportopenclose=.true.)
1030 write (this%iout,
'(1x,a)')
'Procesing VSC PACKAGEDATA block'
1032 call this%parser%GetNextLine(endofblock)
1033 if (endofblock)
exit
1034 iviscspec = this%parser%GetInteger()
1035 if (iviscspec < 1 .or. iviscspec > this%nviscspecies)
then
1036 write (errmsg, fmterr) iviscspec
1039 if (itemp(iviscspec) /= 0)
then
1040 write (errmsg, fmterr) iviscspec
1043 itemp(iviscspec) = 1
1045 this%dviscdc(iviscspec) = this%parser%GetDouble()
1046 this%cviscref(iviscspec) = this%parser%GetDouble()
1047 call this%parser%GetStringCaps(this%cmodelname(iviscspec))
1048 call this%parser%GetStringCaps(this%cauxspeciesname(iviscspec))
1050 if (this%cauxspeciesname(iviscspec) == this%name_temp_spec)
then
1051 if (this%idxtmpr > 0)
then
1052 write (errmsg,
'(a)')
'More than one species in VSC input identified &
1053 &as '//trim(this%name_temp_spec)//
'. Only one species may be &
1054 &designated to represent temperature.'
1057 this%idxtmpr = iviscspec
1058 if (this%thermivisc == 2)
then
1059 this%ivisc(iviscspec) = 2
1065 call store_error(
'Required VSC PACKAGEDATA block not found.')
1066 call this%parser%StoreErrorUnit()
1071 call this%parser%StoreErrorUnit()
1075 write (this%iout,
'(/,1x,a)')
'Summary of species information in VSC Package'
1076 write (this%iout,
'(1a11,5a17)') &
1077 'Species',
'DVISCDC',
'CVISCREF',
'Model',
'AUXSPECIESNAME'
1078 do iviscspec = 1, this%nviscspecies
1079 write (c10,
'(i0)') iviscspec
1080 line =
' '//adjustr(c10)
1082 write (c16,
'(g15.6)') this%dviscdc(iviscspec)
1083 line = trim(line)//
' '//adjustr(c16)
1084 write (c16,
'(g15.6)') this%cviscref(iviscspec)
1085 line = trim(line)//
' '//adjustr(c16)
1086 write (c16,
'(a)') this%cmodelname(iviscspec)
1087 line = trim(line)//
' '//adjustr(c16)
1088 write (c16,
'(a)') this%cauxspeciesname(iviscspec)
1089 line = trim(line)//
' '//adjustr(c16)
1090 write (this%iout,
'(a)') trim(line)
1096 write (this%iout,
'(/,1x,a)')
'End of VSC PACKAGEDATA block'
1106 integer(I4B) :: ispec
1108 do ispec = 1, this%nviscspecies
1109 this%dviscdc(ispec) = input_data%dviscdc(ispec)
1110 this%cviscref(ispec) = input_data%cviscref(ispec)
1111 this%cmodelname(ispec) = input_data%cmodelname(ispec)
1112 this%cauxspeciesname(ispec) = input_data%cauxspeciesname(ispec)
1130 do n = 1, this%dis%nodes
1131 do i = 1, this%nviscspecies
1132 if (this%modelconc(i)%icbund(n) == 0)
then
1135 this%ctemp(i) = this%modelconc(i)%conc(n)
1139 this%visc(n) =
calc_visc(this%ivisc, this%viscref, this%dviscdc, &
1140 this%cviscref, this%ctemp, this%a2, &
1157 call this%NumericalPackageType%allocate_scalars()
1160 call mem_allocate(this%thermivisc,
'THERMIVISC', this%memoryPath)
1161 call mem_allocate(this%idxtmpr,
'IDXTMPR', this%memoryPath)
1162 call mem_allocate(this%ioutvisc,
'IOUTVISC', this%memoryPath)
1163 call mem_allocate(this%ireadelev,
'IREADELEV', this%memoryPath)
1164 call mem_allocate(this%iconcset,
'ICONCSET', this%memoryPath)
1165 call mem_allocate(this%viscref,
'VISCREF', this%memoryPath)
1170 call mem_allocate(this%nviscspecies,
'NVISCSPECIES', this%memoryPath)
1183 this%nviscspecies = 0
1193 integer(I4B),
intent(in) :: nodes
1198 call mem_allocate(this%visc, nodes,
'VISC', this%memoryPath)
1199 call mem_allocate(this%ivisc, this%nviscspecies,
'IVISC', this%memoryPath)
1200 call mem_allocate(this%dviscdc, this%nviscspecies,
'DRHODC', &
1202 call mem_allocate(this%cviscref, this%nviscspecies,
'CRHOREF', &
1204 call mem_allocate(this%ctemp, this%nviscspecies,
'CTEMP', this%memoryPath)
1205 allocate (this%cmodelname(this%nviscspecies))
1206 allocate (this%cauxspeciesname(this%nviscspecies))
1207 allocate (this%modelconc(this%nviscspecies))
1211 this%visc(i) = this%viscref
1215 do i = 1, this%nviscspecies
1217 this%dviscdc(i) =
dzero
1218 this%cviscref(i) =
dzero
1219 this%ctemp(i) =
dzero
1220 this%cmodelname(i) =
''
1221 this%cauxspeciesname(i) =
''
1236 character(len=LINELENGTH) :: warnmsg, errmsg, keyword, keyword2
1237 character(len=MAXCHARLEN) :: fname
1238 integer(I4B) :: ierr
1239 logical :: isfound, endOfBlock
1241 character(len=*),
parameter :: fmtfileout = &
1242 "(1x, 'VSC', 1x, a, 1x, 'Will be saved to file: ', &
1243 &a, /4x, 'opened on unit: ', I7)"
1244 character(len=*),
parameter :: fmtlinear = &
1245 "(/,1x,'Viscosity will vary linearly with temperature &
1247 character(len=*),
parameter :: fmtnonlinear = &
1248 "(/,1x,'Viscosity will vary non-linearly with temperature &
1252 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, &
1253 supportopenclose=.true., blockrequired=.false.)
1257 write (this%iout,
'(1x,a)')
'Processing VSC OPTIONS block'
1259 call this%parser%GetNextLine(endofblock)
1260 if (endofblock)
exit
1261 call this%parser%GetStringCaps(keyword)
1262 select case (keyword)
1264 this%viscref = this%parser%GetDouble()
1265 write (this%iout,
'(4x,a,1pg15.6)') &
1266 'Reference viscosity has been set to: ', &
1269 call this%parser%GetStringCaps(keyword)
1270 if (keyword ==
'FILEOUT')
then
1271 call this%parser%GetString(fname)
1273 call openfile(this%ioutvisc, this%iout, fname,
'DATA(BINARY)', &
1275 write (this%iout, fmtfileout) &
1276 'VISCOSITY', fname, this%ioutvisc
1278 errmsg =
'Optional VISCOSITY keyword must be '// &
1279 'followed by FILEOUT'
1282 case (
'TEMPERATURE_SPECIES_NAME')
1283 call this%parser%GetStringCaps(this%name_temp_spec)
1284 write (this%iout,
'(4x, a)')
'Temperature species name set to: '// &
1285 trim(this%name_temp_spec)
1286 case (
'THERMAL_FORMULATION')
1287 call this%parser%GetStringCaps(keyword2)
1288 if (trim(adjustl(keyword2)) ==
'LINEAR') this%thermivisc = 1
1289 if (trim(adjustl(keyword2)) ==
'NONLINEAR') this%thermivisc = 2
1290 select case (this%thermivisc)
1292 write (this%iout, fmtlinear)
1294 write (this%iout, fmtnonlinear)
1297 this%a2 = this%parser%GetDouble()
1298 if (this%thermivisc == 2)
then
1299 write (this%iout,
'(4x,a,1pg15.6)') &
1300 'A2 in nonlinear viscosity formulation has been set to: ', &
1303 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A2 specified by user &
1304 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1305 &specified. THERMAL_A2 will not affect ',
'viscosity calculations.'
1308 this%a3 = this%parser%GetDouble()
1309 if (this%thermivisc == 2)
then
1310 write (this%iout,
'(4x,a,1pg15.6)') &
1311 'A3 in nonlinear viscosity formulation has been set to: ', &
1314 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A3 specified by user &
1315 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1316 &specified. THERMAL_A3 will not affect ',
'viscosity calculations.'
1319 this%a4 = this%parser%GetDouble()
1320 if (this%thermivisc == 2)
then
1321 write (this%iout,
'(4x,a,1pg15.6)') &
1322 'A4 in nonlinear viscosity formulation has been set to: ', &
1325 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A4 specified by user &
1326 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1327 &specified. THERMAL_A4 will not affect ',
'viscosity calculations.'
1330 write (errmsg,
'(a,a)')
'Unknown VSC option: ', &
1333 call this%parser%StoreErrorUnit()
1337 if (this%thermivisc == 1)
then
1338 if (this%a2 == 0.0)
then
1339 write (errmsg,
'(a)')
'LINEAR option selected for varying &
1340 &viscosity with temperature, but A1, a surrogate for &
1341 &dVISC/dT, set equal to 0.0'
1345 if (this%thermivisc > 1)
then
1346 if (this%a2 == 0)
then
1347 write (warnmsg,
'(a)')
'NONLINEAR option selected for &
1348 &varying viscosity with temperature, but A2 set equal to &
1349 &zero which may lead to unintended values for viscosity'
1352 if (this%a3 == 0)
then
1353 write (warnmsg,
'(a)')
'NONLINEAR option selected for &
1354 &varying viscosity with temperature,, but A3 set equal to &
1355 &zero which may lead to unintended values for viscosity'
1358 if (this%a4 == 0)
then
1359 write (warnmsg,
'(a)')
'NONLINEAR option selected for &
1360 &varying viscosity with temperature, BUT A4 SET EQUAL TO &
1361 &zero which may lead to unintended values for viscosity'
1367 write (this%iout,
'(/,1x,a)')
'end of VSC options block'
1377 this%viscref = input_data%viscref
1390 character(len=LENMODELNAME),
intent(in) :: modelname
1391 real(DP),
dimension(:),
pointer :: conc
1392 integer(I4B),
dimension(:),
pointer :: icbund
1393 integer(I4B),
optional,
intent(in) :: istmpr
1400 do i = 1, this%nviscspecies
1401 if (this%cmodelname(i) == modelname)
then
1402 this%modelconc(i)%conc => conc
1403 this%modelconc(i)%icbund => icbund
This module contains the base boundary package.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dep3
real constant 1000
integer(i4b), parameter lenmodelname
maximum length of the model name
real(dp), parameter dhnoflo
real no flow constant
real(dp), parameter dhalf
real constant 1/2
integer(i4b), parameter lenauxname
maximum length of a aux variable
real(dp), parameter dzero
real constant zero
real(dp), parameter dten
real constant 10
integer(i4b), parameter maxcharlen
maximum length of char string
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
subroutine vsc_da(this)
@ brief Deallocate viscosity package memory
subroutine read_dimensions(this)
@ brief Read dimensions
subroutine allocate_arrays(this, nodes)
@ brief Allocate arrays
subroutine vsc_set_changed_at(this, kper, kstp)
Mark K changes as having occurred at (kper, kstp)
subroutine update_k_with_vsc(this)
Appled the viscosity ratio (mu_o/mu) to the hydraulic conductivity.
subroutine vsc_ad_standard_bnd(packobj, hnew, visc, viscref, locelev, locvisc, locconc, dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
advance ghb while accounting for viscosity
subroutine allocate_scalars(this)
@ brief Allocate scalars
subroutine vsc_ad_lak(packobj, visc, viscref, elev, locvisc, locconc, dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
Update lak-related viscosity ratios.
subroutine calc_q_visc(this, cellid, viscratio)
Account for viscosity in the aquiferhorizontal flow barriers.
subroutine, public vsc_cr(vscobj, name_model, inunit, iout)
@ brief Create a new package object
real(dp) function calc_vsc_ratio(viscref, bndvisc)
calculate and return the viscosity ratio
subroutine vsc_calcvisc(this)
Calculate fluid viscosity.
subroutine vsc_ad(this)
@ brief Advance the viscosity package
subroutine vsc_ot_dv(this, idvfl)
@ brief Output viscosity package dependent-variable terms.
real(dp) function calc_bnd_viscosity(n, locvisc, locconc, viscref, dviscdc, cviscref, ctemp, ivisc, a2, a3, a4, auxvar)
@ brief Calculate the boundary viscosity
real(dp) function update_bnd_cond(bndvisc, viscref, spcfdcond)
Apply viscosity to the conductance term.
subroutine vsc_ar_bnd(this, packobj)
Activate viscosity in advanced packages.
subroutine read_options(this)
@ brief Read Options block
subroutine set_packagedata(this, input_data)
Sets package data instead of reading from file.
subroutine vsc_df(this, dis, vsc_input)
@ brief Define viscosity package options and dimensions
subroutine vsc_ad_sfr(packobj, visc, viscref, elev, locvisc, locconc, dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
Update sfr-related viscosity ratios.
subroutine vsc_ar(this, ibound)
@ brief Allocate and read method for viscosity package
subroutine set_options(this, input_data)
Sets options as opposed to reading them from a file.
subroutine vsc_rp(this)
@ brief Read new period data in viscosity package
subroutine vsc_ad_bnd(this, packobj, hnew)
Advance the boundary packages when viscosity is active.
subroutine read_packagedata(this)
@ brief Read data for package
subroutine get_visc_ratio(this, n, m, gwhdn, gwhdm, viscratio)
Calculate the viscosity ratio.
subroutine set_npf_pointers(this)
Set pointers to NPF variables.
subroutine vsc_ad_maw(packobj, visc, viscref, elev, locvisc, locconc, dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
Update maw-related viscosity ratios.
subroutine set_concentration_pointer(this, modelname, conc, icbund, istmpr)
@ brief Set pointers to concentration(s)
real(dp) function calc_visc(ivisc, viscref, dviscdc, cviscref, conc, a2, a3, a4)
Generic function to calculate changes in fluid viscosity using a linear formulation.
This module defines variable data types.
type(listtype), public basemodellist
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the base numerical package type.
This module contains the SFR package methods.
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number