1 | /*
|
---|
2 | * Diffusion Class
|
---|
3 | *
|
---|
4 | *
|
---|
5 | * Author: Dr Michael Thomas Flanagan.
|
---|
6 | *
|
---|
7 | * Created: february 2010
|
---|
8 | * Updated:
|
---|
9 | *
|
---|
10 | * DOCUMENTATION:
|
---|
11 | * See Michael Thomas Flanagan's Java library on-line web page:
|
---|
12 | * http://www.ee.ucl.ac.uk/~mflanaga/java/Diffusion.html
|
---|
13 | * http://www.ee.ucl.ac.uk/~mflanaga/java/
|
---|
14 | *
|
---|
15 | * Copyright (c) 2010 Michael Thomas Flanagan
|
---|
16 | *
|
---|
17 | * PERMISSION TO COPY:
|
---|
18 | * Permission to use, copy and modify this software and its documentation for
|
---|
19 | * NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement
|
---|
20 | * to the author, Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies.
|
---|
21 | *
|
---|
22 | * Dr Michael Thomas Flanagan makes no representations about the suitability
|
---|
23 | * or fitness of the software for any or for a particular purpose.
|
---|
24 | * Michael Thomas Flanagan shall not be liable for any damages suffered
|
---|
25 | * as a result of using, modifying or distributing this software or its derivatives.
|
---|
26 | *
|
---|
27 | ***************************************************************************************/
|
---|
28 |
|
---|
29 | package agents.anac.y2015.agentBuyogV2.flanagan.physprop;
|
---|
30 |
|
---|
31 | import agents.anac.y2015.agentBuyogV2.flanagan.analysis.Stat;
|
---|
32 | import agents.anac.y2015.agentBuyogV2.flanagan.math.Fmath;
|
---|
33 |
|
---|
34 | public class Diffusion{
|
---|
35 |
|
---|
36 |
|
---|
37 | // METHODS
|
---|
38 |
|
---|
39 |
|
---|
40 | // Returns the diffusion coefficient (m^2 s^-1)of a solute assuming a spherical solute
|
---|
41 | // molecularWeight Molecular weight of the solute(Daltons)
|
---|
42 | // specificVolume Specific volume (m^3 kg^-1)
|
---|
43 | // viscosity Solution viscosity (Pa s)
|
---|
44 | // concentration Solute concentration (Molar)
|
---|
45 | // temperature Temperature (degree Celsius)
|
---|
46 | public static double diffusionCoefficient(double molecularWeight, double specificVolume, double viscosity, double concentration, double temperature){
|
---|
47 |
|
---|
48 | double tempK = temperature - Fmath.T_ABS;
|
---|
49 | double molecularVolume = molecularWeight*specificVolume/(Fmath.N_AVAGADRO*1000.0);
|
---|
50 | double molecularRadius = Math.pow(3.0*molecularVolume/(4.0*Math.PI),1.0/3.0);
|
---|
51 | double fTerm = 6.0*Math.PI*viscosity*molecularRadius;
|
---|
52 | return Fmath.K_BOLTZMANN*tempK/fTerm;
|
---|
53 | }
|
---|
54 |
|
---|
55 | // Returns the number of molecules per square metre in an hexagonally closed-packed monolayer
|
---|
56 | // molecularWeight Molecular weight of the solute(Daltons)
|
---|
57 | // specificVolume Specific volume (m^3 kg^-1)
|
---|
58 | public static double planarHexagonalNumberPerSquareMetre(double molecularWeight, double specificVolume){
|
---|
59 |
|
---|
60 | double molecularVolume = molecularWeight*specificVolume/(Fmath.N_AVAGADRO*1000.0);
|
---|
61 | double molecularRadius = Math.pow(3.0*molecularVolume/(4.0*Math.PI),1.0/3.0);
|
---|
62 |
|
---|
63 | return 2.0/(3.0*Math.sqrt(3.0)*molecularRadius*molecularRadius);
|
---|
64 | }
|
---|
65 |
|
---|
66 | // Returns the moles per square metre in an hexagonally closed-packed monolayer
|
---|
67 | // molecularWeight Molecular weight of the solute(Daltons)
|
---|
68 | // specificVolume Specific volume (m^3 kg^-1)
|
---|
69 | public static double planarHexagonalMolesPerSquareMetre(double molecularWeight, double specificVolume){
|
---|
70 |
|
---|
71 | double molecularVolume = molecularWeight*specificVolume/(Fmath.N_AVAGADRO*1000.0);
|
---|
72 | double molecularRadius = Math.pow(3.0*molecularVolume/(4.0*Math.PI),1.0/3.0);
|
---|
73 |
|
---|
74 | return 2.0/(3.0*Math.sqrt(3.0)*molecularRadius*molecularRadius*Fmath.N_AVAGADRO);
|
---|
75 | }
|
---|
76 |
|
---|
77 | // Returns the concentration at a distance x from a boundary at time t assuming:
|
---|
78 | // one dimensional difussion
|
---|
79 | // an unchanging concentration at the boundary
|
---|
80 | // zero concentration elsewhere at time zero
|
---|
81 | // diffusionCoefficient Diffusion coefficient (m^2 s^-1)
|
---|
82 | // ZeroDistanceConcentration Concentration at the boundary [x = 0]
|
---|
83 | // distance Distance, x, from the boundary [x = 0] (m)
|
---|
84 | // time Time (s)
|
---|
85 | public static double oneDimensionalDiffusion(double diffusionCoefficient, double ZeroDistanceConcentration, double distance, double time){
|
---|
86 |
|
---|
87 | double arg = distance/(2.0*Math.sqrt(diffusionCoefficient*time));
|
---|
88 | return ZeroDistanceConcentration*Stat.erfc(arg);
|
---|
89 | }
|
---|
90 |
|
---|
91 | }
|
---|