Download Page for CrunchFlow

NEW!! CrunchTope

Here is a new version of the code that runs the isotope systems. It should be backward compatible, so hopefully this is the only code you will need at the upcoming short course held before the Goldschmidt Conference.

NEW: Download CrunchTope-32bit executable for PC (compiled Oct. 19, 2014) [~12.0 MB]

NEW: Download CrunchTope-64bit executable for PC (compiled Oct. 19, 2014) [~18.0 MB]

Download CrunchTope executable for Mac compiled with Intel 11.1 (OSX 10.6 compiled Aug. 25, 2014) [~6 MB] (Let us know if this does not run on your Mac--no dynamic libraries, other than those found on all Macs, should be needed. This is compiled with Intel 11.1 compilers)

Download CrunchTope executable for Mac compiled with Intel 14.03 (OSX 10.93 compiled August 26, 2014) [~19 MB] (Let us know if this does not run on your Mac--no dynamic libraries, other than those found on all Macs, should be needed. This is compiled with Intel 14.03 compilers. This should be about 20% faster than those compiled with Intel 11.1)

Download CrunchTope input files (tar format, including *.dbs and *.dat files) (updated June 16, 2014)

Download CrunchTope input files (zip format, including *.dbs and *.dat files) (updated June 16, 2014)

Download 32 bit libiomp5md.dll runtime library (updated January 24, 2014)

Download 64 bit libiomp5md.dll runtime library (updated January, 2014)

Oct. 19, 2014: Fixed a problem with the case where exponents AffinityDepend1 and AffinityDepend2 in mineral reaction rate laws are not = 1.0

Aug. 25, 2014: Fixed a bug having to do with the calculation of gravity-driven fluid flow

July 20, 2014: After 4 full days in Debug mode, finally fixed a problem encountered when multiple surface complexes with a Coulombic correction were present on the same mineral surface (i.e, more than one per mineral). The multiple sites together contribute to a single surface charge. Misled for a while by the fact that the PETSc linear solvers seemed to be giving different performance than the Hindmarsh direct solver. They give the same performance now.

July 14, 2014: "Upgraded" to petsc-3.5.0, building the BlasLapack libraries from download rather than from the Intel Math Kernel Library (which seems to be producing erratic results). Some new or perhaps newly rediscovered GIMRT options. Use "hindmarsh true" in the RUNTIME block when you have a 1D problem--it tends to run faster.

RUNTIME

hindmarsh false

ResidualTolerance 1.0D-09
gimrt_solver gmres
gimrt_pc bjacobi
!!gimrt_pc lu
gimrt_pclevel 0
gimrt_rtolksp 1.0E-07

END

June 23, 2014: Changed tolerance for function residuals. Default is 1.0D-09 mol/m3 (so 1.0D-12 mol/L): If set using keyword "ResidualTolerance" in the RunTime block of the input file, then this value is used, e.g., Residual Tolerance 1.0D-10)

April 21, 2014: Increased allowable size of secondary surface complex array during the initialization procedure (to 250).

April 16, 2014: Fixed isotopic fractionation for the case where the stoichiometric coefficient for the isotope pair in a mineral does not equal 1 (e.g., Ca0.97Mg0.03CO3). Not tested for all cases, and only works for either the "bulk" or "surface" option (not the "none" or "aqueous" option. Also, leave LagSurface = 0.0 in input file.

April 12, 2014: Fixed bug associated with calculation of equivalent fractions in surface complexation. The code was dividing by the incorrect number.

March 27, 2014: Fixed (I hope) bug having to do with disappearance of a mineral phase upon which surface complexation occurs. Problem was in the surface charge calculation, with a divide by zero when the mineral volume went to zero

March 19, 2014: Changed minimum surface complex concentration on minerals that may dissolve completely (set to 1.0E-20)

February 10, 2014: Fixed problem with restart of files (arrays already allocated)

February 9, 2014: Changed activity convention for surface complexation from a molality basis (Model 1 of Wang and Giammar, 2013) to a coverage mole fraction convention (Model 3 of Wang and Giammar, 2013). This should make the convention the same as that used in PHREEQC (essentially an equivalent fraction, rather than a mole fraction). These conventions are the same for monodentate surface complexes, but differ when bidentate or tridentate complexes are present, where the molality based approach does not yield the same result at different site concentrations or solid:solution ratios.

February 9, 2014: Fixed a stealth bug in which the ionic strength was not being exported to the electrostatic surface complexation model.

February 1, 2014: Fixed hopefully the last bug associated with the activity of water.

January 27, 2014: Added ability to specify and write cumulative fluxes and flux-weighted concentrations in X direction at single points or on a Y plane (contact developer for more information)

January 24, 2014: 32 bit and 64 bit libiomp5md.dll libraries (for OpenMP) have same names, but they are not interchangeable (i.e., 64 bit executable will not run with 32 bit DLL). So save them to different folders, or keep track of which is which

January 24, 2014: Fixed problem with reactive surface area using the "bulk surface area" option

January 24, 2014: Fixed problems with calculation and use of activity of water. Now computed using PHREEQc formulation based originally on Garrels and Christ

December 15, 2013: Fixed bug that mixed up the "-no_edl" and electrostatic versions.

December 14, 2013: Fixed bug for case where there were more than one surface complex, each using the electrostatic option

November 9, 2013: Fixed a bogus exponentiation in a nonlinear rate law

10/12/2013: Increased number of Newton iterations for initialization procedure.

October 5, 2013: Made it possible to run Isotopes with the Burch-Hellmann nonlinear rate laws.

October 4, 2013: Fixed a minor bug in the mineral reaction routine that seemed to prevent the proper surface areas being used in the non-isotope cases.

This will download a gzipped "Tar Ball" file CrunchTope-mac.tar.gz. Place this file in the directory where you want to install CrunchTope (normally in your home directory). Use the command:

gunzip -c CrunchTope.tar.gz | tar -xof -

to unpack it. This will create the directory CrunchTope, which will contain the executable CrunchTope and the dynamic libraries needed to run CrunchTope. You will need to edit your shell script (normally .bashrc or .cshrc) to give your computer the location of the libraries and executable (substituting your home directory for the /Users/cisteefel stuff):

CrunchTope_Dir=/Users/cisteefel/CrunchTope
PATH=$PATH:$CrunchTope_Dir}

The run the .bashrc or other shell script from its location (your home directory) using the command:

source .bashrc

which should then add the CrunchTope directory to the system search path. Check that the path has been set properly by typing "which CrunchTope". This should echo the location of your executable.

CrunchFlow2011 code

A new version of the code is available that includes biomass evolution, thermodynamically-mediated microbial reactions, and biomass decay. This is available in both Windows 32 bit and 64 bit versions. Note that the 64 bit version will not run on a Windows 32 system, while the 32 bit version should run on both. Note that the December 15, 2012 version would not run on some computers. This was apparently due to the inadvertent use of a higher level architecture optimization that worked on my laptop, but not on most other PCs. The executables below (uploaded March 14, 2013) should have fixed this problem.

Not 100% sure this is needed, but here it is if you have fatal errors running CrunchFlow2011:

Download 32 bit libiomp5md.dll runtime library (updated March 13, 2013)

NEW: Download CrunchFlow2011-32bit Debug Version for PC (compiled March, 2013) [~30.0 MB]

NEW: Download CrunchFlow2011-32bit executable for PC (compiled December 16, 2013) [~12.0 MB]

December 15, 2013: Fixed bug that mixed up the "-no_edl" and electrostatic versions.

December 14, 2013: Fixed bug for case where there were more than one surface complex, each using the electrostatic option

November 9, 2013: Fixed a bogus exponentiation in a nonlinear rate law

10/12/2013: Increased number of Newton iterations for initialization procedure.

12/15/2012: Fixed minor bug for HyperbolicInhibition option. Also, multiple EDL based surface complexation seems to work.

10/30/2012: Fixed bug in ion exchange that double converted the CEC in the time stepping (initialization was OK).

NEW: Download CrunchFlow2011-64bit executable for PC (compiled December 16, 2013) [~18.0 MB]

12/15/2012: Fixed minor bug for HyperbolicInhibition option. Also, multiple EDL based surface complexation seems to work.

10/30/2012: Fixed bug in ion exchange that double converted the CEC in the time stepping (initialization was OK).

Download CrunchFlow2011 executable and libraries for Mac (OS 10.X compiled December 14, 2013) [~8.3 MB]

This will download a gzipped "Tar Ball" file CrunchFlow2011-mac.tar.gz. Place this file in the directory where you want to install CrunchFlow2011. Use the command:

gunzip -c CrunchFlow2011.tar.gz | tar -xof -

to unpack it. This will create the directory CrunchFlow2011-mac, which contains a "bin" directory containing the executable CrunchFlow2011, a "libs" directory containing the dynamic libraries needed to run CrunchFlow2011, and some test problems. Run "setup.sh" to add the location of the CrunchFlow2011-mac/bin directory to your path so that the code can be found from any directory on the machine. This also sets the Library path for the dynamic (shared) libraries as well. Check that the path has been set properly by typing "which CrunchFlow2011". This should echo the location of your executable. Also read the file README for further instructions (CrunchFlow2011-mac/README).

12/15/2012: Fixed bug associated with HyperbolicInhibition option. Also, multiple EDL surface complexes seem to work.

CrunchFlowMC

A new Beta version of the code includes explicit modeling of a diffuse layer that balances mineral surface charge.

Download CrunchFlowMC executable for 32 bit PC (compiled May 26, 2014) [~12MB]

May 26, 2014: Changed code so that chemical potential gradients are used instead of concentrations in the EDL

April 12, 2014: Fixed bug associated with calculation of equivalent fractions in surface complexation. The code was dividing by the incorrect number.

February 9, 2014: Changed activity convention for surface complexation from a molality basis (Model 1 of Wang and Giammar, 2013) to a coverage mole fraction convention (Model 3 of Wang and Giammar, 2013). This should make the convention the same as that used in PHREEQC (essentially an equivalent fraction, rather than a mole fraction). These conventions are the same for monodentate surface complexes, but differ when bidentate or tridentate complexes are present, where the molality based approach does not yield the same result at different site concentrations or solid:solution ratios.

November 9: Added adjustment to flow calculation based on porosity change.

November 6: Added EDL concentrations to breakthrough curves (for "graphics kaleidagraph" option)

November 5: Fixed error about use of Double Layer mineral when running UseDoubleLayer

October 25: Allowed for ppt/dissolution-induced permeability change to affect bulk porosity only

October 23: Fixed effect of porosity change on flow field, using now the old time step

October 14: Added capability for flow to maintain charge balance when the porosity changes dynamically.

October 3, 2013: Fixed diffusion coefficient bug in cylindrical coordinates

January 10, 2013: Changed BETA value used in the Debye length calculation to 3.00442E-10 meters from an erroneous value of 2.15E-10 used previously.

December 15, 2012: NOTE--When "updateDDL" is TRUE and "SumMicroMacroporosity" is FALSE, the total porosity can decrease or increase since the bulk porosity is treated as either constant or evolving only due to mineral precipitation and dissolution. Currently, since the accumulation term is written so as to conserve mass between the two continua, this will result in a change in concentration of a tracer (i.e., mass is conserved over a changing total volume). I may disable this option altogether, since it only makes sense in a non-constant volume system. You can try to SumMicroMacroporosity TRUE to avoid this, but make sure that "fix_porosity" is set larger than "fix_microporosity", since the "fix_porosity" in this case refers to the total volume.

December 15, 2012: Fixed case where "porosity_update" is TRUE (only used if "fix_porosity" is not set in the POROSITY block).

November 27, 2012: Added additional output fields to the initialization output (<input file name>.out) so that all of the following are included (mol/kgw, where kgw referes to the free or macroporosity), mol/kgDDLwat, where kgDDLwat refers to the mass of microporosity or DDL water (not normally the same value as the free porosity, obviously). Also added mol/g for exchange and surface complexation and mol/m^3 porous medium for all species. To check the charge balancing between the fixed mineral charge (potentially modified by surface complexation) and the DDL, it is necessary to use the same reference frame, i.e., charge equivalents per m^3 porous medium.

November 18, 2012: Fixed bug for case in which a mineral substrate for surface complexation = 0.0 and the electrostatic option is used (fixed a divide by zero). The code was trying to calculate an electrostatic potential on a non-existent mineral (volin(k) = 0.0)

October 3, 2012: Fixed bug associated with UpdateDDL

October 2, 2012: Lowered convergence criterion for DDL charge balance by one order of magnitude

October 1, 2012: Lowered convergence criterion for initialization routine by one order of magnitude

Now has option for the EDL and bulk porosity to sum to the total porosity.

Fixed Debye length/microporosity dependence on ionic strength, which is now dynamically calculated (August 31, 2012)

Fixed restart capability

Updated for new set of input options in the POROSITY keyword block:

CalculateMicroporosity on MineralName --> Tells code to calculate DDL microporosity based on DDL thickness and mineral surface area (works for initialization, not currently for time stepping (April 21, 2012). This replaces the CalculateMicroporosity True or False option and tells the code which mineral to use for the DDL calculations. If UpdateDDL = .FALSE. (see below), then this carries out the DDL microporosity volume calculation ONLY in the initialization procedure. If this is not found, then the "fix_microporosity" value is used.

UpdateDDL true --> Tells code to update DDL microporosity during time stepping (NOTE: Not yet working until the update is implemented with fully implicit scheme)

DebyeLengths --> Calculates DDL microporosity with multiples of DDL length (need not be an integer)

fix_microporosity --> Sets a global DDL microporosity. Used as an initial guess if CalculateMicroporosity = .TRUE.

Updated for new set of input options in the CONDITION block:

set_microporosity --> Sets a local Condition DDL microporosity that overwrites the global "fix_microporosity" value set in the POROSITY keyword block. Used as an initial guess in the case where CalculateMicroporosity = .TRUE.

Download CrunchFlowMC executable and libraries for Mac (OS 10.X compiled May 6, 2011) [~8.5 MB]

NOTE: Updated May 5, 2011 to fix bug with surface complexation option interacting with Donnan potential calculation. Now the code should run with both fixed mineral charge and dynamic surface charge as computed with the double layer model.

NOTE (December 5, 2010): PC and Mac code corrected to give proper temperature-dependent density

NOTE (March 2, 2011): Corrected bug controlling update of Donnan Potential.

Download the "AnionExclusion.in" input file and "datacomMC.dbs" database for explicit diffuse layer modeling.

Download the "bentonite_1600.in" input file and "datacom_chlorite.dbs" database for explicit diffuse layer modeling. Here one can run the code with fixed surface charge or with dynamically computed surface charge using a surface complexation model.

Tried to link to a ZIPX archive, but the browser cannot find it (download the tar ball just below)

Download CrunchFlow Short Course exercises (gzipped tar ball updated December 12, 2011) [28 MB]

Legacy CrunchFlow2007 code

Download CrunchFlow2007 executable for PC (compiled October 8, 2011) [~10.7 MB]

NOTE (October 8, 2011): Code was incorrectly adding a non-zero reactive surface area for minerals for a given CONDITION when no mention of that mineral is made in that CONDITION. Default is now that if the mineral is not referenced in a particular CONDITION, then its surface area is assume to be = 0.

NOTE (August 22, 2011): PC code corrected to use more stringent convergence tolerance of 10-10 mol/m3 for residual, along with a minimum of 2 Newton iterations for species-specific diffusion in which electrochemical migration is computed. This decreases the charge balance errors that can occur when only a single Newton iteration is used with the nonlinear multicomponent diffusion calculation. Check speciation#.out for any Charge Balance errors.

NOTE (August 22, 2011): Number of significant figures in output increased.

Download libiomp5md.dll runtime library

Download CrunchFlow2007 executable and libraries for Mac (OS 10.X compiled December 5, 2010) [~8.3 MB]

NOTE (December 5, 2010): PC and Mac code corrected to give proper temperature-dependent density

Contact Information:

Carl Steefel

Earth Sciences Division

Lawrence Berkeley National Laboratory

One Cyclotron Road, Mail Stop 90-1116

Berkeley, CA   94720

CISteefel@lbl.gov