summaryrefslogtreecommitdiff
path: root/539/CH5/EX5.1/Example_5_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '539/CH5/EX5.1/Example_5_1.sce')
-rwxr-xr-x539/CH5/EX5.1/Example_5_1.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/539/CH5/EX5.1/Example_5_1.sce b/539/CH5/EX5.1/Example_5_1.sce
new file mode 100755
index 000000000..dbe95e30c
--- /dev/null
+++ b/539/CH5/EX5.1/Example_5_1.sce
@@ -0,0 +1,19 @@
+//Diffusion Flux Computation
+
+clear;
+clc;
+
+printf("\tExample 5.1\n");
+
+Ca=1.2; //Concentration at A in kg/m^3
+Cb=0.8; //Concentration at B in kg/m^3
+
+xa=5*10^-3; //Position 1 in m
+xb=10*10^-3; //Position 2 in m
+
+D=3*10^-11; //Diffusion coefficient in m^2/s
+
+J=-D*(Ca-Cb)/(xa-xb);
+printf("\nDiffusion flux is %.1f * 10^-9 kg/m^2-s",J/10^-9);
+
+//End \ No newline at end of file