[3] | 1 | /* aer: production of aerosol precursors by photochemistry */ |
---|
| 2 | |
---|
| 3 | #include "titan.h" |
---|
| 4 | |
---|
| 5 | void aer( char corps[][10], double *tp, double *nb, double y[][NLEV], |
---|
| 6 | int *zj, double **k_dep, double **f, |
---|
| 7 | double *r1, double *r2, double *r3, double *r4, double *r5, double *r6, |
---|
| 8 | int *utilaer, double *m, double *prod, double *csn, double *csh ) |
---|
| 9 | { |
---|
| 10 | int re,x,z; |
---|
| 11 | int i,j,c2h2,c2,c2h,hc3n,c3n,c4h2,hcn,h2cn,c4h3,ac6h5,ac6h6; |
---|
| 12 | int nccn,ch3cn,c2h3cn,NMAX; |
---|
| 13 | double v1,v2,v3,alpha,beta1,beta2,gamma,denom; |
---|
| 14 | double temp,ct,dy_c2h2,dy_hc3n,dy_hcn; |
---|
| 15 | double dy_nccn,dy_ch3cn,dy_c2h3cn; |
---|
| 16 | char sor1[20],sor2[20],sor3[20],outlog[10]; |
---|
| 17 | FILE *fp, *out; |
---|
| 18 | |
---|
| 19 | NMAX = 20; |
---|
| 20 | z = (*zj); |
---|
| 21 | temp = tp[z]; |
---|
| 22 | ct = nb[z]; |
---|
| 23 | |
---|
| 24 | /* debug |
---|
| 25 | out = fopen( "aer.log", "a" ); |
---|
| 26 | fprintf( out, "" ); |
---|
| 27 | fclose( out ); |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | /* composes interessants */ |
---|
| 31 | /* --------------------- */ |
---|
| 32 | /* !! decalage de 1 par rapport a calchim !! */ |
---|
| 33 | |
---|
| 34 | c2h2 = utilaer[2]; |
---|
| 35 | c2 = utilaer[3]; |
---|
| 36 | c2h = utilaer[4]; |
---|
| 37 | hc3n = utilaer[5]; |
---|
| 38 | hcn = utilaer[6]; |
---|
| 39 | c3n = utilaer[7]; |
---|
| 40 | h2cn = utilaer[8]; |
---|
| 41 | c4h2 = utilaer[9]; |
---|
| 42 | c4h3 = utilaer[10]; |
---|
| 43 | ac6h5 = utilaer[11]; |
---|
| 44 | ac6h6 = utilaer[12]; |
---|
| 45 | nccn = utilaer[13]; |
---|
| 46 | ch3cn = utilaer[14]; |
---|
| 47 | c2h3cn = utilaer[15]; |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | /* si C2H3CN n'est pas pris en compte: attribue a CH3CN, mais reaction nulle */ |
---|
| 51 | |
---|
| 52 | /* vitesses de reactions */ |
---|
| 53 | /* --------------------- */ |
---|
| 54 | |
---|
| 55 | /* v (et K) en cm3.s-1 */ |
---|
| 56 | v1 = 2.e-16; |
---|
| 57 | v2 = 3.72e-13*exp(-1561./temp); |
---|
| 58 | v3 = 1.0e-12*exp(-900./temp); |
---|
| 59 | |
---|
| 60 | alpha = 6.; |
---|
| 61 | beta1 = 1.; |
---|
| 62 | beta2 = 1.; |
---|
| 63 | gamma = 1.; |
---|
| 64 | |
---|
| 65 | /* k en s-1 */ |
---|
| 66 | k_dep[1][1] = v1 *ct*y[c2h2][z]*y[c4h3][z]; /* C2H2 + C4H3 */ |
---|
| 67 | k_dep[2][1] = v1 *ct*y[hc3n][z]*y[c4h3][z] *alpha; /* HC3N + C4H3 */ |
---|
| 68 | for( i = 3; i <= 5; i++ ) k_dep[i][1] = 0.; |
---|
| 69 | |
---|
| 70 | k_dep[1][2] = v2 *ct*y[c2h2][z]*y[ac6h5][z]; /* C2H2 + AC6H5 */ |
---|
| 71 | k_dep[2][2] = v2 *ct* y[hcn][z]*y[ac6h5][z]*beta1; /* HCN + AC6H5 */ |
---|
| 72 | k_dep[3][2] = v2 *ct*y[hc3n][z]*y[ac6h5][z]*beta2; /* HC3N + AC6H5 */ |
---|
| 73 | /* for( i = 4; i <= 5; i++ ) k_dep[i][2] = 0.; */ |
---|
| 74 | k_dep[4][2] = 5.2e-10 *ct* y[c2][z]*y[ac6h6][z]; /* C2 + AC6H6 */ |
---|
| 75 | k_dep[5][2] = 8.2e-11 *ct*y[c2h][z]*y[ac6h6][z]; /* C2H + AC6H6 */ |
---|
| 76 | |
---|
| 77 | k_dep[1][3] = v3 *ct* y[hcn][z]*y[h2cn][z]; /* HCNH + HCN */ |
---|
| 78 | /* !! debug !! |
---|
| 79 | k_dep[2][3] = v3 *ct*y[hc3n][z]*y[h2cn][z]*gamma; HCNH + HC3N */ |
---|
| 80 | k_dep[2][3] = v3 *ct*y[hc3n][z]*y[h2cn][z]*1.e-10; /* HCNH + HC3N */ |
---|
| 81 | k_dep[3][3] = v3 *ct*y[nccn][z]*y[h2cn][z]*gamma; /* HCNH + NCCN */ |
---|
| 82 | k_dep[4][3] = v3 *ct*y[ch3cn][z]*y[h2cn][z]*gamma; /* HCNH + CH3CN */ |
---|
| 83 | if(c2h3cn!=ch3cn) |
---|
| 84 | k_dep[5][3] = v3*ct*y[c2h3cn][z]*y[h2cn][z]*gamma; /* HCNH + C2H3CN */ |
---|
| 85 | else |
---|
| 86 | k_dep[5][3] = 0.; |
---|
| 87 | |
---|
| 88 | /* Fractions de chaque compose dans les polymeres */ |
---|
| 89 | /* ---------------------------------------------- */ |
---|
| 90 | |
---|
| 91 | /* polyC2H2 */ |
---|
| 92 | |
---|
| 93 | denom = y[c2h2][z] + alpha*y[hc3n][z]; |
---|
| 94 | f[1][1] = y[c2h2][z] / denom; /* C2H2 */ |
---|
| 95 | f[2][1] = alpha*y[hc3n][z] / denom; /* HC3N */ |
---|
| 96 | for( i = 3; i <= 5; i++ ) f[i][1] = 0.; |
---|
| 97 | |
---|
| 98 | /* PAHs */ |
---|
| 99 | |
---|
| 100 | denom = y[c2h2][z] + beta1*y[hcn][z] + beta2*y[hc3n][z]; |
---|
| 101 | f[1][2] = y[c2h2][z] / denom; /* C2H2 */ |
---|
| 102 | f[2][2] = beta1*y[hcn][z] / denom; /* HCN */ |
---|
| 103 | f[3][2] = beta2*y[hc3n][z] / denom; /* HC3N */ |
---|
| 104 | for( i = 4; i <= 5; i++ ) f[i][2] = 0.; |
---|
| 105 | |
---|
| 106 | /* polyHCN */ |
---|
| 107 | |
---|
| 108 | if(c2h3cn!=ch3cn) |
---|
| 109 | denom = y[hcn][z] + gamma*(y[hc3n][z]+y[nccn][z]+y[ch3cn][z]+y[c2h3cn][z]); |
---|
| 110 | else |
---|
| 111 | denom = y[hcn][z] + gamma*(y[hc3n][z]+y[nccn][z]+y[ch3cn][z]); |
---|
| 112 | f[1][3] = y[hcn][z] / denom; /* HCN */ |
---|
| 113 | f[2][3] = gamma* y[hc3n][z] / denom; /* HC3N */ |
---|
| 114 | f[3][3] = gamma* y[nccn][z] / denom; /* NCCN */ |
---|
| 115 | f[4][3] = gamma* y[ch3cn][z] / denom; /* CH3CN */ |
---|
| 116 | if(c2h3cn!=ch3cn) |
---|
| 117 | f[5][3] = gamma*y[c2h3cn][z] / denom; /* C2H3CN */ |
---|
| 118 | else |
---|
| 119 | f[5][3] = 0.; /* C2H3CN */ |
---|
| 120 | |
---|
| 121 | /* Masse molaire et Rapports C/N et C/H */ |
---|
| 122 | /* Taux de production en masse */ |
---|
| 123 | /* Taux de destruction molecules */ |
---|
| 124 | /* ------------------------------------ */ |
---|
| 125 | |
---|
| 126 | /* polyC2H2 */ |
---|
| 127 | |
---|
| 128 | m[1] = NMAX*(f[1][1]*26 + f[2][1]*51); /* g.mol-1 */ |
---|
| 129 | |
---|
| 130 | prod[1] = 0.; |
---|
| 131 | for( i = 1; i <= 5; i++ ) prod[1] += k_dep[i][1]; /* s-1 */ |
---|
| 132 | |
---|
| 133 | dy_c2h2 = prod[1] * NMAX * f[1][1]; |
---|
| 134 | dy_hc3n = prod[1] * NMAX * f[2][1]; |
---|
| 135 | |
---|
| 136 | if( f[2][1] != 0.0e0 ) csn[1] = (2*f[1][1] + 3*f[2][1]) / f[2][1]; |
---|
| 137 | else csn[1] = 1.0e30; |
---|
| 138 | csh[1] = (2*f[1][1] + 3*f[2][1]) / (2*f[1][1] + f[2][1]); |
---|
| 139 | |
---|
| 140 | /* PAHs */ |
---|
| 141 | |
---|
| 142 | m[2] = NMAX*(f[1][2]*26 + f[2][2]*27 + f[3][2]*51); /* g.mol-1 */ |
---|
| 143 | |
---|
| 144 | prod[2] = 0.; |
---|
| 145 | for( i = 1; i <= 5; i++ ) prod[2] += k_dep[i][2]; /* s-1 */ |
---|
| 146 | |
---|
| 147 | dy_c2h2 += prod[2] * NMAX * f[1][2]; |
---|
| 148 | dy_hcn = prod[2] * NMAX * f[2][2]; |
---|
| 149 | dy_hc3n += prod[2] * NMAX * f[3][2]; |
---|
| 150 | |
---|
| 151 | if( (f[2][2]+f[3][2]) != 0.0e0 ) |
---|
| 152 | csn[2] = (2*f[1][2] + f[2][2]+ 3*f[3][2]) / (f[2][2] + f[3][2]); |
---|
| 153 | else csn[2] = 1.0e30; |
---|
| 154 | csh[2] = 1.; /* probleme du nombre exact de H */ |
---|
| 155 | |
---|
| 156 | /* polyHCN */ |
---|
| 157 | |
---|
| 158 | m[3] = NMAX*(f[1][3]*27+f[2][3]*51+f[3][3]*52+f[4][3]*41+f[5][3]*53); /* g.mol-1 */ |
---|
| 159 | |
---|
| 160 | prod[3] = 0.; |
---|
| 161 | for( i = 1; i <= 5; i++ ) prod[3] += k_dep[i][3]; /* s-1 */ |
---|
| 162 | |
---|
| 163 | dy_hcn += prod[3] * NMAX * f[1][3]; |
---|
| 164 | dy_hc3n += prod[3] * NMAX * f[2][3]; |
---|
| 165 | dy_nccn = prod[3] * NMAX * f[3][3]; |
---|
| 166 | dy_ch3cn = prod[3] * NMAX * f[4][3]; |
---|
| 167 | dy_c2h3cn= prod[3] * NMAX * f[5][3]; |
---|
| 168 | |
---|
| 169 | csn[3] = (f[1][3]+3*f[2][3]+2*f[3][3]+2*f[4][3]+3*f[5][3]) |
---|
| 170 | / (f[1][3]+ f[2][3]+2*f[3][3]+ f[4][3]+ f[5][3]); |
---|
| 171 | csh[3] = (f[1][3]+3*f[2][3]+2*f[3][3]+2*f[4][3]+3*f[5][3]) |
---|
| 172 | / (f[1][3]+ f[2][3] +3*f[4][3]+3*f[5][3]); |
---|
| 173 | |
---|
| 174 | /* melange */ |
---|
| 175 | |
---|
| 176 | csn[0] = ( prod[1]*(2*f[1][1]+3*f[2][1]) |
---|
| 177 | + prod[2]*(2*f[1][2]+ f[2][2]+3*f[3][2]) |
---|
| 178 | + prod[3]*( f[1][3]+3*f[2][3]+2*f[3][3]+2*f[4][3]+3*f[5][3]) ) |
---|
| 179 | / ( prod[1]*( f[2][1]) |
---|
| 180 | + prod[2]*( f[2][2]+ f[3][2]) |
---|
| 181 | + prod[3]*( f[1][3]+ f[2][3]+2*f[3][3]+ f[4][3]+ f[5][3]) ); |
---|
| 182 | csh[0] = ( prod[1]*(2*f[1][1]+3*f[2][1]) |
---|
| 183 | + prod[2]*(2*f[1][2]+ f[2][2]+3*f[3][2]) |
---|
| 184 | + prod[3]*( f[1][3]+3*f[2][3]+2*f[3][3]+2*f[4][3]+3*f[5][3]) ) |
---|
| 185 | / ( prod[1]*(2*f[1][1]+ f[2][1]) |
---|
| 186 | + prod[2]*(2*f[1][2]+ f[2][2]+ f[3][2]) |
---|
| 187 | + prod[3]*( f[1][3]+ f[2][3] +3*f[4][3]+3*f[5][3]) ); |
---|
| 188 | |
---|
| 189 | /* mass production rates (in kg m-3 s-1) */ |
---|
| 190 | |
---|
| 191 | prod[0] = 0.; |
---|
| 192 | for( i = 1; i <= 3; i++ ) |
---|
| 193 | { |
---|
| 194 | prod[i] = prod[i] * ct * m[i] / 6.022e23 *1.e3; |
---|
| 195 | prod[0] += prod[i]; |
---|
| 196 | } |
---|
| 197 | |
---|
| 198 | *r1 = dy_c2h2; |
---|
| 199 | *r2 = dy_hc3n; |
---|
| 200 | *r3 = dy_hcn; |
---|
| 201 | *r4 = dy_nccn; |
---|
| 202 | *r5 = dy_ch3cn; |
---|
| 203 | *r6 = dy_c2h3cn; |
---|
| 204 | |
---|
| 205 | } |
---|
| 206 | |
---|