The Goal of waterpy is to eatimate the potential around cluster.
That’s how waterpy works:
Import python modules
Sort imported values
Calculate basic values
Start loop:
- Timestep
- Protonation of Ions
- Activity Coefficient
- Supersaturation
- dG per Cluster
- New Cluster J
- Add ion to cluster
- Remove ion to cluster
This function controls all modules.
It imports settings and data and starts the nucleation. Also the logging is done here. @author: ralf.ruehl
Reads input text files, comma seperated values. The following files are required:
file group | content |
---|---|
ions... | describes the ion in solution |
solution | describes the solution |
conc gives | concentr of the ions in solution |
settings-capo | salt specific parameters like SP.. |
filenames | |
---|---|
ion_po4_0.txt | ion_h3o_0.txt |
ion_hpo4_0.txt | ion_h2o_0.txt |
ion_h2po4_0.txt | ion_oh_0.txt |
ion_h3po4_0.txt | ion_ca_0.txt |
Every Ion gets a single file. This fils contains a list with following entries:
ionname | charge | protons | radius | pKs | pKs | pKs | n of pKs |
---|---|---|---|---|---|---|---|
[caplet] | [eV] | [n] | [pm] | [] | [] | [] | [n] |
PO4 | -3 | 3 | 362 | 12.32 | 7.21 | 2.16 | 3 |
Ca | +2 | 0 | 123 | 0 | |||
H3O | +1 | 0 | 264 | 0 |
The pKs is given for the ion and the given ion +H. e.g. in the po file the pHs is given for the reaction:
(1)
filename: settings-solution.txt
pH | volume | temperature | pressure | loop | time |
---|---|---|---|---|---|
[] | [L] | [K] | [bar] | [] | [] |
7 | 1 | 298 | 1 | 0 | 0 |
The Ionpusher class collects functions which calculate energies in the loop.
supportive functions to calc the cluster
Created on Sat Oct 29 23:48:22 2011
@author: - ralff.ruehl
decides whether an ion should be added based on the ration
calculates the clusters behaviour
e.g. ions eject/adsorb ions
calculate the energy necessary to reach critical nucleation radius
needs the radius of the mineral germ, the surface tension, the energy per vol
decides whether an ion should be removed
decids which ions to remove
needs cluster and environment
gauss formula, for statistical occations
decides whether the next ion is an anion or cation
requires list with clusterions and the disired ratio
calculate the layers behaviour
e.g. take/eject H
creats an empty list of possible events
lists the most important possible events
returns K
needs concentrations
calculate number of new germs
needs temp [K], conc, dGn, straight from physical chemistry, A supersaturation factor arbitrary value to influence J
calc the current activity coefficient
needs ion, ....
calc the protonation at given pH
N numbers of protons zB = -3 # charge deprot anion Ct = concentration mol / L returns the conc distr of...
calculates the supersaturation of the solution
requires concentrations and solubility products, returns the supersaturation
calcs surface e dep. from r and an external info ext.
returns the factor?!?!
calc surfaceenergy for a given clustersize and chem. environment
requires cluster diameter, last energy, time interval
calculate time interval for this loop
increase: if nothing has happend, or if far away from threshold decrease: if close to threshold or s.th. has happend
the size may vary, so longer timeintervals may be calculated
gives bindingenergy dep. on clustersize
requires the radius and ...?!?!?
An array of numbers, which represent the ions in a cluster.
Defining all properties of an Ioncluster
Created on Tue Nov 29 17:08:05 2011
@author: rr
Collection of Methods in the Ioncluster
depending on Ions
changes inside the cluster like deprotonation
mainly deprotonation?
which ion leaves?
find the ion and delete it from cluster
determines the ions present in the cluster
may vary
which kind of ion comes?
count a special Ione in the cluster
returns no of this ion
gives surface area from cluster
w/o hy shell
A function serving as an ion pit or source, depending on ab initio output or literature data.
Describes the adsorption of Ions to an Aminoacid String
Created on Tue Jan 17 08:27:55 2012
@author: ralf
create a polypeptide string
A function serving as an ion pit or source, depending on the surface.
defines the properties of the wall of a vessel to describe the adsorption of ions to the wall of devices
Created on Tue Jan 17 08:32:00 2012
@author: ralf
Settings and starting scenarios are defind in configuration files and read by the Textin Modules.
Created on Sun Nov 13 16:34:45 2011
@author: -ralf.ruehl read input data from plain text files
checks if the given path for input data is valid
later: further testing for valid input returns true or false
reads a file with ion data for the calculations
requires a filename, and path to input dir, returns a list
which of the calculated data shall be plotted?
read from configuration file
reads a file with settings for the calculations
requires a filename and path, returns a list
reads a file with the concentration of the ions in the solution
requires a filename and path, returns a list
reads a file with properties of the solution for the calculations
requires a filename, and path, returns a list
removes whitespaces and from a list
Severals output options shell be programmed: 1. plain text for arbitary reuse of the data, e.g. in gnuplot #. csv for spreadsheet imports #. export for special molecularmecanics calculations