Jump to content
Geochemist's Workbench Support Forum

SpecE8: -- Internal error: calc_hmw: Ionic strength is out of range SpecE8 abandoning calculation.


Recommended Posts

Posted

Hello,

I tried to model a small speciation (but including Pitzer due to high salinity). SpecE8 stopped with the error message:

Quote

       -- Internal error:  calc_hmw: Ionic strength is out of range
SpecE8 abandoning calculation.
Largest residual(s):
                       Resid     Resid/Totmol   Cbasis
---------------------------------------------------------
 PO4---              1.758e+05            1    3.734e-09
---------------------------------------------------------

I already tried to include the "as P" in the input file, but it does not help.

Swapping H2PO4- for PO4--- makes the calculation run, but then I got quit a different total P concentration compared to relaculation the given PO4--- concentraiton to molal scale.

Can you please give me a hint?

Many thanks in advance and best regards,
Frank

Example_speciation.sp8 THEREDA_2023a_GWB.tdat

Posted

Hello Frank,

Thank you for attaching your file. I am not quite sure what you are comparing here. Could you clarify the discrepancy and show the math on what's not adding up for you?

Best regards,
Jia Wang
Aqueous Solutions LLC

Posted

Dear Jia,

many thanks for your reply. The actual problem is the abbording calculation. Swapping manually to H2PO4- did help me here, but I would like to avoid this problem in the future (as I plan some multiple automated calculations (thousands in a run) and I would like top avoid this happens. Is there a way?

Concerning the discrepancy in the P content, this is maybe due to the density when comparing mol/L (input unit) with mol/kgw (output unit). I am sorry for missing this in the first place!

Many thanks and best regards,
Frank

Posted

Hello Frank,

Thank you for the clarification. I believe the reason why the program had difficulty without the swap is because the concentration of PO4--- is very small in comparison to other phosphorus species given the condition of your fluid. It is not really possible to guarantee that the same settings will work for thousands of samples. For this particular case though, and perhaps if your other fluids are from a similar system, you can exchange the position of PO4--- and H2PO4-- in your thermodynamic database. This way, H2PO4-- now becomes your Basis species and PO4--- will be a secondary species. You can write your scripts or make calculations in GSS in such a way that you can specify the concentration of Phosphorus with H2PO4--- without the need to perform a swap in your Basis.

Hope this helps,
Jia

Posted

Dear Jia,

many thanks for the recommendations. I will talk with my THEREDA colleagues to change the P basis species from PO4--- to H2PO4-. This should help.

Many thanks and best regards,
Frank

Posted

You're welcome Frank. I forgot to mention that you can easily exchange the places of PO4--- and H2PO4-- using TEdit. You can view an example on here or find details in the GWB Essentials Guide, section 9.2.8.3 Exchange species positions.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...