diffusion_solid
Diffusion in solids (Fick's second law, constant D): Arrhenius diffusivity from D0 and Q (or from D at two temperatures), constant-surface (erfc) and thin-film (Gaussian) profiles in a half-space, finite slab by Fourier series, depth for a target concentration, equivalent time at another temperature, homogenisation time; profile csv. erf/erfc computed in-house (series + continued fraction).
- Field
- Materials and crystals
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.05 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001erfc profile at z = 0.5: erf(0.5) = 0.5204998778 (Abramowitz & Stegun Table 7.1), C = Cs - (Cs - C0) erf(z); halfway depth z = erfinv(0.5) = 0.4769362762; closed form, rel 1e-9passed
characteristic_depth_m0.001 ± 1e-150.001lockedunder 0.01 % of the tolerance usederf_z_probe0.5205 ± 5.2e-100.5205lockedunder 0.01 % of the tolerance usedc_at_probe0.4877 ± 4.9e-100.4877lockedunder 0.01 % of the tolerance usedz_for_target0.476936 ± 4.8e-100.476936lockedunder 0.01 % of the tolerance useddepth_for_target_m0.000476936 ± 4.8e-130.000476936lockedunder 0.01 % of the tolerance usedr0002erfc profile at z = 1: erf(1) = 0.8427007929, erfc(1) = 0.1572992071 (Abramowitz & Stegun Table 7.1); closed form, rel 1e-9passed
erf_z_probe0.842701 ± 8.4e-100.842701lockedunder 0.01 % of the tolerance usederfc_z_probe0.157299 ± 1.6e-100.157299lockedunder 0.01 % of the tolerance usedc_at_probe0.29438 ± 2.9e-100.29438lockedunder 0.01 % of the tolerance usedr0003depth grows as sqrt(t): halfway depth at t is 0.4769363 x 2 sqrt(Dt), so twice that depth is reached at exactly 4 t = 40000 s; closed form, rel 1e-9 (probe given to 15 digits)passed
time_for_target_at_probe_s40000 ± 4e-0540000lockedunder 0.01 % of the tolerance usedr0004Arrhenius from two points: D = 1e-14 at 1000 K and 1e-12 at 1250 K give Q = R ln(100) / (1/1000 - 1/1250) = 191.4475768 kJ/mol and D0 = 1e-14 x 100^5 = 1e-4 m^2/s; equivalent time at 1250 K = t / 100; R = k_B N_A (CODATA exact); closed form, rel 1e-9passed
gas_constant_J_per_mol_K8.31446 ± 8.3e-128.31446lockedunder 0.01 % of the tolerance usedq_kJ_per_mol191.448 ± 1.9e-07191.448lockedunder 0.01 % of the tolerance usedd0_m2_s0.0001 ± 1e-130.0001lockedunder 0.01 % of the tolerance useddiffusivity_m2_s1e-14 ± 1e-231e-14lockedunder 0.01 % of the tolerance useddiffusivity2_m2_s1e-12 ± 1e-211e-12lockedunder 0.01 % of the tolerance usedtime_equivalent_s36 ± 3.6e-0836lockedunder 0.01 % of the tolerance usedr0005Arrhenius forward: D0 = 1e-4 m^2/s, Q = 191.4475768 kJ/mol at 1000 K gives D = 1e-14 m^2/s (inverse of the two-point case); closed form, rel 1e-9passed
diffusivity_m2_s1e-14 ± 1e-231e-14lockedunder 0.01 % of the tolerance useddiffusion_length_m6e-06 ± 6e-156e-06lockedunder 0.01 % of the tolerance usedr0006thin film (Crank eq. 3.4, surface film): peak M / sqrt(pi D t) = 2e-3 / sqrt(pi); C = peak/e at depth 2 sqrt(Dt) = 1 mm; mass conserved (integral = 1, Simpson to z = 7, rel 1e-9); sinusoidal segregation tau = lambda^2 / (4 pi^2 D), homogenisation to 1 % = tau ln 100; closed form, rel 1e-9passed
film_peak_c0.00112838 ± 1.1e-120.00112838lockedunder 0.01 % of the tolerance useddepth_for_target_m0.001 ± 1e-120.001lockedunder 0.01 % of the tolerance usedfilm_mass_fraction_in_profile1 ± 1e-091lockedunder 0.01 % of the tolerance usedsegregation_relaxation_time_s10.1321 ± 1e-0810.1321lockedunder 0.01 % of the tolerance usedhomogenisation_time_s46.6601 ± 4.7e-0846.6601lockedunder 0.01 % of the tolerance usedr0007slab Fourier series (Crank eq. 4.17) at Fo = 1e-4 matches the half-space at early times: C(z = 1) = erfc(1) = 0.1572992071, mean uptake = 4 sqrt(Fo / pi) = 0.0225675833; 99 % of the mean at Fo = ln(800 / pi^2) / pi^2 = 0.4453220 (first term; the next is below 1e-16); image terms below erfc(49), rel 1e-8passed
slab_method= fourier_seriesfourier_serieslockedexact matchslab_fourier_number0.0001 ± 1e-160.0001locked0.014 % of the tolerance usedc_at_probe0.157299 ± 1.6e-090.157299lockedunder 0.01 % of the tolerance usedslab_mean_fraction0.0225676 ± 2.3e-100.0225676lockedunder 0.01 % of the tolerance usedslab_fourier_number_to_fraction0.445322 ± 4.5e-100.445322lockedunder 0.01 % of the tolerance usedslab_time_to_fraction_s4.45322e+07 ± 0.0454.45322e+07lockedunder 0.01 % of the tolerance used
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
source | constant_surface | constant_surface: half-space, surface held at c_surface (erfc). thin_film: a dose film_dose on (or buried in) the surface (Gaussian). slab: thickness slab_thickness_m, both faces held at c_surface (Fourier series). | |
temperature_K | K | 1200 | Temperature of the treatment. |
time_s | s | 3600 | Time at temperature_K. |
d0_m2_s | m^2/s | 2.3e-05 | Arrhenius pre-factor D0 (from your own data source). Ignored when d_at_t1_m2_s and d_at_t2_m2_s are given. |
q_kJ_per_mol | kJ/mol | 148 | Activation energy Q (from your own data source). 0 makes D = D0 at every temperature. |
temperature2_K | K | Second temperature: gives D there and the time with the same D t (equivalent time); with d_at_t2_m2_s, the temperature of that measurement. | |
d_at_t1_m2_s | m^2/s | Measured D at temperature_K. With d_at_t2_m2_s, D0 and Q are derived from the two points. | |
d_at_t2_m2_s | m^2/s | Measured D at temperature2_K. | |
c_surface | 1 | 1.0 | Surface concentration Cs (any unit; every concentration in the same unit). |
c_initial | 1 | 0.0 | Initial uniform concentration C0. |
c_target | 1 | Concentration whose depth is wanted. | |
probe_depth_m | m | 0 | Depth at which the concentration is read; with c_target (constant_surface), the time for c_target to reach this depth. |
film_dose | m | 1e-06 | thin_film: amount per area, concentration unit times metre. |
film_buried | false | thin_film: true for a film inside the body (spreads both ways, half the dose on each side). | |
slab_thickness_m | m | 0.01 | slab: thickness L. |
slab_target_fraction | 1 | 0.99 | slab: fraction of the way from C0 to Cs the mean must reach (homogenisation of the slab). |
segregation_wavelength_m | m | Wavelength of a sinusoidal segregation (dendrite arm spacing): gives its relaxation and homogenisation times. | |
residual_fraction | 1 | 0.01 | Segregation amplitude left at the homogenisation time, as a fraction of the start. |
depth_max_m | m | Depth of the profile csv (default 4 x 2 sqrt(D t); slab: the thickness). | |
points | 1 | 201 | Points in the profile csv. |
Readings
| Name | Unit | Meaning |
|---|---|---|
source | which source was solved | |
arrhenius_from | inputs or two_points | |
gas_constant_J_per_mol_K | J/(mol K) | |
d0_m2_s | m^2/s | |
q_kJ_per_mol | kJ/mol | |
diffusivity_m2_s | m^2/s | |
diffusion_length_m | m | sqrt(D t) |
characteristic_depth_m | m | 2 sqrt(D t) |
z_probe | 1 | probe_depth_m / (2 sqrt(D t)) |
erf_z_probe | 1 | |
erfc_z_probe | 1 | |
c_at_probe | 1 | |
depth_for_target_m | m | |
z_for_target | 1 | |
time_for_target_at_probe_s | s | |
diffusivity2_m2_s | m^2/s | |
time_equivalent_s | s | time at temperature2_K with the same D t |
segregation_relaxation_time_s | s | lambda^2 / (4 pi^2 D) |
segregation_remaining_fraction | 1 | |
homogenisation_time_s | s | |
uptake_per_area | m | constant_surface: 2 (Cs - C0) sqrt(D t / pi), concentration unit times metre |
surface_flux | m/s | constant_surface: (Cs - C0) sqrt(D / (pi t)), concentration unit times m/s |
film_peak_c | 1 | |
film_mass_fraction_in_profile | 1 | |
slab_fourier_number | 1 | |
slab_method | fourier_series or image_sum | |
slab_terms | 1 | |
slab_centre_c | 1 | |
slab_mean_c | 1 | |
slab_centre_fraction | 1 | |
slab_mean_fraction | 1 | |
slab_fourier_number_to_fraction | 1 | |
slab_time_to_fraction_s | s | |
profile_depth_max_m | m | |
profile_points | 1 | |
all_ok | true when there are no warnings | |
warnings | list of warnings |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.