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.')
982 integer(I4B),
dimension(:),
pointer,
contiguous :: iviscspec
984 contiguous :: modelnames, auxspeciesnames
985 real(DP),
dimension(:),
pointer,
contiguous :: dviscdc, cviscref
986 integer(I4B),
dimension(:),
allocatable :: itemp
987 character(len=LINELENGTH) :: modelname, auxspeciesname, line
988 character(len=10) :: c10
989 character(len=16) :: c16
992 character(len=*),
parameter :: fmterr = &
993 "('Invalid value for IRHOSPEC (',i0,') detected in VSC Package. &
994 &IRHOSPEC must be > 0 and <= NVISCSPECIES, and duplicate values &
998 allocate (itemp(this%nviscspecies))
1002 call mem_setptr(iviscspec,
'IVISCSPEC', this%input_mempath)
1003 call mem_setptr(dviscdc,
'DVISCDC', this%input_mempath)
1004 call mem_setptr(cviscref,
'CVISCREF', this%input_mempath)
1005 call mem_setptr(modelnames,
'MODELNAME', this%input_mempath)
1006 call mem_setptr(auxspeciesnames,
'AUXSPECIESNAME', this%input_mempath)
1009 do n = 1,
size(iviscspec)
1010 modelname = modelnames(n)
1011 auxspeciesname = auxspeciesnames(n)
1013 if (iviscspec(n) < 1 .or. iviscspec(n) > this%nviscspecies)
then
1014 write (
errmsg, fmterr) iviscspec(n)
1017 if (itemp(iviscspec(n)) /= 0)
then
1018 write (
errmsg, fmterr) iviscspec(n)
1021 itemp(iviscspec(n)) = 1
1023 this%dviscdc(iviscspec(n)) = dviscdc(n)
1024 this%cviscref(iviscspec(n)) = cviscref(n)
1025 this%cmodelname(iviscspec(n)) = trim(modelname)
1026 this%cauxspeciesname(iviscspec(n)) = trim(auxspeciesname)
1028 if (auxspeciesname == this%name_temp_spec)
then
1029 if (this%idxtmpr > 0)
then
1030 write (
errmsg,
'(a)')
'More than one species in VSC input identified &
1031 &as '//trim(this%name_temp_spec)//
'. Only one species may be &
1032 &designated to represent temperature.'
1035 this%idxtmpr = iviscspec(n)
1036 if (this%thermivisc == 2)
then
1037 this%ivisc(iviscspec(n)) = 2
1049 write (this%iout,
'(/,1x,a)')
'Processing VSC PACKAGEDATA block'
1052 write (this%iout,
'(1x,a)')
'Summary of species information in VSC Package'
1053 write (this%iout,
'(1a11,5a17)') &
1054 'Species',
'DVISCDC',
'CVISCREF',
'Model',
'AUXSPECIESNAME'
1055 do n = 1, this%nviscspecies
1056 write (c10,
'(i0)') n
1057 line =
' '//adjustr(c10)
1059 write (c16,
'(g15.6)') this%dviscdc(n)
1060 line = trim(line)//
' '//adjustr(c16)
1061 write (c16,
'(g15.6)') this%cviscref(n)
1062 line = trim(line)//
' '//adjustr(c16)
1063 write (c16,
'(a)') this%cmodelname(n)
1064 line = trim(line)//
' '//adjustr(c16)
1065 write (c16,
'(a)') this%cauxspeciesname(n)
1066 line = trim(line)//
' '//adjustr(c16)
1067 write (this%iout,
'(a)') trim(line)
1070 write (this%iout,
'(1x,a)')
'End of VSC PACKAGEDATA block'
1083 integer(I4B) :: ispec
1085 do ispec = 1, this%nviscspecies
1086 this%dviscdc(ispec) = input_data%dviscdc(ispec)
1087 this%cviscref(ispec) = input_data%cviscref(ispec)
1088 this%cmodelname(ispec) = input_data%cmodelname(ispec)
1089 this%cauxspeciesname(ispec) = input_data%cauxspeciesname(ispec)
1107 do n = 1, this%dis%nodes
1108 do i = 1, this%nviscspecies
1109 if (this%modelconc(i)%icbund(n) == 0)
then
1110 this%ctemp(i) =
dzero
1112 this%ctemp(i) = this%modelconc(i)%conc(n)
1116 this%visc(n) =
calc_visc(this%ivisc, this%viscref, this%dviscdc, &
1117 this%cviscref, this%ctemp, this%a2, &
1134 call this%NumericalPackageType%allocate_scalars()
1137 call mem_allocate(this%thermivisc,
'THERMIVISC', this%memoryPath)
1138 call mem_allocate(this%idxtmpr,
'IDXTMPR', this%memoryPath)
1139 call mem_allocate(this%ioutvisc,
'IOUTVISC', this%memoryPath)
1140 call mem_allocate(this%ireadelev,
'IREADELEV', this%memoryPath)
1141 call mem_allocate(this%iconcset,
'ICONCSET', this%memoryPath)
1142 call mem_allocate(this%viscref,
'VISCREF', this%memoryPath)
1147 call mem_allocate(this%nviscspecies,
'NVISCSPECIES', this%memoryPath)
1160 this%nviscspecies = 0
1170 integer(I4B),
intent(in) :: nodes
1175 call mem_allocate(this%visc, nodes,
'VISC', this%memoryPath)
1176 call mem_allocate(this%ivisc, this%nviscspecies,
'IVISC', this%memoryPath)
1177 call mem_allocate(this%dviscdc, this%nviscspecies,
'DRHODC', &
1179 call mem_allocate(this%cviscref, this%nviscspecies,
'CRHOREF', &
1181 call mem_allocate(this%ctemp, this%nviscspecies,
'CTEMP', this%memoryPath)
1182 allocate (this%cmodelname(this%nviscspecies))
1183 allocate (this%cauxspeciesname(this%nviscspecies))
1184 allocate (this%modelconc(this%nviscspecies))
1188 this%visc(i) = this%viscref
1192 do i = 1, this%nviscspecies
1194 this%dviscdc(i) =
dzero
1195 this%cviscref(i) =
dzero
1196 this%ctemp(i) =
dzero
1197 this%cmodelname(i) =
''
1198 this%cauxspeciesname(i) =
''
1214 character(len=LENVARNAME),
dimension(2) :: thermal_form = &
1215 &[character(len=LENVARNAME) ::
'LINEAR',
'NONLINEAR']
1216 character(len=linelength) :: viscosityfile
1223 call mem_set_value(this%viscref,
'VISCREF', this%input_mempath, &
1225 call mem_set_value(viscosityfile,
'VISCOSITYFILE', this%input_mempath, &
1226 found%viscosityfile)
1227 call mem_set_value(this%name_temp_spec,
'TEMP_SPECNAME', this%input_mempath, &
1228 found%temp_specname)
1229 call mem_set_value(this%thermivisc,
'THERMAL_FORM', this%input_mempath, &
1230 thermal_form, found%thermal_form)
1231 call mem_set_value(this%a2,
'THERMAL_A2', this%input_mempath, &
1233 call mem_set_value(this%a3,
'THERMAL_A3', this%input_mempath, &
1235 call mem_set_value(this%a4,
'THERMAL_A4', this%input_mempath, &
1239 if (found%viscosityfile)
then
1241 call openfile(this%ioutvisc, this%iout, viscosityfile,
'DATA(BINARY)', &
1246 if (this%thermivisc == 1)
then
1247 if (this%a2 == 0.0)
then
1248 write (
errmsg,
'(a)')
'LINEAR option selected for varying &
1249 &viscosity with temperature, but A1, a surrogate for &
1250 &dVISC/dT, set equal to 0.0'
1255 if (this%thermivisc > 1)
then
1256 if (this%a2 == 0)
then
1257 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1258 &varying viscosity with temperature, but A2 set equal to &
1259 &zero which may lead to unintended values for viscosity'
1262 if (this%a3 == 0)
then
1263 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1264 &varying viscosity with temperature,, but A3 set equal to &
1265 &zero which may lead to unintended values for viscosity'
1268 if (this%a4 == 0)
then
1269 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1270 &varying viscosity with temperature, BUT A4 SET EQUAL TO &
1271 &zero which may lead to unintended values for viscosity'
1277 call this%log_options(found, viscosityfile)
1288 character(len=*),
intent(in) :: viscosityfile
1291 character(len=*),
parameter :: fmtfileout = &
1292 "(4x, 'VSC', 1x, a, 1x, 'Will be saved to file: ', &
1293 &a, ' opened on unit: ', I7)"
1294 character(len=*),
parameter :: fmtlinear = &
1295 "(4x,'Viscosity will vary linearly with temperature &
1297 character(len=*),
parameter :: fmtnonlinear = &
1298 "(4x,'Viscosity will vary non-linearly with temperature &
1301 write (this%iout,
'(1x,a)')
'Processing VSC OPTIONS block'
1303 if (found%viscref)
then
1304 write (this%iout,
'(4x,a,1pg15.6)') &
1305 'Reference viscosity has been set to: ', this%viscref
1307 if (found%viscosityfile)
then
1308 write (this%iout, fmtfileout) &
1309 'VISCOSITY', trim(viscosityfile), this%ioutvisc
1311 if (found%temp_specname)
then
1312 write (this%iout,
'(4x, a)')
'Temperature species name set to: '// &
1313 trim(this%name_temp_spec)
1315 if (found%thermal_form)
then
1316 select case (this%thermivisc)
1318 write (this%iout, fmtlinear)
1320 write (this%iout, fmtnonlinear)
1323 if (found%thermal_a2)
then
1324 if (this%thermivisc == 2)
then
1325 write (this%iout,
'(4x,a,1pg15.6)') &
1326 'A2 in nonlinear viscosity formulation has been set to: ', &
1329 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A2 specified by user &
1330 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1331 &specified. THERMAL_A2 will not affect ',
'viscosity calculations.'
1334 if (found%thermal_a3)
then
1335 if (this%thermivisc == 2)
then
1336 write (this%iout,
'(4x,a,1pg15.6)') &
1337 'A3 in nonlinear viscosity formulation has been set to: ', &
1340 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A3 specified by user &
1341 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1342 &specified. THERMAL_A3 will not affect ',
'viscosity calculations.'
1345 if (found%thermal_a4)
then
1346 if (this%thermivisc == 2)
then
1347 write (this%iout,
'(4x,a,1pg15.6)') &
1348 'A4 in nonlinear viscosity formulation has been set to: ', &
1351 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A4 specified by user &
1352 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1353 &specified. THERMAL_A4 will not affect ',
'viscosity calculations.'
1357 write (this%iout,
'(1x,a)')
'end of VSC options block'
1367 this%viscref = input_data%viscref
1380 character(len=LENMODELNAME),
intent(in) :: modelname
1381 real(DP),
dimension(:),
pointer :: conc
1382 integer(I4B),
dimension(:),
pointer :: icbund
1383 integer(I4B),
optional,
intent(in) :: istmpr
1390 do i = 1, this%nviscspecies
1391 if (this%cmodelname(i) == modelname)
then
1392 this%modelconc(i)%conc => conc
1393 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 aquiferhorizontal 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
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 ...