00001
00002
00003
00004
00005
00006
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <math.h>
00010 #include "carbmat1.h"
00011 #include "globalt.h"
00012
00013 carbmat1::carbmat1(){
00014 global_variable = 3;
00015 }
00016
00017 carbmat1::~carbmat1(){
00018
00019 }
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 void carbmat1::matcond (matrix &d,long ri,long ci,long ipp)
00033 {
00034 long n;
00035 n = d.n;
00036
00037 switch (n){
00038 case 1:{
00039 matcond1d (d,ri,ci,ipp);
00040 break;
00041 }
00042 case 2:{
00043 matcond2d (d,ri,ci,ipp);
00044 break;
00045 }
00046 case 3:{
00047 matcond3d (d,ri,ci,ipp);
00048 break;
00049 }
00050 default:{
00051 print_err("unknown number of components of conductivity tensor is required",__FILE__,__LINE__,__func__);
00052 }
00053 }
00054 }
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 void carbmat1::matcond1d (matrix &d,long ri,long ci,long ipp)
00066 {
00067 double kk;
00068
00069 kk = get_conductivity();
00070
00071 fillm(0.0,d);
00072
00073 d[0][0] = kk;
00074 }
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 void carbmat1::matcond2d (matrix &d,long ri,long ci,long ipp)
00085 {
00086 double kk;
00087
00088 kk = get_conductivity();
00089
00090 fillm(0.0,d);
00091
00092 d[0][0] = kk; d[0][1] = 0.0;
00093 d[1][0] = 0.0; d[1][1] = kk;
00094 }
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 void carbmat1::matcond3d (matrix &d,long ri,long ci,long ipp)
00106 {
00107 double kk;
00108
00109 kk = get_conductivity();
00110
00111 fillm(0.0,d);
00112
00113 d[0][0]=kk; d[0][1]=0.0; d[0][2]=0.0;
00114 d[1][0]=0.0; d[1][1]=kk; d[1][2]=0.0;
00115 d[2][0]=0.0; d[2][1]=0.0; d[2][2]=kk;
00116 }
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 void carbmat1::matcap (double &cc,long ri,long ci,long ipp)
00128 {
00129 cc = 0.0;
00130 }
00131
00132
00133
00134
00135
00136
00137 void carbmat1::read(XFILE *in){
00138 xfscanf (in,"%lf", ¶m);
00139 }
00140
00141
00142
00143
00144
00145
00146
00147 double carbmat1::Equivalent_diffusion(double A)
00148 {
00149 double K_CO2 = 1.e-12;
00150 double K_Cracked;
00151
00152 K_Cracked = A * K_CO2 * global_variable;
00153
00154 return K_Cracked;
00155 }
00156
00157
00158 double carbmat1::get_conductivity(void){
00159 return param;
00160 }