0

Format of INCON and SAVE file

Hi, I am trying to capture the block status (perm, poro, pressure etc). In the previous TOUGH2 or TOUGHREACT, the INCON or SAVE file could contain the perm, porosity, and pressure, temp in the standart output. In the TOUGH3, I found I have to define the mop(13) = 1, " writes user-specified initial conditions to file SAVE". 

I have a question, how can I change the setting to allow TOUGH3 to export perm, porosity in the INCON and SAVE file?   

When we put mop(3)=1, how does the model copy heterogeneous element wise information to SAVE file?  I have attached a sample SAVE file here, but the first row contains 4 numbers, porosity (0.2), I do not know what is the -1. I presume the rest three numbers should be perm(3). 

Thank you very much for your kind help. I really appreciate it.

18 replies

null
    • Keurfon_Luu
    • 3 yrs ago
    • Reported - view

    Not sure whether it's possible to export individual permeabilities to SAVE/INCON. If I remember correctly, MOP(13)=1 only exports to SAVE file user defined permeabilities i.e. only if your INCON file has custom permeability modifiers.

    Otherwise, you can ask TOUGH3 to output specific variables using the new block OUTPU. The sample block below should output in file OUTPUT_ELEME.csv the porosity and absolute permeabilities for every elements in your mesh at desired time steps:

    OUTPU----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8
    5
    COORDINATE
    POROSITY
    ABSOLUTE                1
    ABSOLUTE                2
    ABSOLUTE                3
    
      • Flybear
      • 3 yrs ago
      • Reported - view

      Keurfon Luu 

      Hi, Keurfon,

       

      Thanks for your reply. It will be acceptable if I could catch the perm output from the SAVE file. 

      I read the tough3 manual, I set the mop(13) = 1, I do not understand one setting USRX(I) I=1,5 .  I could only guess part of USRX information will be: permeability modifier, perm(x), y , z ? But this setting has 5 entries. Can you please let me know what are the require information for USRX?  

      I think it might be more easier to assign heterogeneous perm distribution, rather than using mop2 and USERX ?

      Thanks

      Q

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Flybear USERX(1), USERX(2) and USERX(3) hold the elementwise permeability modifiers (absolute permeability if positive, multiplier if negative). I can see in TOUGH3 user guide that USERX(4) is used in the modified van Genuchten capillarity model (ICP=11). No mention to USERX(5) which probably means that it can be used for custom models.

      Elementwise heterogeneous permeability distributions can be assigned through USERX(1:3) which can be defined either in columns 80-110 of block ELEME (MOP2(20)) or in columns 30-60 of block INCON. I don't know a better way to do that. These values seem to be only written to SAVE (MOP(13) = 1) if they are initially defined by the user.

      • Flybear
      • 3 yrs ago
      • Reported - view

      Keurfon Luu  

      Hi, Keurfon, Thanks for clarifying this setting.  I looked at this manual,  the USERX (1-3) you mentioned is defined in the ELEME, which has three colomns.  

      However, the parameter USRX is defined in the INCON section, with 5 colomns of entries.  In my SAVE file attached, the USRX(1) = -1. Is it a default perm modifier? Do you know what are the setting for USRX(2-5)? 

      Thank you very much for your help.

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Flybear USRX and USERX refer to the same input. It's probably a typo in the documentation. In the source code, USERX defined in ELEME will be read in USERX(1:3) array if MOP2(20) is set, otherwise, USERX(1:3) are read from INCON.

      - USERX(1:3): anisotropic permeability modifiers, absolute permeability if positive, multipliers if negative (-1 means that the absolute permeability of a given element is the absolute permeability of its material in block ROCKS),

      - USERX(4): CP(2) parameter of capillary pressure function ICP=11,

      - USERX(5): void (which means that it is free to use for user defined models, for instance).

    • yqzhang
    • 3 yrs ago
    • Reported - view

    It seems from the description of the Users Guide, USRX(1) = -1 means permeability multiplier is 1, which means it uses the permeability defined in rock block. If USRX(2) and USRX(3) are not defined, I guess there are two possiblitiies: 1. they are taking the values defined in rock block, 2 they are taking both the values and multiplier of USRX(1) for this element. I am not sure which one it is. But you can do a simple two element test problem and print out permeabilities as Keurfon instructed. Please let us know what you find out. Thank you

    Yingqi

      • Flybear
      • 3 yrs ago
      • Reported - view

      Yingqi Zhang Keurfon Luu

      Hi, Dear Yingqi, Keurfon, Thanks for your keen help in my trouble. I have spent a few days in the code. Finally, it works.  

      If the intepretation on USRX(1)=-1 is multiplier is 1, it will take absoulte perm values in the element wise.  We can set the perm x, y, z, into USRX (2-4), and leave the USRX(5) = 0, and set the MOP(13) =1.  The model could work and display the magnitude of perm in the INCON and SAVE file. I hope this is the correct way to define the initial heterogeneous perm in TOUGH3. 

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Flybear It shouldn't work. As I said previously, USRX(4) is only used in the capillary pressure function ICP=11 and has nothing to do with the permeability.

      Element-by-element permeability should be set in USRX(1:3). How the values modify the permeability of a given element depends on its sign (positive: absolute permeability, negative: multiplier).

    • Flybear
    • 3 yrs ago
    • Reported - view

     After seting the MOP(13)=1, I paste the poro, perm, and primary variables in the element order in the INFILE. The output INCON and SAVE file will display the same perm and poro info.

    The only thing I am not positive is the USRX(1) = -1, I could not understand why make it equal to -1. 

    • Finsterle GeoConsulting
    • Stefan_Finsterle
    • 3 yrs ago
    • Reported - view

    Hi,

    USERX(1), USERX(2), and USERX(3) hold either element-by-element permeabilities or permeability modifiers related to ISOT=1, 2, and 3, respectively. If the value is negative e.g., USERX(1)=-2.5, then it is interpreted as a modifier, i.e., the permeability in the corresponding element is given by

    Perm(1)=|-2.5|*PER(NMAT,1)

    where PER(NMAT,1) is the material-specific permeability in block ROCKS. If the value is positive, e.g., USERX(1)=3e-12, it is interpreted as the permeability itself:

    Perm(1)=3E-12

    Note that in TOUGH2, PMX is always positive, and always interpreted as a modifier.

    In iTOUGH2, the scheme above is used, but iTOUGH2 automatically interprets large values (e.g., 2.5) as a modifier (i.e., internally stores it as -2.5). Not sure whether this last feature has been implemented in TOUGH3.

    I would not change this scheme! If you have modifiers, just provide them as negative numbers. If you have permeabilities themselves, provide them as positive numbers. Note that USERX(4) is interpreted as a modifier for the air-entry pressure, so changing the scheme would probably lead to unwanted results.

    I know this is all confusing - hope somebody can look into what TOUGH3 actually does.

    Stefan

    • Staff Scientist
    • Christine_Doughty
    • 3 yrs ago
    • Reported - view

    TOUGH3 implements both the TOUGH2 method and the iTOUGH2 method for element-by-element permeability.  If the material SEED is present in the ROCKS block, then the TOUGH2 method is used.  If not, the iTOUGH2 method is used.   However, whether or not SEED is present, a value of USERX(1)>1E-4 will be treated as a modifier and a positive value of USERX(1)<=1E-4 will be treated as an absolute permeability. 

    So watch out!  I was using SEED and I thought my modifier 1E-7 made permeability really small, but TOUGH3 thought it was an absolute permeability of 1E-7 m2, which is huge!  I think the safest thing to do is to not use SEED, and input modifiers as negative values, as Stefan recommends.

    See the TOUGH3 manual entry for parameter PMX in the ELEME block, a note on SEED in the ROCKS block, and a note in Appendix D, for more information on this topic.  However, I think some of the writing is a little unclear on whether it applies to the SEED or NO SEED case.  Hopefully, when we write the next version of the User's guide, it will be improved.  If there is interest, I could write up a summary of my experience studying element-by-element permeability and post it.

      • Flybear
      • 3 yrs ago
      • Reported - view

      Christine Doughty  Hi, Christine, I am a bit confused on setting anisotropy perm. I set the ISOT = 3, ( realized this does not means the three dimensional perm setting?), and then can we leave PMX blank, while defining three sets of values at USERX(1, 2, 3) to represent three directional absolute permeability? In my model results, this pressure results returns very homogenous radial distribution. So maybe this is not correct.

      I am reluctant to use PMX setting, as it is a single scalar. If I am wrong, can you introduce how you define heterogenity in perm in TOUGH3? Thank you.

    • Staff Scientist
    • Christine_Doughty
    • 3 yrs ago
    • Reported - view

    Yep, I think this is one of the most confusing aspects of preparing TOUGH3 input.

    Please read through the TOUGH3 User’s Guide carefully.  There are several ways to get anisotropy and heterogeneity in your model.  You need to understand what is described in the ROCKS block (PER1, PER2, PER3, SEED), the ELEME block (PMX, USERX(1,2,3), the CONNE block (ISOT), and the INCON block(USERX(1,2,3), and MOP2(20).  I will describe a few common scenarios.  If none of these apply to you, you can let me know specifically what you want.

    If you just want anisotropic permeability (different permeability in different directions), but not element-by-element permeability (local heterogeneity), then use the PER1, PER2, PER3 entries in the ROCKS block to specify three different permeabilities, where PER1 is used for a connection with ISOT=1, PER2 is used for a connection with ISOT=2, and PER3 is used for a connection with ISOT=3, and the ISOT values are read in the CONNE block.  Leave PMX in the ELEME block blank, leave USERX(1,2,3) blank in INCON and ELEME.  Do not have a material SEED in the ROCKS block.  The most common way anisotropy is used is when you want vertical permeability to be less than horizontal permeability, and you set up your mesh so that ISOT=3 represents vertical connections, then set PER3 less than PER1 and PER2.

    You can have overall anisotropy with PER1, PER2, PER3 and local heterogeneity with PMX.  PMX is a scalar multiplier, but it is applied to PER1, PER2, PER3, so you end up with an anisotropic, heterogeneous permeability field.

    Alternatively, you can leave PMX blank and use MOP2(20) and USERX(1,2,3) to modify permeability in each direction differently, if you need that functionality.  I never thought I would need it, but one example I can imagine is if most of your model has PER3=0.5*PER1 for moderate vertical/horizontal anisotropy, but for some elements USERX(3)=0.01*USERX(1) for extreme anisotropy.

    You should set up a simple test problem to practice with these options.  You can have two elements with one connection between them.  Make both elements huge (VOL=1E30) so their properties won’t change.  Assign different pressures with INCON, run one time step, and check the flow rate between the elements.  First, vary PER1, PER2, PER3 and the ISOT value of the connection to make sure you understand how that works.  Flow rate should be directly proportional to permeability.  Add PMX in the ELEME block or USERX(1,2,3) in ELEME or INCON and make sure flow rate changes how you expect.  When I vary permeability or modifiers, I use simple changes like a factor of 2 or 10, so I can see change in flow rate easily.

    WARNING:  There was a bug in the original TOUGH3 release, which made element-by-element permeability modification not work.  So you need to make sure you are using the corrected TOUGH3 executable.

    If you have the source code, check file MULTI.f90.  Near line 598 make sure the line just before “CALL HETERO” is USRX = USERX(ISO, nexidx(i)).  Note that anything after an exclamation point is a comment and is not actually used as code.  Uppercase/lowercase does not matter, but everything else does.    If you need to modify your code, see the TOUGH3 Forum article “Questions about TOUGH3 setup for 3D random permeability fields” posted about 6 months ago, for instructions on how to do so.  Or request a corrected source code from Yingqi Zhang (YQZhang@lbl.gov).

    If you just have the executable, use your simple test problem to verify that you have the corrected code.  If you see the same flow rate for cases with and without USERX(1,2,3), or if flow rate does not change in direct proportion to a permeability change, then you have the bug, and you should request a new executable from Yingqi.

    Good luck, and feel free to contact me directly at CADoughty@lbl.gov if you want more specific advice.  Christine

      • Jianhua_Jiang
      • 1 yr ago
      • Reported - view

      Christine Doughty Hi Christine, very helpful perm scenarios. I am currently encountered a similar problem in using TOUGH3 EOS7C with heterogeneous perm. I enter the 3D perm element-by-element in INCON (columns 31-60). I outputted the 3D perm. The model seems accepting the 3D perm and outputted the same values as I entered in INCON. However, if I changed the perm in INCON without touching the perm1, perm2 and perm3 specified in ROCKS block, the model results didn't reflect the changes. I am thus impressed that the model is still using the perm values specified in ROCKS block, rather than the element-by-element values in INCON. I tried to leave the perm1, perm2 and perm3 in ROCKS block blank. But the model crashed. Your quick response and kind help will be deeply appreciate.

      • Staff Scientist
      • Christine_Doughty
      • 1 yr ago
      • Reported - view

      Jianhua Jiang 

      If you have the source code, check that the bug in MULTI.f90 has been fixed (see my previous post and the TOUGH Bugs and Fixes (https://tough.lbl.gov/user-support/tough-bugs-fixes/) item #9 ). If you just have the executable, and you do not know whether the fix has been made or not, request a new executable from Yingqi Zhang (yqzhang@lbl.gov).

      Assuming you have a fixed code, make sure that the first entry in the INCON block has a non-zero value in col 31-40, as this acts as a flag to use the permeability modifiers.  There are several ways to use the code, but I prefer to not have a material type SEED in the ROCKS block and to read permeability modifiers as negative numbers.  If you want anisotropic permeability modifiers, you need to set MOP2(20) to 1 or 2 (see users guide) and you cannot have SEED.

      The permeability modifiers you input in INCON need the perm1, perm2, perm3 values in the ROCKS block to multiply by, so it makes sense that the code crashes if you leave them blank (which the code interprets as zero).

      If the code is still not working, create a simple input file with just a few elements, and send it to me and I will see if I can figure out what is happening.

      • Jianhua_Jiang
      • 1 yr ago
      • Reported - view

      Christine Doughty Hi Christine, Our just organization purchased the executable recently. So I believe that we got the version with the bug you mentioned fixed. I outputted the absolute permeability and got the exact same values I entered in INCON. This implies that the bug was fixed in our executable otherwise I would got the absolute permeabilities as entered in the ROCKS block. However, the model results didn't respond to the significant permeability changes made in INCON.

      I entered the absolute permeabilities element-by-element (perm1, perm2, perm3) in INCON column 31-60. attached are my model setup files

      • Staff Scientist
      • Christine_Doughty
      • 1 yr ago
      • Reported - view

      Jianhua Jiang 

      Unfortunately, the bug is such that TOUGH does think it is using the correct permeability, so if you use the OUTPU block to request that permeability be shown for each block, it will show you what you expect.  However, it will not use that permeability in the simulation.  I learned this the hard way, by staring at the output file and saying, "how can that permeability give me this flow rate?" over and over, until I made a really simple problem with just a few elements, as suggested in my previous post.  Then I became convinced that the permeabilities shown were not being used.  Then Yingqi tracked down the bug in the code.  I will ask her to send you a corrected version, just in case.

      In the meantime, the files you sent me are too complicated for me to test without a lot of effort, since I won't know what to look for if I try different permeabilities. But I did try changing the pressure in element A91 1, running 5 steps, and looking for flow between A91 1 and A91 2, a connection with isot=1.  Since PERM1=0 for material atmos (which A91 1 ad A91 2 are), there should be no flow if the ROCK permeabilities are being used.  There is flow for your original INCON file, which specifies non-zero usrx(1) for A91 1 and A91 2, so something is happening.  When I modify your INCON to remove usrx(1) for the first element, all the permeability modifiers are disabled (according to the SAVE file), and flow between A91 1 and A91 2 is zero, which is what is supposed to happen.  You can try those simple runs and let me know what happens. But I think you should set up a two-element problem as described in the previous post, and do quantitative tests, like multiply PERM1 by a factor of 10 and look for a factor of 10 increase in flow, then keep PERM1 fixed and multiply usrx(1) by 10 and check the flow, etc. 

      I guess this exchange is getting too detailed for the forum, so we should probably switch to email.

      • Jianhua_Jiang
      • 1 yr ago
      • Reported - view

      Christine Doughty Hi Christine, This is exactly what happened in my case. The model didn't use the permeabilities as shown in output file. This is implies that my executable is out of date.

      Thanks a lot for tracking down the issue in the atmos element. I'll test and make correction as you suggested.

Content aside

  • 1 yr agoLast active
  • 18Replies
  • 282Views
  • 6 Following