polykin.transport.diffusion¤
profile_sphere ¤
profile_sphere(
t: float, r: float, a: float, D: float
) -> float
Concentration profile for transient diffusion in a sphere.
For a sphere of radius \(a\), where the concentration is initially \(C_0\) everywhere, and the surface concentration is maintained at \(C_s\), the normalized concentration is:
where \(r\) is the radial distance from the center of the sphere, \(t\) is the time, and \(D\) is the diffusion coefficient.
References
- J. Crank, "The mathematics of diffusion", Oxford University Press, 1975, p. 91.
PARAMETER | DESCRIPTION |
---|---|
t
|
Time (s).
TYPE:
|
r
|
Radial distance from center of sphere (m).
TYPE:
|
a
|
Radius of sphere (m).
TYPE:
|
D
|
Diffusion coefficient (m²/s).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Normalized concentration. |
See also
uptake_sphere
: related method to determine the mass uptake.
Examples:
Determine the fractional concentration change after 100 s at the center of a polymer sphere with a radius of 0.2 mm and a diffusivity of 1e-10 m²/s.
>>> from polykin.transport.diffusion import profile_sphere
>>> profile_sphere(t=100., r=0., a=0.2e-3, D=1e-10)
0.8304935009764247
Source code in src/polykin/transport/diffusion.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
Graphical Illustration¤
The numbers in the legend are values of \(D t / a^2\).