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

From Wikisource
Jump to navigation Jump to search
This page needs to be proofread.
14. USER DEFINED DATA STRUCTURES
B.7


14. User defined data structures.

These are constructed datatypes used by 4SIGHT. Two fundamental types are real and boolean. Using real lets the programmer easily change between float and double data types for real numbers.

The boolean types are defined {FALSE, TRUE} because Borland assigns the first entry the number 0. Variables defined as boolean can be used in a conditional statement as if(myboolvar) without direct comparison to FALSE or TRUE.

⟨User defined data types 14⟩ 
typedef double real;
typedef enum {
  FALSE, TRUE
} boolean;

See also sections 15, 16, and 17.

This code is used in section 2.

15. The ION data type contains all important information about a singleion. This information includes:

c[]: concentration at each computational cell surface.

: the ratio for each ion.

: free ion diffusivity.

valence : the valence of the ion.

output-flag: a flag to denote whether the final ion concentration, as a function of distance, is printed in system. out.

name []: the ASCII name of the ion.

⟨User defined data types 14⟩  
 typedef struct {
   real c[NUM_SURFACES];     /* concentration at each surface */
   real moles [NUM_SURFACES];     /* moles ion in solution */
   real ;     /* Dfi/Do */
   real ;   /* ion free diffusivity */
   real valence;     /* ion valence */
   boolean output-flag;    /* print to system. out?
   char name [5];    /* ASCII name of ion */
 } ION;

16. The SOLARRAY data type contains the solubility products and stiochiometric ratios for each anion-cation combination. The salt is where represents the cation, and the anion. The quantity of solid is defined on the cell surfaces.

⟨(User defined data types 14)⟩ <math>+\equiv<\math>
 typedef struct {
   real s[NUM_SURFACES;     /* moles solid salt in element */
   real ksp;    /* salt solubility constant */
   real m;      /* stiochiometric cation factor */
   real n;      /* stiochiometric anion factor */
   real molar-density;      /* cm 2 /mole */
   boolean output.flaq:     /* print salt to system.out? */
  } SOLARRAY;