// Method to add an ionic species to the Donnan Equilibrium
// Partition coefficient to be supplied by user
// default radii and charge taken from class IonicRadii
// Concentrations - Molar
public void setIon(double partCoeff, String ion, double concnA, double concnB, double assocK){
IonicRadii ir = new IonicRadii();
this.arrayl.add(ion);
this.arrayl.add(new Double(concnA));
this.arrayl.add(new Double(concnB));
if(concnA>0.0D || concnB>0.0)this.nonZeroConcns++;
this.arrayl.add(new Double(assocK));
if(assocK!=0.0D)this.nonZeroAssocK++;
double rad = 0.0D;
if(this.includeIc){
if(this.radiusType){
rad = ir.hydratedRadius(ion);
}
else{
rad = ir.radius(ion);
}
if(rad==0.0D){
String mess1 = ion + " radius is not in the IonicRadii list\n";
String mess2 = "Please enter radius in metres\n";
String mess3 = "Enter 0.0 if you wish interfacial charge to be neglected";
rad = Db.readDouble(mess1+mess2+mess3);
if(rad==0.0D)this.includeIc = false;
}
}
this.arrayl.add(new Double(rad));
int charg = 0;
charg = ir.charge(ion);
if(charg==0){
String mess1 = ion + " charge is not in the IonicRadii list\n";
String mess2 = "Please enter charge, e.g +2";
charg = Db.readInt(mess1+mess2);
}