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

 14. USER DEFINED DATA STRUCTURES

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⟩ $$\equiv$$ 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.

$$\eta$$: the ratio $$D_{fi}/D_0$$ for each ion.

$$D_f$$: 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⟩ $$+\equiv$$ typedef struct { real c[NUM_SURFACES];    /* concentration at each surface */ real moles [NUM_SURFACES];    /* moles ion in solution */ real $$\eta$$;    /* Dfi/Do */ real $$D_f$$;  /* 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 $$C_m A_n $$ where $$C$$ represents the cation, and $$A$$ the anion. The quantity of solid is defined on the cell surfaces.

⟨(User defined data types 14)⟩ +\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;