MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
freundlichisothermmodule Module Reference

Data Types

interface  freundlichisothermtype
 Freundlich isotherm implementation of IsothermType. More...

Functions/Subroutines

type(freundlichisothermtype) function constructor (kf, a)
 Constructor for Freundlich isotherm.
real(dp) function value (this, c, n)
 Evaluate the isotherm at a given node.
real(dp) function derivative (this, c, n)
 Evaluate derivative of the isotherm at a given node.

Function/Subroutine Documentation

◆ constructor()

type(freundlichisothermtype) function freundlichisothermmodule::constructor ( real(dp), dimension(:), intent(in), pointer kf,
real(dp), dimension(:), intent(in), pointer a )
private

Definition at line 39 of file FreundlichIsotherm.f90.

40 type(FreundlichIsothermType) :: isotherm
41 ! -- dummy
42 real(DP), pointer, dimension(:), intent(in) :: Kf
43 real(DP), pointer, dimension(:), intent(in) :: a
44 ! -- local
45 isotherm%Kf => kf
46 isotherm%a => a
47
Here is the caller graph for this function:

◆ derivative()

real(dp) function freundlichisothermmodule::derivative ( class(freundlichisothermtype), intent(in) this,
real(dp), dimension(:), intent(in) c,
integer(i4b), intent(in) n )
private
Returns
derivative d(value)/dc evaluated at c
Parameters
[in]cconcentration array
[in]nnode index

Definition at line 73 of file FreundlichIsotherm.f90.

74 ! -- return
75 real(DP) :: derv !< derivative d(value)/dc evaluated at c
76 ! -- dummy
77 class(FreundlichIsothermType), intent(in) :: this
78 real(DP), dimension(:), intent(in) :: c !< concentration array
79 integer(I4B), intent(in) :: n !< node index
80 real(DP), parameter :: K = 10.0_dp !< constant to limit derivative at c=0
81 real(DP) :: eps !< small concentration offset
82
83 eps = (k / (this%a(n) * this%Kf(n)))**(1.0_dp / (this%a(n) - 1.0_dp))
84
85 if (c(n) > dzero) then
86 derv = this%a(n) * this%Kf(n) * ((c(n) + eps)**(this%a(n) - 1.0_dp))
87 else
88 derv = 0.0_dp
89 end if

◆ value()

real(dp) function freundlichisothermmodule::value ( class(freundlichisothermtype), intent(in) this,
real(dp), dimension(:), intent(in) c,
integer(i4b), intent(in) n )
private
Returns
isotherm value
Parameters
[in]cconcentration array
[in]nnode index

Definition at line 52 of file FreundlichIsotherm.f90.

53 ! -- return
54 real(DP) :: val !< isotherm value
55 ! -- dummy
56 class(FreundlichIsothermType), intent(in) :: this
57 real(DP), dimension(:), intent(in) :: c !< concentration array
58 integer(I4B), intent(in) :: n !< node index
59 real(DP), parameter :: K = 10.0_dp !< constant to limit derivative at c=0
60 real(DP) :: eps !< small concentration offset
61
62 eps = (k / (this%a(n) * this%Kf(n)))**(1.0_dp / (this%a(n) - 1.0_dp))
63
64 if (c(n) > dzero) then
65 val = this%Kf(n) * (c(n) + eps)**this%a(n) - this%Kf(n) * eps**this%a(n)
66 else
67 val = 0.0_dp
68 end if