eters for the soil functions. Next, the residual un-
merged together. This might be interpreted as the
frozen water content in the mature frozen soil is
standard approach of writing a series of subrou-
assumed to be equal to the lower limit of freez-
tines, but it is more. The traditional approach is to
ing. Equations 1 and 2 are then solved for the water
write a series of procedures to numerically solve
flux into the fringe and the flux of heat out of the
the problem. These procedures are sequentially
upper boundary.
solved and in large programs result in many pages
Profiles of pressures, stresses and temperature
of critically linked lines of code. When, for ex-
are then calculated within the fringe starting at
ample, the routine to calculate hydraulic conduc-
the freezing front. The value of φb at the freezing
tivity must be changed, that section of code must
front is obtained by setting the local water pres-
be found and modified. Care must be taken not to
sure to zero. This is equivalent to assuming that
remove variables that are used by the rest of the
the water table is at the freezing front. If the water
program as well as not to add variables that are
pressure is not zero, then the resulting heaving
already being used in other parts of the program.
pressure obtained by assuming zero must be ad-
The OON approach is to break the problem
justed using eq 11.
down into separate self-contained units called
Calculations are done in terms of φ. In finite
classes, a class being a collection of data and op-
difference form, balances are conducted across lay-
erations. Data in one class can be made inacces-
ers of constant dφ. This has the benefit of generat-
sible to other classes to prevent inadvertent
ing thin spatial layers where φ is changing rap-
changes by later modifications to the program.
idly and large spatial layers where it changes least.
Additional classes can be made that inherit the
Darcy's law gives the value of the water pres-
properties of existing classes. Operations used by
sure across the layer and Fourier 's law gives the
a class can be expanded by a process called poly-
temperature. The Clapeyron equation then gives
morphism. Again, if a new function to calculate
the ice pressure as well as the thickness of the layer.
Neutral stress is calculated for each layer and a
sary to write a completely new class, but just
running account of its magnitude recorded to de-
merely to add to the current. In other words, the
termine its maximum value. A running sum of the
new function would access all the data used by
unfrozen water content is also made, starting from
the old as well as any new data that it requires,
the location of maximum neutral stress to deter-
and the new data are prevented from interfering
mine the residual water content. Calculations con-
with any existing data in the program. The tradi-
tinue until the ice pressure equals the maximum
tional approach leads to mistakes and debugging
neutral stress. This is the location of the base of
problems. The OON approach rests on the belief
the lens and the new lens will form where the neu-
that if the original code worked, then don't change
tral stress was maximum. The distance between
it, just add improvements.
these two locations gives the lens spacing. The cal-
RIGIDICE is setup as a series of C++ classes.
culated residual water content is then compared
At the lowest level, functions and data associated
to the original guess. If the difference is unaccept-
with a particular soil are grouped together in a
able, the layer by layer calculations are performed
class called Tsoil. Functions and data associated
again with the new guess until the resulting change
with the boundary conditions are grouped together
in residual water content is acceptable.
as a class Tbnds and numerical precision in a class
A flow chart representation of this algorithm
Ttol. Since all variables are reduced to dimension-
is presented in Figure 2.
less form to help in numerical calculations, a class
that does scaling is called REDUCE. Finally, the
calculations that perform the necessary algorithm
are made in the class Trigidice. This class is de-
RIGIDICE WITH
clared so that it inherits all the properties of the
OBJECT-ORIENTED NUMERICS (OON)
other classes. If a different algorithm is necessary,
Code was written to solve eq 1 through 16 us-
then a new one can be written that also inherits
ing the algorithm outlined above. To allow for the
the other classes while never touching the origi-
greatest flexibility of use, as well as ease of future
nal source code for the other primitive classes.
enhancements, C++ was used. The entire code is
In total, the program requires the initiation of
presented in Appendix A.
18 variables. It then returns the values of eight
The benefit of using OON is that it allows the
calculated variables. Figure 3 shows the input
writing of code in separate layers that are easily
screen of the MathCad program that runs RIGIDICE.
5