External Pathway Example
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 A transport pathway element that provides a mechanism by which external program modules for contaminant transport (e.g., analytical, finite elelement, or finite difference models) can be directly integrated into GoldSim.. 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:
- Code and compile the External pathway function;
- Define a single species The chemical (or non-chemical, such as bacterial or viral) constituents that are stored and transported through an environmental system in a contaminant transport model. In GoldSim, the Species element defines all of the contaminant species being simulated (and their properties).;
- Define a Cell pathway A transport pathway element that is mathematically equivalent to a finite difference node. Cells are commonly applied to simulate discrete compartments in an environmental system (such as ponds, lakes, shallow soil compartments, or the atmosphere). to represent the source and define it's properties (including its boundary condition);
- Define a single External pathway and define its properties (i.e., the DLL and function it uses);
- Define a Cell pathway to represent a sink into which the External pathway can discharge;
- Create advective mass flux links from the source Cell to the External pathway, and from the External pathway to the sink Cell; and
- Specify the simulation settings (i.e., duration and timestep A discrete interval of time used in dynamic simulations.), 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.
- Defining External Pathway Properties
- External Pathway Example
- External Pathway Outputs
- Features and Capabilities of External Pathways
- Flux Links to/from External Pathways
- General Information Flow to and from an External Pathway
- Passing Mass Flux Data Between GoldSim and the External Pathway Function
- Saving Results for an External Pathway
- Viewing an External Pathway in the Browser