Natural State geothermal model calibration using itough2

Hello everyone.

I have been modelling the natural state of a geothermal field (which shows excellent convection) using TOUGH2. I have achieve almost perfect fits for a section of the field, but my temperatures are still about 18°C too low in two areas. After attempting to calibrate this, the temperatures are still decreasing :(

Someone suggested that since my temperature profiles have an ideal shape (only problem is that the temperature is too low), then I can try to calibrate using iTOUGH2. I have never used iTOUGH2, but i created the input file, however when trying to run it, I get error messages looking like the image attached.

Do I have to change anything in my TOUGH2 file, or is te error within the iTOUGH file attached?

I appreciate any suggestions you can provide.

26replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Melissa,

    I looked at both your TOUGH2 and iTOUGH2 input files and found several mistakes and misconceptions. They are too numerous to list here, so please carefully compare your input files with the revised versions I attach here.

    Here are same major issues:

    (1) In the GENER block, you forgot the decimal point for the flow rate and enthalpy. The rates you actually specified are thus 4 orders of magnitude (!) smaller than what you intended (I glean your intention from the ranges you specified in the iTOUGH2 input file). In a sense, this is good news: this mistake drastically changes fluid in heat flow in your system. The bad news is, that it seems your model has a much harder time running given these (much) higher rates. I don't have the time to look into tis, specifically since I don't know your system at all. 

    Did you check the results when you ran this model using regular TOUGH2, specifically the generation rates printed at the end of each output time?

    (2) The initial error message was clearly spelled out in the iTOUGH2 output file, so please check ii.out, not ii.msg for crucial error messages. In short, you need a space between the two real values defining a range, i.e.,

    >>>> RANGE: -16.0   -14.0

    instead of

    >>>> RANGE: -16.0-14.0

    (3) It bothers me a bit that the parameters you specified in the TOUGH2 input file are outside the range you specified in the iTOUGH2 input file. Of course, iTOUGH2 gives you a clear warning message to that effect, but still...

    (4) Note that if you want to estimate different values for horizontal and vertical permeabilities, you have to define those as separate parameters (not combined into a single block, as you did).

    (5) Your calibration data are at time 0.0, but that is also your starting time, not your steady-state time. Set the starting time to a large negative value, so iTOUGH2 automatically jumps to time zero once steady state is reached. You also need command >>> STEADY-STATE.

    (6) You did not have a > COMPUTATION block at all.

    (7) Assuming that all these issues are fixed, you will not get a reasonable inversion. You have a single, steady-state temperature profile consisting of only 9 temperature points. And you try to estimate 11 (!) parameters. This is an underdetermined inverse problem - it does not have a unique solution (with or without iTOUGH2). 

    Here is what I propose:

    Make sure your forward problem is correctly set up and runs to steady state.

    Then go through the iTOUGH2 sample problems to get proficient in inverse modeling and the iTOUGH2 syntax.

    Good luck,

    Stefan

    Reply Like
    • Stefan Finsterle Thans for your input. I made of few of the minor corrections after posting this. This is my first attempt at writing a script for iTOUGH2, so i appreciate your comments. I will take a look at the two files. Thanks again.

      Reply Like
    • Stefan Finsterle when you say my GENER blocks are too small, does that meant i was NOT employing an enthalpy of 1300 (or 1350) kJ/kg??

      Reply Like
    • Stefan Finsterle what difference does the . make?

      Reply Like
      • Stefan Finsterle
      • Finsterle GeoConsulting
      • Stefan_Finsterle
      • 7 mths ago
      • Reported - view

      Melissa De Freitas 

      Melissa,

      Since the format for reading the constant generation rate and enthalpy (and most other real-valued inputs) is E10.4 (see manual), and since you did not have a decimal point, FORTRAN "sets" one for you at the 6th position. So, if you write "        2" without a decimal point, TOUGH2 reads it as "    0.0002". As a consequence, you indeed had much smaller rates than intended. Check at the end of each output time, where the actually used rates and enthalpies are printed. Moreover, TOUGH2 consistently uses SI units, so enthalpy is in J/kg, not kJ/kg.

      Stefan

      Reply Like
    • Stefan Finsterle ah! Thanks for clarifying! I don't know how i missed that!

      Reply Like
    • Andri Arnaldsson
    • Senior Geothermal Scientist - Vatnaskil Consulting Engineers
    • Andri_Arnaldsson
    • 7 mths ago
    • Reported - view

    It also seems that STEINAR has been used for editing at some point.

    Reply Like
      • Andri Arnaldsson
      • Senior Geothermal Scientist - Vatnaskil Consulting Engineers
      • Andri_Arnaldsson
      • 7 mths ago
      • Reported - view

       I stand corrected, 0.0 porosity values in the INCON block are ignored by TOUGH2/iTOUGH2. 

      Reply Like
    • Andri Arnaldsson Yes I used Steinar to create my mesh. I don´t understand why my porosity value is zero. I didnt even realise it was. I set the porosity as 10%

      Reply Like
      • Andri Arnaldsson
      • Senior Geothermal Scientist - Vatnaskil Consulting Engineers
      • Andri_Arnaldsson
      • 7 mths ago
      • Reported - view

       Yes, I made a mistake there - sorry about that. Zero porosity values in the INCON block are ignored when the file is read. You can see the true values in the SAVE file after the run.

      Reply Like
    • Andri Arnaldsson ah ok. Does Steinar create a mesh file? Because I noticed all the X Y Z parameters in the element block is zero. So how exactly does this work?

      Reply Like
    • Melissa De Freitas 

      I haven't really followed this thread too much, but I can tell you that the XYZ parameters listed in the ELEME block are not used at all in the flow calculations, so this alone shouldn't affect the results of your simulation.  Having them all listed as 0.0 will cause problems in post-processing if you try, for example, to plot a freeze frame of the results.

      Reply Like
      • Andri Arnaldsson
      • Senior Geothermal Scientist - Vatnaskil Consulting Engineers
      • Andri_Arnaldsson
      • 7 mths ago
      • Reported - view

       Yes, the "eleme" file from STEINAR does not contain any coordinates. Like Mikey Hannon says, the coordinates are not necessary for the basic flow calculations.

      Reply Like
    • Andri Arnaldsson So with regards to post-processing, what options do I have?

      Reply Like
      • Andri Arnaldsson
      • Senior Geothermal Scientist - Vatnaskil Consulting Engineers
      • Andri_Arnaldsson
      • 7 mths ago
      • Reported - view

       I don't think there is much out there for post-processing unless you want to buy something like Petrasim or Tecplot. I guess most people make something up in Matlab or Python/Matplotlib. I haven't looked at PyTOUGH in a long time, might be something there. 

      Reply Like
  • I, my self, use GMS form Aquaveo both for pre- and post-processing. It is actually very useful for producing original state of geothermal fields. This is the way I do it. I create in GMS the conceptual and geologic models. Following in GMS I create and populate the grid and run MODFLOW in GMS to produce a reliable ground water table. Then I export the GMS grid into Tough2 or tough3. I also export my water table to implement real pressures onto my geothermal system. After running Tough2 I import back the data into the GMS grid for visualization. I have written to small Fortran codes to produce the input for tough2 from GMS and to be able to read the tough2 output back into GMS. I can provide them for free.

    Andrea

    Reply Like
    • Hi Andrea . I am exploring my options for post-processing, so any tools that you can provide will be greatly appreciated :)

      Reply Like
    • Melissa De Freitas 

      Hi Melissa,

      if you are willing to use GMS for preparing and populating the input grid to tough2 or tough3 and display the output I have written two simple codes to do this and I can share them with no problem. The results are good. This allows you to work with tough2 with the actual code and input files making the changes you like to do. If you are interested and let me know what is your problem I can be more explicit.

      Andrea

      Reply Like
  • Hello guys.. I also have a problem similar to the topic on this thread. My ITOUGH2 program didn't work.
    I have created a natural state model using the TOUGH2 simulator (Petrasim software) and the model succeeds in steady state condition. Then I tried to calibrate the model with ITOUGH2 program. However, I failed to run its ITOUGH2 program.

    Is there something wrong with my input files?

    I made TOUGH2 input file from Petrasim software directly while its ITOUGH2 input file I created manually by following ITOUGH2 user guide and command reference.

    do you have any suggestions? Thanks

    Reply Like
  • Rivan,

    Running your files immediately gives me the following error message:

    *****  ERROR  *****
     * Error in file /Users/.../it2_30551/well.dat. Provide map in following format:
     * Number of points in space (NXYZ),
     * Number of points in time (NTIM),
     * X and Y coordinates of profile,
     * NTIM times when observations were taken,
     * followed by NXYZ lines:
     * Z(1)    (VALUE(1   ,I),I=1,NTIM)
     * ......   .....
     * Z(NXYZ) (VALUE(NXYZ,I),I=1,NTIM)
     *****  ERROR  *****
     

    This tells you that:

    (1) The issue is not related to the forward input file created by PetraSim (it runs just fine; try it by just doing a forward run instead of attempting an inversion).

    (2) The error message clearly tells you (a)  what the issue is, (b) which file needs to be corrected, and (c) what the proper format is.

    (3) Your header in well.dat does not comply with the format described in the manual and in the error message. Correct it to:

    57
    1
    217734.71 9034439.46
    0.0  (I can only guess that 0.0 is the calibration time you want; correct if different)
    532.4404718     70.54375856
    506.8963731     76.69010572

    ...                         ...

     

    (4) In case you run iTOUGH2 under Linux/Unix, don't forget to indicate that file well.dat is needed as an input file. You can do this in tow ways:

    (4a) On the command by typing: 

    itough2 -fi well.dat it2.file t2.file 1 &

    (4b) In the iTOUGH2 input file, by adding the following line any place you like:

    FILE: well.dat

    I did not look at the results of your inversion, but it starts running just fine.

    Best,

    Stefan

     

    PS: I encourage everybody submitting posts in this forum to briefly describe the issue they have (i.e., not just "the program didn't work"). In almost all cases, there is an error message. Quoting this error message goes a long way telling everybody what the issue is, whether they are interested in this post, and what the solution might be.

    Reply Like
    • Stefan Finsterle Hai Stefan, Thanks for your advice. Now my inversion can run, but no result as you said. When I change little bit of ITOUGH2 input file,

      >OBSERVATIONS
        >> TIMES: 50 EQUALLY SPACED [YEARS]
           0.1 10

        >> TEMPERATURE
           >>> ELEMENT MAP (I replace "PROFILE" to "MAP")
               >>>> ANNOTATION  : WELL
               >>>> DATA FILE   : well.dat
               >>>> DEVIATION   : 5.0
               <<<<
           <<<
        <<

      Then I run again, seen error in this section (see image). Does these errors occur because I am wrong in compiling its ITOUGH2 program?

      Reply Like
  • Hi Rivan,

    I was able to run your previous input file without any further adjustments and error messages (I did a few iTOUGH2 iterations).

    Anyway, the error message refers to an output conversion error in the TOUGH2 forward run. I cannot see how this is related to the change you made in the iTOUGH2 input file (switching from PROFILE to MAP). Did the error occur during the very first forward run, or later?

    Please check the bottom of file t2.out. If nothing obvious can be found there (which is likely, as you ran into a hard crash), check Line 940 of file eos1.f, which would tell you what variables were being printed when the formatting error occurred. In case you need help with that, please send me file eos1.f (from the executable name I infer that you use a rather old version of iTOUGH2, which of course is fine, but I need your version of eos1.f to be able to help you; you might as well attach your modified input files).

    Stefan

    Reply Like
    • Stefan Finsterle Hi Stefan,
      The program running during 5-10 minutes and then an error occurred.

      Maybe I need your help to edit or modify this eos1.f file. Hereby I attached the eos1.f and my input files.

      p.s: In my ITOUGH2 file, I switched from MAP to PROFILE again to ensure whether this error occurs because of a command replacement (PROFILE to MAP), but still an error.

      Reply Like
  • Rivan,

    Please let us know what the error message is. Is it the same as before? After 5-10 minutes, are you still running the first forward run? Did you look at the TOUGH2 output file?

    Stefan

    Reply Like
    • Stefan,

      The error message is still the same as before. This message have occurred in the first forward running process, likewise on the second. When the third forward running process, suddenly, the running process stopped and ITOUGH2 program closed automatically.

      I have seen the t2.out file, and one message I suspect is only "time step size unchanged", but I do not understand what it means.

      Regards,

      Rivan

      Reply Like
  • Rivan,

    I'm afraid I cannot help you much for the following reasons:

    (1) I cannot reproduce the error.

    (2) You did not attach your output file, and did not provide all input files needed to run your case.

    (3) It does not make sense that the code accepts the same error for the first two runs and then decides to crash hard on the third.

    (4) Your input files have a lot of other issues (here are just two: you either did not specify a calibration time at the time when you measured your profile (I can't tell, because you did not send me a complete set of your input files), or you try to calibrate the single profile at multiple times; your 57 data points only refer to 4 elements).

    Should I be wrong about Point (3), and the issue is indeed related to Line 940 of eos1.f, I attach a new file with the format statement changed.

    Regarding (4), I encourage you to run both the TOUGH2 and iTOUGH2 sample problems before attempting to do an inversion of a model with 50,000 elements with fundamentally questionable outcome.

    Stefan

    Reply Like
reply to topic
Like Follow
  • 6 mths agoLast active
  • 26Replies
  • 385Views
  • 6 Following