PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: How to compute the diffusion of Oxygen (and HCN) in a soil-like material  (Read 9003 times)

Alberto

  • Frequent Contributor
  • Posts: 14
How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« on: 02/08/15 06:03 »
I am trying to model the diffusion of some volatiles and soluble gases (O2 and HCN) in a soil-like material (a tailings storage facility).

My problem is how to model transport phenomena like the diffusion of the above gases in the tailings material. As is explained in more detail in the attached Microsoft Word document,  I already have all the parameters of the formulae used computed.

My problem is how to write an algorithm to compute the concentration of oxygen and HCN in function of the depth z. I already did a very rough calculation assuming a linear gradient in the attached PHREEQC file (I just modeled the behaviour of the cyanide solution  and the gas phase in the simplified example posted).

My questions are two:

  1) How can I create multiple layers of tailings material ?

  2) How can I compute the concentrations in each layer, considering the transport by diffusion of the gases HCN     and O2? I suspect I should approximate the Fick's laws of diffusion using the finite difference method.

Best regards
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #1 on: 03/08/15 13:59 »
Multiple layers is simply defining sequences of cells to represent the layers. For example cells 1-5 are layer 1; 6-10 layer 2.

PHREEQC reactive transport is for saturated flow or aqueous diffusion. It does not have a gas transport capability. Codes that include gas transport are MIN3P and the TOUGH series of programs. If you want a complete description of gas flow in combination with aqueous flow and chemical reactions, you could use these or other codes that have the complete formulation. If you want to do it yourself, then you need to implement the coupled partial differential equations for gas and liquid flor plus include the chemical reactions (for which you could use IPhreeqc or PhreeqcRM).
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #2 on: 03/08/15 21:32 »
Hello and thanks for your answer.

However, I tried to run the PhreeqcRM using CMake , but I only got the following error message.

(see image attached)

I already installed the programs:

1)CMake
2)VSCode (maybe I chose the wrong program from Visual Studio?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #3 on: 03/08/15 23:01 »
I think you do not have permission to write into the Program Files directory. Choose a directory on the second line where you have permission to write, and probably also choose an install directory where you have permission to write.
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #4 on: 04/08/15 01:14 »
Thank you, now I have less errors.

Now just one thing is missing: which one visual studio file I should choose for the Cmake compiler settings?

(see attached images)
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #5 on: 04/08/15 13:41 »
The compilers should be found automatically.

When you first start CMake, after you have set the first two lines ("Where is the source code", "Where to build the binaries"), and then you click configure, a small window labeled "cmake-gui" pops up. Pick the Visual Studio that you have installed from the drop-down menu.

To restart the process, you can use File->Delete cache, and then click configure.
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #6 on: 04/08/15 15:49 »
I have suceeded in activating the PhreeqcRM (at least I believe I did), but when I, following the README instructions, tried the BUILD step, 3 errors popped up and the step failed.

I have left attached a printscreen of the failed BUILD step.

Any idea what went wrong?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #7 on: 04/08/15 16:29 »
My guess is that you turned on some option that does not allow C++ extensions. _set_output_format is available in all recent Visual Studios as far as I know, but it is not C++ standard. Its use is only for cosmetics, so you can safely delete the line where it is used.
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #8 on: 04/08/15 18:24 »
I deleted the line in the red rectangle in the first figure attached.

Now it works partially: no error in ALL_BUILD, but the build of  RUN_TESTS failed (see second attached image)

Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #9 on: 04/08/15 20:24 »
You found a bug that shows up in the Debug version. We will fix it in the next release sometime this month.

For now, line 1394 of Solution.cxx should be as follows:

     this->log_gamma_map[git->first] = git->second;
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #10 on: 04/08/15 21:04 »
Where is " line 1394 of Solution.cxx"?

The lines are not numbered.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #11 on: 04/08/15 21:19 »
You do realize that PhreeqcRM is a set of methods used by programmers of new models in C, C++, or Fortran? As an exercise, I will leave it to you to figure out how to find a certain line number of a certain file.
Logged

Alberto

  • Frequent Contributor
  • Posts: 14
Re: How to compute the diffusion of Oxygen (and HCN) in a soil-like material
« Reply #12 on: 04/08/15 22:07 »
Excuse me if I was too impulsive in my questions. I am just a beginner with C++.

Now I think I found the bug, but just to be sure of that before damaging the program (by "correcting" the wrong line) , I will post a screenshot of the line.

If I understood it rightly, where it says "it" should say "git".

Thank you for your pacience.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • How to compute the diffusion of Oxygen (and HCN) in a soil-like material
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2