27 real(dp),
dimension(:),
pointer :: conc => null()
28 integer(I4B),
dimension(:),
pointer :: icbund => null()
32 integer(I4B),
pointer :: thermivisc => null()
33 integer(I4B),
pointer :: idxtmpr => null()
34 integer(I4B),
pointer :: ioutvisc => null()
35 integer(I4B),
pointer :: iconcset => null()
36 integer(I4B),
pointer :: ireadelev => null()
37 integer(I4B),
dimension(:),
pointer,
contiguous :: ivisc => null()
38 real(dp),
pointer :: viscref => null()
39 real(dp),
dimension(:),
pointer,
contiguous :: visc => null()
40 real(dp),
dimension(:),
pointer,
contiguous :: elev => null()
41 integer(I4B),
dimension(:),
pointer :: ibound => null()
43 integer(I4B),
pointer :: nviscspecies => null()
44 real(dp),
dimension(:),
pointer,
contiguous :: dviscdc => null()
45 real(dp),
dimension(:),
pointer,
contiguous :: cviscref => null()
46 real(dp),
dimension(:),
pointer,
contiguous :: ctemp => null()
47 character(len=LENMODELNAME),
dimension(:),
allocatable :: cmodelname
48 character(len=LENAUXNAME),
dimension(:),
allocatable :: cauxspeciesname
49 character(len=LENAUXNAME) :: name_temp_spec =
'TEMPERATURE'
52 real(dp),
pointer :: a2 => null()
53 real(dp),
pointer :: a3 => null()
54 real(dp),
pointer :: a4 => null()
58 real(dp),
dimension(:),
pointer,
contiguous :: k11 => null()
59 real(dp),
dimension(:),
pointer,
contiguous :: k22 => null()
60 real(dp),
dimension(:),
pointer,
contiguous :: k33 => null()
61 real(dp),
dimension(:),
pointer,
contiguous :: k11input => null()
62 real(dp),
dimension(:),
pointer,
contiguous :: k22input => null()
63 real(dp),
dimension(:),
pointer,
contiguous :: k33input => null()
64 integer(I4B),
pointer :: kchangeper => null()
65 integer(I4B),
pointer :: kchangestp => null()
66 integer(I4B),
dimension(:),
pointer,
contiguous :: nodekchange => null()
100 function calc_visc(ivisc, viscref, dviscdc, cviscref, conc, &
101 a2, a3, a4)
result(visc)
103 integer(I4B),
dimension(:),
intent(in) :: ivisc
104 real(dp),
intent(in) :: viscref
105 real(dp),
dimension(:),
intent(in) :: dviscdc
106 real(dp),
dimension(:),
intent(in) :: cviscref
107 real(dp),
dimension(:),
intent(in) :: conc
108 real(dp),
intent(in) :: a2, a3, a4
112 integer(I4B) :: nviscspec
117 nviscspec =
size(dviscdc)
121 if (ivisc(i) == 1)
then
122 visc = visc + dviscdc(i) * (conc(i) - cviscref(i))
124 expon = -1 * a3 * ((conc(i) - cviscref(i)) / &
125 ((conc(i) + a4) * (cviscref(i) + a4)))
126 mu_t = viscref * a2**expon
132 visc = (visc - viscref) + mu_t
142 subroutine vsc_cr(vscobj, name_model, input_mempath, inunit, iout)
145 character(len=*),
intent(in) :: name_model
146 character(len=*),
intent(in) :: input_mempath
147 integer(I4B),
intent(in) :: inunit
148 integer(I4B),
intent(in) :: iout
154 call vscobj%set_names(1, name_model,
'VSC',
'VSC', input_mempath)
157 call vscobj%allocate_scalars()
160 vscobj%inunit = inunit
174 character(len=*),
parameter :: fmtvsc = &
175 "(1x,/1x,'VSC -- Viscosity Package, version 1, 11/15/2022', &
176 &' input read from mempath: ', a, /)"
179 write (this%iout, fmtvsc) this%input_mempath
184 if (.not.
present(vsc_input))
then
187 call this%source_options()
190 call this%source_dimensions()
193 call this%set_options(vsc_input)
194 this%nviscspecies = vsc_input%nviscspecies
198 call this%allocate_arrays(dis%nodes)
200 if (.not.
present(vsc_input))
then
203 call this%source_packagedata()
206 call this%set_packagedata(vsc_input)
218 integer(I4B),
dimension(:),
pointer :: ibound
221 this%ibound => ibound
224 call this%set_npf_pointers()
244 class(
bndtype),
pointer :: packobj
247 select case (packobj%filtyp)
251 select type (packobj)
253 call packobj%bnd_activate_viscosity()
258 select type (packobj)
260 call packobj%bnd_activate_viscosity()
265 select type (packobj)
267 call packobj%bnd_activate_viscosity()
272 select type (packobj)
274 call packobj%lak_activate_viscosity()
279 select type (packobj)
281 call packobj%sfr_activate_viscosity()
286 select type (packobj)
288 call packobj%maw_activate_viscosity()
305 character(len=LENMEMPATH) :: npfMemoryPath
310 call mem_setptr(this%k11,
'K11', npfmemorypath)
311 call mem_setptr(this%k22,
'K22', npfmemorypath)
312 call mem_setptr(this%k33,
'K33', npfmemorypath)
313 call mem_setptr(this%k11input,
'K11INPUT', npfmemorypath)
314 call mem_setptr(this%k22input,
'K22INPUT', npfmemorypath)
315 call mem_setptr(this%k33input,
'K33INPUT', npfmemorypath)
316 call mem_setptr(this%kchangeper,
'KCHANGEPER', npfmemorypath)
317 call mem_setptr(this%kchangestp,
'KCHANGESTP', npfmemorypath)
318 call mem_setptr(this%nodekchange,
'NODEKCHANGE', npfmemorypath)
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
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()
959 call mem_set_value(this%nviscspecies,
'NVISCSPECIES', this%input_mempath, &
963 write (this%iout,
'(/1x,a)')
'Processing VSC DIMENSIONS block'
964 write (this%iout,
'(4x,a,i0)')
'NVISCSPECIES = ', this%nviscspecies
965 write (this%iout,
'(1x,a)')
'End of VSC DIMENSIONS block'
968 if (this%nviscspecies < 1)
then
969 call store_error(
'NVISCSPECIES must be greater than zero.')
983 integer(I4B),
dimension(:),
pointer,
contiguous :: iviscspec
985 contiguous :: modelnames, auxspeciesnames
986 real(DP),
dimension(:),
pointer,
contiguous :: dviscdc, cviscref
987 integer(I4B),
dimension(:),
allocatable :: itemp
988 character(len=LINELENGTH) :: modelname, auxspeciesname, line
989 character(len=10) :: c10
990 character(len=16) :: c16
993 character(len=*),
parameter :: fmterr = &
994 "('Invalid value for IRHOSPEC (',i0,') detected in VSC Package. &
995 &IRHOSPEC must be > 0 and <= NVISCSPECIES, and duplicate values &
999 allocate (itemp(this%nviscspecies))
1003 call mem_setptr(iviscspec,
'IVISCSPEC', this%input_mempath)
1004 call mem_setptr(dviscdc,
'DVISCDC', this%input_mempath)
1005 call mem_setptr(cviscref,
'CVISCREF', this%input_mempath)
1006 call mem_setptr(modelnames,
'MODELNAME', this%input_mempath)
1007 call mem_setptr(auxspeciesnames,
'AUXSPECIESNAME', this%input_mempath)
1010 do n = 1,
size(iviscspec)
1011 modelname = modelnames(n)
1012 auxspeciesname = auxspeciesnames(n)
1014 if (iviscspec(n) < 1 .or. iviscspec(n) > this%nviscspecies)
then
1015 write (
errmsg, fmterr) iviscspec(n)
1018 if (itemp(iviscspec(n)) /= 0)
then
1019 write (
errmsg, fmterr) iviscspec(n)
1022 itemp(iviscspec(n)) = 1
1024 this%dviscdc(iviscspec(n)) = dviscdc(n)
1025 this%cviscref(iviscspec(n)) = cviscref(n)
1026 this%cmodelname(iviscspec(n)) = trim(modelname)
1027 this%cauxspeciesname(iviscspec(n)) = trim(auxspeciesname)
1029 if (auxspeciesname == this%name_temp_spec)
then
1030 if (this%idxtmpr > 0)
then
1031 write (
errmsg,
'(a)')
'More than one species in VSC input identified &
1032 &as '//trim(this%name_temp_spec)//
'. Only one species may be &
1033 &designated to represent temperature.'
1036 this%idxtmpr = iviscspec(n)
1037 if (this%thermivisc == 2)
then
1038 this%ivisc(iviscspec(n)) = 2
1050 write (this%iout,
'(/,1x,a)')
'Processing VSC PACKAGEDATA block'
1053 write (this%iout,
'(1x,a)')
'Summary of species information in VSC Package'
1054 write (this%iout,
'(1a11,5a17)') &
1055 'Species',
'DVISCDC',
'CVISCREF',
'Model',
'AUXSPECIESNAME'
1056 do n = 1, this%nviscspecies
1057 write (c10,
'(i0)') n
1058 line =
' '//adjustr(c10)
1060 write (c16,
'(g15.6)') this%dviscdc(n)
1061 line = trim(line)//
' '//adjustr(c16)
1062 write (c16,
'(g15.6)') this%cviscref(n)
1063 line = trim(line)//
' '//adjustr(c16)
1064 write (c16,
'(a)') this%cmodelname(n)
1065 line = trim(line)//
' '//adjustr(c16)
1066 write (c16,
'(a)') this%cauxspeciesname(n)
1067 line = trim(line)//
' '//adjustr(c16)
1068 write (this%iout,
'(a)') trim(line)
1071 write (this%iout,
'(1x,a)')
'End of VSC PACKAGEDATA block'
1090 integer(I4B) :: ispec
1092 do ispec = 1, this%nviscspecies
1093 this%dviscdc(ispec) = input_data%dviscdc(ispec)
1094 this%cviscref(ispec) = input_data%cviscref(ispec)
1095 this%cmodelname(ispec) = input_data%cmodelname(ispec)
1096 this%cauxspeciesname(ispec) = input_data%cauxspeciesname(ispec)
1114 do n = 1, this%dis%nodes
1115 do i = 1, this%nviscspecies
1116 if (this%modelconc(i)%icbund(n) == 0)
then
1117 this%ctemp(i) =
dzero
1119 this%ctemp(i) = this%modelconc(i)%conc(n)
1123 this%visc(n) =
calc_visc(this%ivisc, this%viscref, this%dviscdc, &
1124 this%cviscref, this%ctemp, this%a2, &
1141 call this%NumericalPackageType%allocate_scalars()
1144 call mem_allocate(this%thermivisc,
'THERMIVISC', this%memoryPath)
1145 call mem_allocate(this%idxtmpr,
'IDXTMPR', this%memoryPath)
1146 call mem_allocate(this%ioutvisc,
'IOUTVISC', this%memoryPath)
1147 call mem_allocate(this%ireadelev,
'IREADELEV', this%memoryPath)
1148 call mem_allocate(this%iconcset,
'ICONCSET', this%memoryPath)
1149 call mem_allocate(this%viscref,
'VISCREF', this%memoryPath)
1154 call mem_allocate(this%nviscspecies,
'NVISCSPECIES', this%memoryPath)
1167 this%nviscspecies = 0
1177 integer(I4B),
intent(in) :: nodes
1182 call mem_allocate(this%visc, nodes,
'VISC', this%memoryPath)
1183 call mem_allocate(this%ivisc, this%nviscspecies,
'IVISC', this%memoryPath)
1184 call mem_allocate(this%dviscdc, this%nviscspecies,
'DRHODC', &
1186 call mem_allocate(this%cviscref, this%nviscspecies,
'CRHOREF', &
1188 call mem_allocate(this%ctemp, this%nviscspecies,
'CTEMP', this%memoryPath)
1189 allocate (this%cmodelname(this%nviscspecies))
1190 allocate (this%cauxspeciesname(this%nviscspecies))
1191 allocate (this%modelconc(this%nviscspecies))
1195 this%visc(i) = this%viscref
1199 do i = 1, this%nviscspecies
1201 this%dviscdc(i) =
dzero
1202 this%cviscref(i) =
dzero
1203 this%ctemp(i) =
dzero
1204 this%cmodelname(i) =
''
1205 this%cauxspeciesname(i) =
''
1221 character(len=LENVARNAME),
dimension(2) :: thermal_form = &
1222 &[character(len=LENVARNAME) ::
'LINEAR',
'NONLINEAR']
1223 character(len=linelength) :: viscosityfile
1230 call mem_set_value(this%viscref,
'VISCREF', this%input_mempath, &
1232 call mem_set_value(viscosityfile,
'VISCOSITYFILE', this%input_mempath, &
1233 found%viscosityfile)
1234 call mem_set_value(this%name_temp_spec,
'TEMP_SPECNAME', this%input_mempath, &
1235 found%temp_specname)
1236 call mem_set_value(this%thermivisc,
'THERMAL_FORM', this%input_mempath, &
1237 thermal_form, found%thermal_form)
1238 call mem_set_value(this%a2,
'THERMAL_A2', this%input_mempath, &
1240 call mem_set_value(this%a3,
'THERMAL_A3', this%input_mempath, &
1242 call mem_set_value(this%a4,
'THERMAL_A4', this%input_mempath, &
1246 if (found%viscosityfile)
then
1248 call openfile(this%ioutvisc, this%iout, viscosityfile,
'DATA(BINARY)', &
1253 if (found%thermal_form)
then
1254 if (this%thermivisc == 0)
then
1255 call store_error(
'Unrecognized input value for THERMAL_FORM option.')
1261 if (this%thermivisc == 1)
then
1262 if (this%a2 == 0.0)
then
1263 write (
errmsg,
'(a)')
'LINEAR option selected for varying &
1264 &viscosity with temperature, but A1, a surrogate for &
1265 &dVISC/dT, set equal to 0.0'
1270 if (this%thermivisc > 1)
then
1271 if (this%a2 == 0)
then
1272 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1273 &varying viscosity with temperature, but A2 set equal to &
1274 &zero which may lead to unintended values for viscosity'
1277 if (this%a3 == 0)
then
1278 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1279 &varying viscosity with temperature,, but A3 set equal to &
1280 &zero which may lead to unintended values for viscosity'
1283 if (this%a4 == 0)
then
1284 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1285 &varying viscosity with temperature, BUT A4 SET EQUAL TO &
1286 &zero which may lead to unintended values for viscosity'
1292 call this%log_options(found, viscosityfile)
1303 character(len=*),
intent(in) :: viscosityfile
1306 character(len=*),
parameter :: fmtfileout = &
1307 "(4x, 'VSC', 1x, a, 1x, 'Will be saved to file: ', &
1308 &a, ' opened on unit: ', I7)"
1309 character(len=*),
parameter :: fmtlinear = &
1310 "(4x,'Viscosity will vary linearly with temperature &
1312 character(len=*),
parameter :: fmtnonlinear = &
1313 "(4x,'Viscosity will vary non-linearly with temperature &
1316 write (this%iout,
'(1x,a)')
'Processing VSC OPTIONS block'
1318 if (found%viscref)
then
1319 write (this%iout,
'(4x,a,1pg15.6)') &
1320 'Reference viscosity has been set to: ', this%viscref
1322 if (found%viscosityfile)
then
1323 write (this%iout, fmtfileout) &
1324 'VISCOSITY', trim(viscosityfile), this%ioutvisc
1326 if (found%temp_specname)
then
1327 write (this%iout,
'(4x, a)')
'Temperature species name set to: '// &
1328 trim(this%name_temp_spec)
1330 if (found%thermal_form)
then
1331 select case (this%thermivisc)
1333 write (this%iout, fmtlinear)
1335 write (this%iout, fmtnonlinear)
1338 if (found%thermal_a2)
then
1339 if (this%thermivisc == 2)
then
1340 write (this%iout,
'(4x,a,1pg15.6)') &
1341 'A2 in nonlinear viscosity formulation has been set to: ', &
1344 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A2 specified by user &
1345 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1346 &specified. THERMAL_A2 will not affect ',
'viscosity calculations.'
1349 if (found%thermal_a3)
then
1350 if (this%thermivisc == 2)
then
1351 write (this%iout,
'(4x,a,1pg15.6)') &
1352 'A3 in nonlinear viscosity formulation has been set to: ', &
1355 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A3 specified by user &
1356 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1357 &specified. THERMAL_A3 will not affect ',
'viscosity calculations.'
1360 if (found%thermal_a4)
then
1361 if (this%thermivisc == 2)
then
1362 write (this%iout,
'(4x,a,1pg15.6)') &
1363 'A4 in nonlinear viscosity formulation has been set to: ', &
1366 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A4 specified by user &
1367 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1368 &specified. THERMAL_A4 will not affect ',
'viscosity calculations.'
1372 write (this%iout,
'(1x,a)')
'end of VSC options block'
1382 this%viscref = input_data%viscref
1395 character(len=LENMODELNAME),
intent(in) :: modelname
1396 real(DP),
dimension(:),
pointer :: conc
1397 integer(I4B),
dimension(:),
pointer :: icbund
1398 integer(I4B),
optional,
intent(in) :: istmpr
1405 do i = 1, this%nviscspecies
1406 if (this%cmodelname(i) == modelname)
then
1407 this%modelconc(i)%conc => conc
1408 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
integer(i4b), parameter lenvarname
maximum length of a variable name
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 source_options(this)
@ brief Source VSC options
subroutine vsc_da(this)
@ brief Deallocate viscosity package memory
subroutine allocate_arrays(this, nodes)
@ brief Allocate arrays
subroutine, public vsc_cr(vscobj, name_model, input_mempath, inunit, iout)
@ brief Create a new package object
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 aquifer hydraulic flow barriers.
real(dp) function calc_vsc_ratio(viscref, bndvisc)
calculate and return the viscosity ratio
subroutine source_packagedata(this)
@ brief source packagedata for package
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 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 source_dimensions(this)
@ brief Source dimensions for package
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 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 log_options(this, found, viscosityfile)
@ brief log VSC options
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
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
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.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
This class is used to store a single deferred-length character string. It was designed to work in an ...