Computational details

Computational Limits and Efficiency

There are limits imposed by the amount of memory that a computer can address and these can limit the maximum size of an Anaqsim model.  The following graph shows data from numerical experiments with 64-bit Anaqsim on a number of different computers.  These data are specific to these machines and each computer will behave differently depending on what other software is running and how the computer is configured, but this at least gives rough guidance.  The vertical axis shows the RAM used by the Anaqsim task - you will need more than this amount of memory to handle the operating system and possibly other tasks.  Thanks to staff at McLane Environmental for providing several of the data points in this graph. When the number of equations approaches the upper limit posed by memory on a given computer, the solve times increase significantly.   If, while running a model, all available memory (RAM) is used by Anaqsim and other tasks running, the windows operating system and .net will swap pages of memory to/from disk, which is a much slower than using RAM.  Symptoms of this condition are a dramatic slowing of all tasks and lots of hard disk activity; this is generally a condition to avoid.  It is best to increase your computer's memory or reduce the complexity of the model so that you can make runs entirely within RAM.

ComputationEfficiency.png

Another potential limit to the application of Anaqsim is where the system of equations gets so large that it takes too long to solve in a reasonable time.   That limit, on present standard personal computers, is probably in the range of several tens of thousands of equations.  Anaqsim can be the right tool for problems of moderate complexity, but not extreme complexity.  Computing power evolves rapidly, and these limits will migrate upward with time.  For situations with extreme complexity, a numerical method like finite differences or finite elements is probably a better choice.

Using multi-level areas in a model adds rapidly to the number of equations in the system.  To keep your problem within a manageable number of equations, use multiple levels sparingly, just in your area of interest and transition to a single level in the far-field.

Some additional suggestions for efficient modeling and limiting computation time are given in the Solve section.

Parallel Processing

Starting with release 2023-1, parallel processing was implemented for determining the coefficients of the matrix A, and the vector b, which form the core components of the linear equation solver Ax = b, updated at each timestep in the solve process.

Starting with release 2019-1, parallel processing was implemented for these computations that occur in plot-making:

These can be a time-saver for complex models and plots, if your computer's CPU has multiple cores.  Experiments indicate that:

Automating Runs

In addition to running Anaqsim interactively through the graphic user interface, you can make automated runs using the Windows command prompt.  This may be useful for running parameter estimation software such as PEST or for executing a batch of unattended runs.  Two input files are required for each model run:

To run an automated model in the Command Prompt, the command syntax is:

<path_to_Anaqsim>   <path_to_input_file>   <path_to_run_control_file>

The command prompt is accessed in Windows 11 by clicking Start Button and searching for 'Command Prompt'.

Within the command prompt it is necessary to put quotes around the path when the path contains names with spaces such as "program files" or "my documents".

To avoid typing out the full file path it is possible to change the current directory within the command prompt to the location that files are saved, then just type in the file names (no path needed) for every input/output file.

Assuming you've changed the current directory in the command prompt to the directory with all input/output files, the following is an example command that would execute a run of Anaqsim:

"c:\program files\yellow sub hydro\Anaqsim\Anaqsim.exe" run23.anaq run23.txt 

In the above example, Anaqsim is launched, run23.anaq is opened from the command prompt current directory, then execution and outputs are controlled by lines in the run control file run23.txt, also in the command prompt current directory.  
An optional 'batch' command can be added to the command which will force Anaqsim to work in the background and not open a user-interface.  An example command that would execute a run of Anaqsim in the background is:

"c:\program files\yellow sub hydro\Anaqsim\Anaqsim.exe" run23.anaq run23.txt batch

The section below shows all the possible commands that can be included in the run control file, their output options, and examples of each.  Some output files are dynamically named based on the input file name, and labels of elements in the model.  Where <name> is specified this relates to the filename of the .anaq input file. Where <well_label> is specified, it relates to the label associated with each well in the model. Similar syntax is used for lines, rivers, etc which have labels within the model.

Starting from version 2023-1 additional outputs and output options are available.

Run Control File Commands

All of the commands listed in the run control file are lower case (case sensitive).  The lines may appear in any order.

Initial Heads File

Command: initialheadsfile filename.hds
Required: required for transient runs
Explanation: Tells Anaqsim to use file filename.hds (replace with your own filename) as the initial heads for a transient run.  As written with no path, the file must be located in the command prompt current directory.  If it's located elsewhere, you must write the entire path+filename here instead of just the filename.  The two parameters on this line must be separated by any combination of spaces and/or tab characters.  This line is only needed for transient runs where the starting heads are to be read from a file.
Output options: N/A
Examples: initialheadsfile run23.hds

Output Log File

Command: outputfile filename.out
Required: Yes
Explanation:  Tells Anaqsim to write text outputs from the automated run to a new text file named filename.out (replace with your own filename). As written with no path, filename.out will be written to the command  prompt current directory.  If you want it written elsewhere, you must enter the entire path+filename here. The two parameters on this line must be separated by any combination of spaces and/or tab characters 
Output options: N/A
Examples: outputfile run23.out

Write Head Locations

Command: writeheadlocations filename.ihl
Required: No
Explanation:  Tells Anaqsim to write the initial head locations from the automated run to a new file named filename.ihl (replace with your own filename). This command (combined with the Save Initial Heads command) is useful if you wish to automate running a steady state model, and creating the initial conditions for a subsequent transient model. As written with no path, filename.ihl will be written to the command prompt current directory.  If you want it written elsewhere, you must enter the entire path+filename here. The two parameters on this line must be separated by any combination of spaces and/or tab characters 
Output options: N/A
Examples: writeheadlocations run23.ihl

Save Initial Heads

Command: saveinitialheads filename.hds
Required: No
Explanation:  Tells Anaqsim to save the initial head locations from the automated run to a new file named filename.hds (replace with your own filename). This command (combined with the Write Head Locations) is useful if you wish to automate running a steady state model, and creating the initial conditions for a subsequent transient model. As written with no path, filename.hds will be written to the command prompt current directory.  If you want it written elsewhere, you must enter the entire path+filename here. The two parameters on this line must be separated by any combination of spaces and/or tab characters 
Output options: N/A
Examples: saveinitialheads run23.hds

This command will fail if you have not also specified 'writeheadlocations' as Anaqsim requires the head locations to be written first before the initial heads can be saved at those locations.

Head Specified Wells

Command: headspecifiedwells
Required: No
Explanation: Directs Anaqsim to write the discharges of head-specified wells to the output file.
Output options:

Examples:

Discharge Specified Wells

Command: dischargespecifiedwells
Required: No
Explanation: Directs Anaqsim to write the heads at discharge-specified wells to the output file.
Output options:

Examples:

Discharge Specified Multilayer Wells

Command: dischargespecifiedmultilayerwells
Required: No
Explanation: Directs Anaqsim to write multi-level discharge-specified wells in the model.  For these the breakdown of discharges by domain will be written to the output file.
Output options:

Examples:

Head Specified Lines

Command: headspecifiedlines
Required: No
Explanation: Directs Anaqsim to write the discharges of internal head-specified line boundaries to the output file.
Output options:

Examples:

Rivers

Command: rivers
Required: No
Explanation: Directs Anaqsim to write the discharges of river line boundaries to the output file.
Output options:

Examples:

River Groups

Command: rivergroups
Required: No
Explanation: Directs Anaqsim to write the cumulative discharge of grouped rivers to the output file.
Output options:

Examples:

External Boundaries

Command: externalboundaries
Required: No
Explanation: Directs Anaqsim to write the discharges across external boundaries to the output file.
Output options:

Examples:

Vertical Leakage

Command: verticalleakage
Required: No
Explanation: Directs Anaqsim to write the vertical leakages over polygon areas to the output file.
Output options:

Examples:

Conditions along a Line

Command: conditionsalongline
Required: No
Explanation: Directs Anaqsim to write steady and/or transient conditions along a line to the output file.  All variables are output for all preset lines.
Output options:

Unlike other csv options, you do not specify a filename following the csv key word

Examples:

Head Hydrographs

Command: headhydrographs
Required: No
Explanation: Directs Anaqsim to write head hydrographs for preset hydrograph points to the output file.
Output options:

Examples:

Drawdown Hydrographs

Command: drawdownhydrographs
Required: No
Explanation: Directs Anaqsim to write drawdown hydrographs for preset hydrograph points to the output file.
Output options:

Examples:

Captured Pathlines

Command: capturedpathlines
Required: No
Explanation: If no csv key word provided, directs Anaqsim to write the number of captured pathlines to the output file.  This is useful for running parameter optimization problems where you want to maximize or minimize the number of pathlines captured by specified wells or line boundaries.   Use this with capture constrain in pathline settings.
If csv is specified and a filename is provided, then the x,y,z vertices of all pathlines (whether captured or not) are saved to a file.  
Output options:

Examples:

Head Output File

Command: headoutputfile
Required: No
Explanation: Directs Anaqsim to evaluate heads according to the current plot settings (Plot Input / What to Plot / Window and Plot Input / Contours Settings / Points_Evaluate) in each model level and at each time step if it is a transient simulation.  
Output options:

Examples:

Calibration

Command: calibration
Required: No
Explanation: Directs Anaqsim to write the calibration to the output file.  All types of calibration information is written.
Output options:

Examples:

Check Boundary Conditions

Command: checkboundaryconditions
Required: No
Explanation: Directs Anaqsim to write boundary checks to the log file. 
Output options: N/A
Examples: checkboundaryconditions

Save

Command: save
Required: No
Explanation: Directs Anaqsim to save the solution file to the specified location.
Output options: A filename must be provided with extension .solu after the save key word. The solution file will be saved to this file.
Examples: save run23.solu

Exit

Command: exit
Required: No
Explanation: Directs Anaqsim to close after having solved and written the specified outputs.  If a line with "exit" is not in the control file, Anaqsim will remain open so that the user could continue with other ways of analyzing the solution or making plots.
Output options: N/A
Examples: exit

Example Run Control File

An example file for a transient model that uses initial head levels from file run23.hds, writes text outputs to file run23.out, outputs head levels at discharge specified wells to a csv file, outputs discharge from grouped river reaches to graphs, and then saves the solution before exiting is as follows:

initialheadsfile run23.hds
outputfile run23.out
dischargespecifiedwells csv run23_Discharge_Wells.csv
rivergroups graph
save run23.solu
exit