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
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)
467 class(
bndtype),
pointer :: packobj
469 real(DP),
intent(in),
dimension(:) :: hnew
470 real(DP),
intent(in),
dimension(:) :: visc
471 real(DP),
intent(in) :: a2, a3, a4
472 real(DP),
intent(in) :: viscref
473 integer(I4B),
intent(in) :: locelev
474 integer(I4B),
intent(in) :: locvisc
475 integer(I4B),
dimension(:),
intent(in) :: locconc
476 integer(I4B),
dimension(:),
intent(in) :: ivisc
477 real(DP),
dimension(:),
intent(in) :: dviscdc
478 real(DP),
dimension(:),
intent(in) :: cviscref
479 real(DP),
dimension(:),
intent(inout) :: ctemp
485 do n = 1, packobj%nbound
489 cviscref, ctemp, ivisc, a2, a3, a4, &
502 subroutine vsc_ad_sfr(packobj, visc, viscref, elev, locvisc, locconc, &
503 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
507 class(
bndtype),
pointer :: packobj
509 real(DP),
intent(in) :: viscref
510 real(DP),
intent(in) :: a2, a3, a4
511 integer(I4B),
intent(in) :: locvisc
512 integer(I4B),
dimension(:),
intent(in) :: locconc
513 integer(I4B),
dimension(:),
intent(in) :: ivisc
514 real(DP),
dimension(:),
intent(in) :: visc
515 real(DP),
dimension(:),
intent(in) :: elev
516 real(DP),
dimension(:),
intent(in) :: dviscdc
517 real(DP),
dimension(:),
intent(in) :: cviscref
518 real(DP),
dimension(:),
intent(inout) :: ctemp
525 select type (packobj)
527 do n = 1, packobj%nbound
530 node = packobj%nodelist(n)
533 if (packobj%ibound(node) <= 0) cycle
539 cviscref, ctemp, ivisc, a2, a3, a4, &
556 subroutine vsc_ad_lak(packobj, visc, viscref, elev, locvisc, locconc, &
557 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
561 class(
bndtype),
pointer :: packobj
563 real(DP),
intent(in) :: viscref
564 real(DP),
intent(in) :: a2, a3, a4
565 integer(I4B),
intent(in) :: locvisc
566 integer(I4B),
dimension(:),
intent(in) :: locconc
567 integer(I4B),
dimension(:),
intent(in) :: ivisc
568 real(DP),
dimension(:),
intent(in) :: visc
569 real(DP),
dimension(:),
intent(in) :: elev
570 real(DP),
dimension(:),
intent(in) :: dviscdc
571 real(DP),
dimension(:),
intent(in) :: cviscref
572 real(DP),
dimension(:),
intent(inout) :: ctemp
579 select type (packobj)
581 do n = 1, packobj%nbound
584 node = packobj%nodelist(n)
587 if (packobj%ibound(node) <= 0) cycle
593 cviscref, ctemp, ivisc, a2, a3, a4, &
610 subroutine vsc_ad_maw(packobj, visc, viscref, elev, locvisc, locconc, &
611 dviscdc, cviscref, ivisc, a2, a3, a4, ctemp)
615 class(
bndtype),
pointer :: packobj
617 real(DP),
intent(in) :: viscref
618 real(DP),
intent(in) :: a2, a3, a4
619 integer(I4B),
intent(in) :: locvisc
620 integer(I4B),
dimension(:),
intent(in) :: locconc
621 integer(I4B),
dimension(:),
intent(in) :: ivisc
622 real(DP),
dimension(:),
intent(in) :: visc
623 real(DP),
dimension(:),
intent(in) :: elev
624 real(DP),
dimension(:),
intent(in) :: dviscdc
625 real(DP),
dimension(:),
intent(in) :: cviscref
626 real(DP),
dimension(:),
intent(inout) :: ctemp
633 select type (packobj)
635 do n = 1, packobj%nbound
638 node = packobj%nodelist(n)
641 if (packobj%ibound(node) <= 0) cycle
647 cviscref, ctemp, ivisc, a2, a3, a4, &
663 real(dp),
intent(in) :: viscref
664 real(dp),
intent(in) :: bndvisc
666 real(dp) :: viscratio
668 viscratio = viscref / bndvisc
680 ctemp, ivisc, a2, a3, a4, auxvar)
result(viscbnd)
683 integer(I4B),
intent(in) :: n
684 integer(I4B),
intent(in) :: locvisc
685 real(dp),
intent(in) :: a2, a3, a4
686 integer(I4B),
dimension(:),
intent(in) :: ivisc
687 integer(I4B),
dimension(:),
intent(in) :: locconc
688 real(dp),
intent(in) :: viscref
689 real(dp),
dimension(:),
intent(in) :: dviscdc
690 real(dp),
dimension(:),
intent(in) :: cviscref
691 real(dp),
dimension(:),
intent(inout) :: ctemp
692 real(dp),
dimension(:, :),
intent(in) :: auxvar
699 if (locvisc > 0)
then
701 viscbnd = auxvar(locvisc, n)
702 else if (locconc(1) > 0)
then
704 do i = 1,
size(locconc)
706 if (locconc(i) > 0)
then
707 ctemp(i) = auxvar(locconc(i), n)
710 viscbnd =
calc_visc(ivisc, viscref, dviscdc, cviscref, ctemp, a2, a3, a4)
729 integer(I4B),
intent(in) :: n, m
730 real(DP),
intent(in) :: gwhdn, gwhdm
731 real(DP),
intent(inout) :: viscratio
733 integer(I4B) :: cellid
736 if (gwhdm > gwhdn)
then
738 else if (gwhdn >= gwhdm)
then
741 call this%calc_q_visc(cellid, viscratio)
753 integer(I4B),
intent(in) :: cellid
755 real(DP),
intent(inout) :: viscratio
760 visc = this%visc(cellid)
778 real(DP) :: viscratio
783 do n = 1, this%dis%nodes
784 call this%calc_q_visc(n, viscratio)
785 this%k11(n) = this%k11input(n) * viscratio
786 this%k22(n) = this%k22input(n) * viscratio
787 this%k33(n) = this%k33input(n) * viscratio
788 this%nodekchange(n) = 1
792 call this%vsc_set_changed_at(kper, kstp)
803 integer(I4B),
intent(in) :: kper
804 integer(I4B),
intent(in) :: kstp
806 this%kchangeper = kper
807 this%kchangestp = kstp
817 integer(I4B),
intent(in) :: idvfl
819 character(len=1) :: cdatafmp =
' ', editdesc =
' '
820 integer(I4B) :: ibinun
821 integer(I4B) :: iprint
822 integer(I4B) :: nvaluesp
823 integer(I4B) :: nwidthp
827 if (this%ioutvisc /= 0)
then
832 if (idvfl == 0) ibinun = 0
835 if (ibinun /= 0)
then
840 if (this%ioutvisc /= 0)
then
841 ibinun = this%ioutvisc
842 call this%dis%record_array(this%visc, this%iout, iprint, ibinun, &
843 ' VISCOSITY', cdatafmp, nvaluesp, &
844 nwidthp, editdesc, dinact)
858 if (this%inunit > 0)
then
864 deallocate (this%cmodelname)
865 deallocate (this%cauxspeciesname)
866 deallocate (this%modelconc)
885 nullify (this%k11input)
886 nullify (this%k22input)
887 nullify (this%k33input)
888 nullify (this%kchangeper)
889 nullify (this%kchangestp)
890 nullify (this%nodekchange)
893 call this%NumericalPackageType%da()
908 call mem_set_value(this%nviscspecies,
'NVISCSPECIES', this%input_mempath, &
912 write (this%iout,
'(/1x,a)')
'Processing VSC DIMENSIONS block'
913 write (this%iout,
'(4x,a,i0)')
'NVISCSPECIES = ', this%nviscspecies
914 write (this%iout,
'(1x,a)')
'End of VSC DIMENSIONS block'
917 if (this%nviscspecies < 1)
then
918 call store_error(
'NVISCSPECIES must be greater than zero.')
932 integer(I4B),
dimension(:),
pointer,
contiguous :: iviscspec
934 contiguous :: modelnames, auxspeciesnames
935 real(DP),
dimension(:),
pointer,
contiguous :: dviscdc, cviscref
936 integer(I4B),
dimension(:),
allocatable :: itemp
937 character(len=LINELENGTH) :: modelname, auxspeciesname, line
938 character(len=10) :: c10
939 character(len=16) :: c16
942 character(len=*),
parameter :: fmterr = &
943 "('Invalid value for IRHOSPEC (',i0,') detected in VSC Package. &
944 &IRHOSPEC must be > 0 and <= NVISCSPECIES, and duplicate values &
948 allocate (itemp(this%nviscspecies))
952 call mem_setptr(iviscspec,
'IVISCSPEC', this%input_mempath)
953 call mem_setptr(dviscdc,
'DVISCDC', this%input_mempath)
954 call mem_setptr(cviscref,
'CVISCREF', this%input_mempath)
955 call mem_setptr(modelnames,
'MODELNAME', this%input_mempath)
956 call mem_setptr(auxspeciesnames,
'AUXSPECIESNAME', this%input_mempath)
959 do n = 1,
size(iviscspec)
960 modelname = modelnames(n)
961 auxspeciesname = auxspeciesnames(n)
963 if (iviscspec(n) < 1 .or. iviscspec(n) > this%nviscspecies)
then
964 write (
errmsg, fmterr) iviscspec(n)
967 if (itemp(iviscspec(n)) /= 0)
then
968 write (
errmsg, fmterr) iviscspec(n)
971 itemp(iviscspec(n)) = 1
973 this%dviscdc(iviscspec(n)) = dviscdc(n)
974 this%cviscref(iviscspec(n)) = cviscref(n)
975 this%cmodelname(iviscspec(n)) = trim(modelname)
976 this%cauxspeciesname(iviscspec(n)) = trim(auxspeciesname)
978 if (auxspeciesname == this%name_temp_spec)
then
979 if (this%idxtmpr > 0)
then
980 write (
errmsg,
'(a)')
'More than one species in VSC input identified &
981 &as '//trim(this%name_temp_spec)//
'. Only one species may be &
982 &designated to represent temperature.'
985 this%idxtmpr = iviscspec(n)
986 if (this%thermivisc == 2)
then
987 this%ivisc(iviscspec(n)) = 2
999 write (this%iout,
'(/,1x,a)')
'Processing VSC PACKAGEDATA block'
1002 write (this%iout,
'(1x,a)')
'Summary of species information in VSC Package'
1003 write (this%iout,
'(1a11,5a17)') &
1004 'Species',
'DVISCDC',
'CVISCREF',
'Model',
'AUXSPECIESNAME'
1005 do n = 1, this%nviscspecies
1006 write (c10,
'(i0)') n
1007 line =
' '//adjustr(c10)
1009 write (c16,
'(g15.6)') this%dviscdc(n)
1010 line = trim(line)//
' '//adjustr(c16)
1011 write (c16,
'(g15.6)') this%cviscref(n)
1012 line = trim(line)//
' '//adjustr(c16)
1013 write (c16,
'(a)') this%cmodelname(n)
1014 line = trim(line)//
' '//adjustr(c16)
1015 write (c16,
'(a)') this%cauxspeciesname(n)
1016 line = trim(line)//
' '//adjustr(c16)
1017 write (this%iout,
'(a)') trim(line)
1020 write (this%iout,
'(1x,a)')
'End of VSC PACKAGEDATA block'
1039 integer(I4B) :: ispec
1041 do ispec = 1, this%nviscspecies
1042 this%dviscdc(ispec) = input_data%dviscdc(ispec)
1043 this%cviscref(ispec) = input_data%cviscref(ispec)
1044 this%cmodelname(ispec) = input_data%cmodelname(ispec)
1045 this%cauxspeciesname(ispec) = input_data%cauxspeciesname(ispec)
1063 do n = 1, this%dis%nodes
1064 do i = 1, this%nviscspecies
1065 if (this%modelconc(i)%icbund(n) == 0)
then
1066 this%ctemp(i) = dzero
1068 this%ctemp(i) = this%modelconc(i)%conc(n)
1072 this%visc(n) =
calc_visc(this%ivisc, this%viscref, this%dviscdc, &
1073 this%cviscref, this%ctemp, this%a2, &
1090 call this%NumericalPackageType%allocate_scalars()
1093 call mem_allocate(this%thermivisc,
'THERMIVISC', this%memoryPath)
1094 call mem_allocate(this%idxtmpr,
'IDXTMPR', this%memoryPath)
1095 call mem_allocate(this%ioutvisc,
'IOUTVISC', this%memoryPath)
1096 call mem_allocate(this%ireadelev,
'IREADELEV', this%memoryPath)
1097 call mem_allocate(this%iconcset,
'ICONCSET', this%memoryPath)
1098 call mem_allocate(this%viscref,
'VISCREF', this%memoryPath)
1099 call mem_allocate(this%a2,
'A2', this%memoryPath)
1100 call mem_allocate(this%a3,
'A3', this%memoryPath)
1101 call mem_allocate(this%a4,
'A4', this%memoryPath)
1103 call mem_allocate(this%nviscspecies,
'NVISCSPECIES', this%memoryPath)
1116 this%nviscspecies = 0
1126 integer(I4B),
intent(in) :: nodes
1131 call mem_allocate(this%visc, nodes,
'VISC', this%memoryPath)
1132 call mem_allocate(this%ivisc, this%nviscspecies,
'IVISC', this%memoryPath)
1133 call mem_allocate(this%dviscdc, this%nviscspecies,
'DRHODC', &
1135 call mem_allocate(this%cviscref, this%nviscspecies,
'CRHOREF', &
1137 call mem_allocate(this%ctemp, this%nviscspecies,
'CTEMP', this%memoryPath)
1138 allocate (this%cmodelname(this%nviscspecies))
1139 allocate (this%cauxspeciesname(this%nviscspecies))
1140 allocate (this%modelconc(this%nviscspecies))
1144 this%visc(i) = this%viscref
1148 do i = 1, this%nviscspecies
1150 this%dviscdc(i) = dzero
1151 this%cviscref(i) = dzero
1152 this%ctemp(i) = dzero
1153 this%cmodelname(i) =
''
1154 this%cauxspeciesname(i) =
''
1170 character(len=LENVARNAME),
dimension(2) :: thermal_form = &
1171 &[character(len=LENVARNAME) ::
'LINEAR',
'NONLINEAR']
1179 call mem_set_value(this%viscref,
'VISCREF', this%input_mempath, &
1181 call mem_set_value(viscosityfile,
'VISCOSITYFILE', this%input_mempath, &
1182 found%viscosityfile)
1183 call mem_set_value(this%name_temp_spec,
'TEMP_SPECNAME', this%input_mempath, &
1184 found%temp_specname)
1185 call mem_set_value(this%thermivisc,
'THERMAL_FORM', this%input_mempath, &
1186 thermal_form, found%thermal_form)
1187 call mem_set_value(this%a2,
'THERMAL_A2', this%input_mempath, &
1189 call mem_set_value(this%a3,
'THERMAL_A3', this%input_mempath, &
1191 call mem_set_value(this%a4,
'THERMAL_A4', this%input_mempath, &
1195 if (found%viscosityfile)
then
1197 call openfile(this%ioutvisc, this%iout, viscosityfile,
'DATA(BINARY)', &
1202 if (found%thermal_form)
then
1203 if (this%thermivisc == 0)
then
1204 call store_error(
'Unrecognized input value for THERMAL_FORM option.')
1210 if (this%thermivisc == 1)
then
1211 if (this%a2 == 0.0)
then
1212 write (
errmsg,
'(a)')
'LINEAR option selected for varying &
1213 &viscosity with temperature, but A1, a surrogate for &
1214 &dVISC/dT, set equal to 0.0'
1219 if (this%thermivisc > 1)
then
1220 if (this%a2 == 0)
then
1221 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1222 &varying viscosity with temperature, but A2 set equal to &
1223 &zero which may lead to unintended values for viscosity'
1226 if (this%a3 == 0)
then
1227 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1228 &varying viscosity with temperature,, but A3 set equal to &
1229 &zero which may lead to unintended values for viscosity'
1232 if (this%a4 == 0)
then
1233 write (
warnmsg,
'(a)')
'NONLINEAR option selected for &
1234 &varying viscosity with temperature, BUT A4 SET EQUAL TO &
1235 &zero which may lead to unintended values for viscosity'
1241 call this%log_options(found, viscosityfile)
1252 character(len=*),
intent(in) :: viscosityfile
1255 character(len=*),
parameter :: fmtfileout = &
1256 "(4x, 'VSC', 1x, a, 1x, 'Will be saved to file: ', &
1257 &a, ' opened on unit: ', I7)"
1258 character(len=*),
parameter :: fmtlinear = &
1259 "(4x,'Viscosity will vary linearly with temperature &
1261 character(len=*),
parameter :: fmtnonlinear = &
1262 "(4x,'Viscosity will vary non-linearly with temperature &
1265 write (this%iout,
'(1x,a)')
'Processing VSC OPTIONS block'
1267 if (found%viscref)
then
1268 write (this%iout,
'(4x,a,1pg15.6)') &
1269 'Reference viscosity has been set to: ', this%viscref
1271 if (found%viscosityfile)
then
1272 write (this%iout, fmtfileout) &
1273 'VISCOSITY', trim(viscosityfile), this%ioutvisc
1275 if (found%temp_specname)
then
1276 write (this%iout,
'(4x, a)')
'Temperature species name set to: '// &
1277 trim(this%name_temp_spec)
1279 if (found%thermal_form)
then
1280 select case (this%thermivisc)
1282 write (this%iout, fmtlinear)
1284 write (this%iout, fmtnonlinear)
1287 if (found%thermal_a2)
then
1288 if (this%thermivisc == 2)
then
1289 write (this%iout,
'(4x,a,1pg15.6)') &
1290 'A2 in nonlinear viscosity formulation has been set to: ', &
1293 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A2 specified by user &
1294 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1295 &specified. THERMAL_A2 will not affect ',
'viscosity calculations.'
1298 if (found%thermal_a3)
then
1299 if (this%thermivisc == 2)
then
1300 write (this%iout,
'(4x,a,1pg15.6)') &
1301 'A3 in nonlinear viscosity formulation has been set to: ', &
1304 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A3 specified by user &
1305 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1306 &specified. THERMAL_A3 will not affect ',
'viscosity calculations.'
1309 if (found%thermal_a4)
then
1310 if (this%thermivisc == 2)
then
1311 write (this%iout,
'(4x,a,1pg15.6)') &
1312 'A4 in nonlinear viscosity formulation has been set to: ', &
1315 write (this%iout,
'(4x,a,/,4x,a,/,4x,a)')
'THERMAL_A4 specified by user &
1316 &in VSC Package input file. LINEAR viscosity ',
'formulation also &
1317 &specified. THERMAL_A4 will not affect ',
'viscosity calculations.'
1321 write (this%iout,
'(1x,a)')
'end of VSC options block'
1331 this%viscref = input_data%viscref
1344 character(len=LENMODELNAME),
intent(in) :: modelname
1345 real(DP),
dimension(:),
pointer :: conc
1346 integer(I4B),
dimension(:),
pointer :: icbund
1347 integer(I4B),
optional,
intent(in) :: istmpr
1354 do i = 1, this%nviscspecies
1355 if (this%cmodelname(i) == modelname)
then
1356 this%modelconc(i)%conc => conc
1357 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)
Source VSC options.
subroutine vsc_da(this)
Deallocate viscosity package memory.
subroutine allocate_arrays(this, nodes)
Allocate arrays.
subroutine, public vsc_cr(vscobj, name_model, input_mempath, inunit, iout)
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, drn and riv while accounting for viscosity
subroutine allocate_scalars(this)
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)
source packagedata for package
subroutine vsc_calcvisc(this)
Calculate fluid viscosity.
subroutine vsc_ad(this)
Advance the viscosity package.
subroutine vsc_ot_dv(this, idvfl)
Output viscosity package dependent-variable terms.
real(dp) function calc_bnd_viscosity(n, locvisc, locconc, viscref, dviscdc, cviscref, ctemp, ivisc, a2, a3, a4, auxvar)
Calculate the boundary viscosity.
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)
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)
Source dimensions for package.
subroutine vsc_ar(this, ibound)
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)
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)
log VSC options
subroutine set_concentration_pointer(this, modelname, conc, icbund, istmpr)
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) iout
file unit number for simulation output
character(len=lenmempath), pointer input_mempath
input context mempath for tdis
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 ...