Page:4SIGHT manual- a computer program for modelling degradation of underground low level waste concrete vaults (IA 4sightmanualcomp5612snyd).pdf/109

From Wikisource
Jump to navigation Jump to search
This page needs to be proofread.
31. INITIALIZE SOLUBILITY ARRAY
B.14

36. Read in the ion data from ion-database, cations first, anions second.

⟨Input ion data 36⟩ 
 for (i = 0; i < num.cations; i++) {
   fscanf (ion-database, "%s", cation[i].name);
   fscanf (ion.database,"%lf ", &cation[i].valence);
   fscanf (ion-database,"%,le", &ccation[i].);
   cation[i]. output-flag = FALSE;
 }
 for (j = 0; j < num.anions j++) {
   fscanf (ion-database,"%s",anion[j].name);
   fscanf (ion-database,"%lf",anion [j]. valence);
   fscanf (ion-database"%,le", &anion[j].);
   anion[j], output-flag = FALSE;
 }


This code is used in section 34.

37. Read salt data in cation major order.

⟨Input salt data 37⟩ <math>\equiv<\math>
 for (i = 0; i < num-cations; i++)
   for ( j = 0; j < num.anions; j++) {
     fscanf (ion.database,"%le",&soLarray[i][j].ksp);
     fscanf (ion.database,",lf",&tsol.array [i][j].m);
     fscanf (ion.database,"%lf",&csol.array[i][j].n);
     fscanf (ion.database,"%lf",&soLarray[i]j].molar-density);
     sol-array [i][j].output-flag=FALSE;
   }
 } 

This code is used in section 34.

38. Initialize the ion and salt data to zeros.

⟨Zero-out ion and salt data 38⟩ =
 for (k = 0; k < NUM.SURFACES; k++)
   for (i = 0; i < num.cations; i++){
     cation[i].c[k]=0.0;
     cation[i].moles[k]=0.0;
     for (j = 0; j < num.anions; j++)
       anion[j].c[k] = 0.0;
       anion[j].moles[k]= 0.0;
       sol_array[t][j].s[fc]= 0.0;
     }
   }
 }

This code is used in section 34.