Using "RunAccumulated" in PhreeqPy

80 views
Skip to first unread message

Minjeong Kim

unread,
Nov 10, 2019, 7:10:33 PM11/10/19
to phreeqpy-users

Dear PhreeqPy users, 


Good day!

I'm Minjeong and trying to use PhreeqPy with MATLAB on Linux.

The iphreeqc commands that I would like to use are "RunAccumulated" and "ClearAccumulatedLines". 

I've tested PhreeqPy 0.2 and 0.3. Both versions seemed like there is no attribute for "RunAccumulated" and "ClearAccumulatedLines". 


May I kindly ask you how to use those functions in PhreeqPy? 


Sincerely,

Minjeong 

Dr. Mike Mueller

unread,
Nov 10, 2019, 10:12:10 PM11/10/19
to phreeqp...@googlegroups.com
Dear Minjeong,

Am 11.11.19 um 01:10 schrieb Minjeong Kim:
> Dear PhreeqPy users, 
>
>
> Good day!
>
> I'm Minjeong and trying to use PhreeqPy with MATLAB on Linux.
>
> The iphreeqc commands that I would like to use are "RunAccumulated" and
> "ClearAccumulatedLines". 
>
> *I've tested PhreeqPy 0.2 and 0.3. Both versions seemed like there is no
> attribute for "RunAccumulated" and "ClearAccumulatedLines".* 
>
>
> May I kindly ask you how to use those functions in PhreeqPy?

You can find all implemented functions here:
https://www.phreeqpy.com/iphreeqc.html

`ClearAccumulatedLines` is called `clear_accumlated_lines`.

`RunAccumulated`is not implemented yet. I might add it in the future but
don't have firm plans yet to do so. But you can use `run_string` instead.
See the example (https://www.phreeqpy.com/examples.html) for details how
to do this.

Best,
Mike

>
>
> Sincerely,
>
> Minjeong 
>
> --
> You received this message because you are subscribed to the Google Groups
> ""phreeqpy-users" group.
> To post to this group, send email to phreeqp...@googlegroups.com.
> To unsubscribe from this group, send email to
> phreeqpy-user...@googlegroups.com.
> For more options, visit this group at
> https://groups.google.com/d/forum/phreeqpy-users?hl=en.
>  
> More information about PhreeqPy can be found at http://www.phreeqpy.com.
> ---
> You received this message because you are subscribed to the Google Groups
> "phreeqpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to phreeqpy-user...@googlegroups.com
> <mailto:phreeqpy-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phreeqpy-users/344cc192-b4c1-456d-8f1f-20258c8ebbe7%40googlegroups.com
> <https://groups.google.com/d/msgid/phreeqpy-users/344cc192-b4c1-456d-8f1f-20258c8ebbe7%40googlegroups.com?utm_medium=email&utm_source=footer>.

Parkhurst, David

unread,
Nov 11, 2019, 2:56:58 PM11/11/19
to phreeqp...@googlegroups.com
Sorry, I am not a PhreeqPy user. Try the PhreeqPy forum or Mike Mueller.

David



--
You received this message because you are subscribed to the Google Groups ""phreeqpy-users" group.
To post to this group, send email to phreeqp...@googlegroups.com.
To unsubscribe from this group, send email to phreeqpy-user...@googlegroups.com.
For more options, visit this group at https://groups.google.com/d/forum/phreeqpy-users?hl=en.
 
More information about PhreeqPy can be found at http://www.phreeqpy.com.
---
You received this message because you are subscribed to the Google Groups "phreeqpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phreeqpy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/phreeqpy-users/344cc192-b4c1-456d-8f1f-20258c8ebbe7%40googlegroups.com.

ravi

unread,
Nov 11, 2019, 3:03:53 PM11/11/19
to phreeqpy-users
Hi all
In phreeqpy function names have been adapted to better suite python programming style. I have modified phreeqpy in IPhreeqcPy. Take a look at that
https://raviapatel.bitbucket.io/IPhreeqcPy/install.html
Cheers
Ravi
Message has been deleted

Minjeong Kim

unread,
Nov 17, 2019, 7:15:24 PM11/17/19
to phreeqpy-users

Dear Mike, 


Thanks for your answer. 

I have two questions. The first one is what is accumulate_line for without run_accumulated? and what is "input buffer"?


The second question is: does run_string work same as run_accumulated? 

For examples in case of iphreeqc, do example 1 and 2 work in a same way after initializing? 


Example 1) iphreeqc.AccumulateLine('SOLUTION_MODIFY 1')

                   iphreeqc.A ccumulateLine ('totals')

                   iphreeqc.A ccumulateLine ('Cl 0.1')

                   iphreeqc.A ccumulateLine('RUN_CELLS')

                   iphreeqc.A ccumulateLine('-cells 1-2')

                   iphreeqc.RunAccumulated; 



Example 2) STR=['SOLUTION_MODIFY 1'

                              'totals'

                              'Cl 0.1'

                              'RUN_CELLS'

                              '-cells 1-2']


                    iphreeqc.RunString(STR);



Thanks in advance. 


Sincerely,

Minjeong 


2019년 11월 11일 월요일 오후 12시 12분 10초 UTC+9, mmueller 님의 말:
> For more options, visit this group at
> https://groups.google.com/d/forum/phreeqpy-users?hl=en.
>  
> More information about PhreeqPy can be found at http://www.phreeqpy.com.
> ---
> You received this message because you are subscribed to the Google Groups
> "phreeqpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email

Dr. Mike Mueller

unread,
Nov 20, 2019, 2:29:44 AM11/20/19
to phreeqp...@googlegroups.com
Am 18.11.19 um 01:15 schrieb Minjeong Kim:
> Dear Mike, 
>
>
> Thanks for your answer. 
>
> I have two questions. The first one is what is accumulate_line for without
> run_accumulated? and what is "input buffer"?

PhreeqPy is just a wrapper around IPhreeqc. You can check the original
documentation of IPhreeqc.

> The second question is: does run_string work same as run_accumulated?

Good question. I implemented this a few years ago. Looks like I wanted to use
`run_accumulated()` but found `run_string()` much simpler.

> For examples in case of iphreeqc, do example 1 and 2 work in a same way after
> initializing? 
>
>
> Example 1) iphreeqc.AccumulateLine('SOLUTION_MODIFY 1')
>
>                    iphreeqc.A ccumulateLine ('totals')
>
>                    iphreeqc.A ccumulateLine ('Cl 0.1')
>
>                    iphreeqc.A ccumulateLine('RUN_CELLS')
>
>                    iphreeqc.A ccumulateLine('-cells 1-2')
>
>                    iphreeqc.RunAccumulated; 
>
>
>
> Example 2) STR=['SOLUTION_MODIFY 1'
>
>                               'totals'
>
>                               'Cl 0.1'
>
>                               'RUN_CELLS'
>
>                               '-cells 1-2']
>
>
>                     iphreeqc.RunString(STR);
>
>

Both should be the same in principle. You can write this simpler. Just look at
the example (https://www.phreeqpy.com/examples.html) and adapt to your needs.

Assuming phreeqc.dat is in the current directory, this should work:


import phreeqpy.iphreeqc.phreeqc_dll as phreeqc_mod

phreeqc = phreeqc_mod.IPhreeqc()
phreeqc.load_database("phreeqc.dat")

phreeqc_input = """

SOLUTION_MODIFY 1
totals
Cl 0.1
RUN_CELLS
-cells 1-2
"""

phreeqc.run_string(phreeqc_input)

Assembling the input string in Python and using `run_string()` is simpler and
very likely also faster. At least in my opinion. ;)

Best,
Mike

> Thanks in advance. 
>
>
> Sincerely,
>
> Minjeong 
>
>
> 2019년 11월 11일 월요일 오후 12시 12분 10초 UTC+9, mmueller 님의 말:
>
> Dear Minjeong,
>
> Am 11.11.19 um 01:10 schrieb Minjeong Kim:
> > Dear PhreeqPy users, 
> >
> >
> > Good day!
> >
> > I'm Minjeong and trying to use PhreeqPy with MATLAB on Linux.
> >
> > The iphreeqc commands that I would like to use are "RunAccumulated" and
> > "ClearAccumulatedLines". 
> >
> > *I've tested PhreeqPy 0.2 and 0.3. Both versions seemed like there is no
> > attribute for "RunAccumulated" and "ClearAccumulatedLines".* 
> >
> >
> > May I kindly ask you how to use those functions in PhreeqPy?
>
> You can find all implemented functions here:
> https://www.phreeqpy.com/iphreeqc.html
> <https://www.phreeqpy.com/iphreeqc.html>
>
> `ClearAccumulatedLines` is called `clear_accumlated_lines`.
>
> `RunAccumulated`is not implemented yet. I might add it in the future but
> don't have firm plans yet to do so. But you can use `run_string` instead.
> See the example (https://www.phreeqpy.com/examples.html
> <https://www.phreeqpy.com/examples.html>) for details how
> to do this.
>
> Best,
> Mike
>
> >
> >
> > Sincerely,
> >
> > Minjeong 
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > ""phreeqpy-users" group.
> > To post to this group, send email to phreeqp...@googlegroups.com
> <javascript:>.
> > To unsubscribe from this group, send email to
> > phreeqp...@googlegroups.com <javascript:>.
> > For more options, visit this group at
> > https://groups.google.com/d/forum/phreeqpy-users?hl=en
> <https://groups.google.com/d/forum/phreeqpy-users?hl=en>.
> >  
> > More information about PhreeqPy can be found at http://www.phreeqpy.com.
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "phreeqpy-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to phreeqp...@googlegroups.com <javascript:>
> > <mailto:phreeqpy-user...@googlegroups.com <javascript:>>.
> <https://groups.google.com/d/msgid/phreeqpy-users/344cc192-b4c1-456d-8f1f-20258c8ebbe7%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/phreeqpy-users/344cc192-b4c1-456d-8f1f-20258c8ebbe7%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> ""phreeqpy-users" group.
> To post to this group, send email to phreeqp...@googlegroups.com.
> To unsubscribe from this group, send email to
> phreeqpy-user...@googlegroups.com.
> For more options, visit this group at
> https://groups.google.com/d/forum/phreeqpy-users?hl=en.
>  
> More information about PhreeqPy can be found at http://www.phreeqpy.com.
> ---
> You received this message because you are subscribed to the Google Groups
> "phreeqpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to phreeqpy-user...@googlegroups.com
> <mailto:phreeqpy-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phreeqpy-users/6c78aca4-b4bf-4057-954f-207b2ae1286e%40googlegroups.com
> <https://groups.google.com/d/msgid/phreeqpy-users/6c78aca4-b4bf-4057-954f-207b2ae1286e%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages