This example provides a simple introduction to the use and implementation of External pathways. This particular example file, ExternalPathway.gsm (and the corresponding DLL), can be found in the Contaminant Transport Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu). The source code (in C++ and Fortran) for the example can be found in the General Examples/External folder in your GoldSim directory.
In this example, a boundary condition of 1 g/yr is applied to a Cell, which flushes immediately into an External pathway. The External pathway function itself is trivial: in addition to the flux input, it requires an additional dimensionless input. Whenever it is called, it simply multiplies the incoming flux by this value and discharges it. In this particular case, the multiplier is equal to 3. To simulate this system in GoldSim, you would do the following:
1. Code and compile the External pathway function;
2. Define a single species;
3. Define a Cell pathway to represent the source and define it's properties (including its boundary condition);
4. Define a single External pathway and define its properties (i.e., the DLL and function it uses);
5. Define a Cell pathway to represent a sink into which the External pathway can discharge;
6. Create advective mass flux links from the source Cell to the External pathway, and from the External pathway to the sink Cell; and
7. Specify the simulation settings (i.e., duration and timestep), and run the model.
The simulation is run for 2 years, so that a total of 2 g of the species enters the system. The output of this simulation, in the form of a time history of the cumulative amount of species mass which is discharged to the sink Cell, is shown below:
Note that mass accumulates at a rate of 3 g/yr (rather than 1 g/yr), since the External pathway multiplies the incoming mass by a factor of 3.