1

Mesh

After write a code for mesh in notepad

How do run it

15 replies

null
    • Mikey_Hannon
    • 5 yrs ago
    • Reported - view

    Hey Dilan,

    You would call the file “MESH” and copy it into the directory with your other TOUGH input files. Make sure your main TOUGH input file does not contain an ELEME or CONNE block. Otherwise, it’ll write the information from those blocks over the file you generate once you attempt to run a simulation.

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Mikey Hannon 

      Here are the contents of Meshmaker (This makes a radial grid with radius 224m and depth 10m, 

      RZ2DL
      RADII
          3
          0.0e00    5.0e-2    7.0e-2                                                   
      LOGAR
         30          1.0e2    7.0e-2
      RADII
          1
         5.001e2      
      LAYER
          1
          1.0e01  

      I fail to  understand why RADII
          1
         5.001e2  (500.1 ) is mentioned here, Wht is the logic through which this value is inputted in the meshmaker file?

      someone please shed some light on this??

    • Mikey_Hannon
    • 5 yrs ago
    • Reported - view

    I see.  I misunderstood your first question.  I now understand that you were attempting to generate a MESH file using meshmaker.  In order to run this, you will need to create an input file with a title line, followed by a line beginning with the MESHM (the meshmaker keyword).  After that, you'll paste the contents you provided in your previous message.  At the end of this, you'll leave a blank line after 1.0e01.  On the following line you'll enter the keyword ENDFI, which informs TOUGH that you won't be running a simulation.  Once you run this file, you should receive a file called MESH containing the mesh you're trying to generate.

    It looks like this will create elements with radii of 0.005 m, followed by one with a radius of 0.007 m (perhaps a well casing?) followed by 30 logarithmically spaced cylindrical elements out to 100 m, followed by a single element from spanning 100 m to 500.1 m.  The reason for the final radius (500.1 m) may be to stipulate a Dirichlet boundary at a location far from your injection well.  If you wanted to ensure that the outer extend of your reservoir maintains its initial conditions far from the injector, you'll make the volume of the final element (between 100 m to 500.1 m) very large in the ELEME list.  But I really can't be certain the intentions of the inputs.

    You can find more details about setting up meshmaker in the TOUGH Manual (Appendix F, pg. 177).

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Mikey Hannon Oh thank you so much for the detailed reply

      i have read the manual and i know the purpose of 500.1 and 100 now, but one question which is perplexing me is :

      How does this meshmaker file create a mesh with Radius of 224m ?

      it is stated in tutorial and test file that this meshmaker entries create a cylindrical grid with radius 224m and depth 10m

      i understand depth, 10 

      i don't understand, how radius 224 m is formed ? i am perplexed....!!!!😥🥶

      • Mikey_Hannon
      • 5 yrs ago
      • Reported - view

      telegramboy I can't recall if the the location of the central node for the last element (from 100 m to 500.1 m) will be located halfway between the two boundaries (or at (100 + 500.1)/2 = 300.05 m) or if it'll be logarithmically centered between the two boundaries.  If the latter, the location comes out as approximately 224.0 m (= 10^( 0.5*(log(100) + log(500.1)) ) ).  One way to tell for sure is to generate the mesh with this input (using the procedure I described in my previous comment) and check the X value of the final element in the ELEME block.  I'd be curious to see which it would be, so let me know once you run it.

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Mikey Hannon Damn right ...223.6m You are a genius man...thanks a ton for this mighty help

      here is the meshmaker file i ran...exactly 223.6~224m

      Meshmaker test: Cylindrical grid
      1600  400  5 'Old' 'm' .FALSE.          ! MaxNum_Elem, Longest, ElemNameLength, FormatType, LengthUnits, media_by_number 
      RZ2DL
      RADII
          3
          0.0e00    5.0e-2    7.0e-2  
      LOGAR
         30          1.0e2    7.0e-2
      RADII
          1
         5.001e2      
      LAYER
          1
          1.0e01  
         

      ====> ====> ====> ====>

      and this is the result...

      ELEME ---    33    4    0   30   0.00000   500.100
      A0000              10.0000E+001.5708E-02          0.0000E+00           1.000E+01 
      A0001              10.0000E+001.5080E-02          5.9161E-02           1.000E+01 
      A0002              10.0000E+001.1827E-01          1.0383E-01           1.000E+01 
      A0003              10.0000E+002.5911E-01          1.9813E-01           1.000E+01 
      A0004              10.0000E+004.7979E-01          3.0954E-01           1.000E+01 
      A0005              10.0000E+008.1908E-01          4.4266E-01           1.000E+01 
      A0006              10.0000E+001.3335E+00          6.0216E-01           1.000E+01 
      A0007              10.0000E+002.1054E+00          7.9344E-01           1.000E+01 
      A0008              10.0000E+003.2544E+00          1.0229E+00           1.000E+01 
      A0009              10.0000E+004.9541E+00          1.2983E+00           1.000E+01 
      A0010              10.0000E+007.4561E+00          1.6289E+00           1.000E+01 
      A0011              10.0000E+001.1125E+01          2.0256E+00           1.000E+01 
      A0012              10.0000E+001.6487E+01          2.5017E+00           1.000E+01 
      A0013              10.0000E+002.4304E+01          3.0732E+00           1.000E+01 
      A0014              10.0000E+003.5677E+01          3.7592E+00           1.000E+01 
      A0015              10.0000E+005.2195E+01          4.5825E+00           1.000E+01 
      A0016              10.0000E+007.6152E+01          5.5708E+00           1.000E+01 
      A0017              10.0000E+001.1086E+02          6.7570E+00           1.000E+01 
      A0018              10.0000E+001.6109E+02          8.1808E+00           1.000E+01 
      A0019              10.0000E+002.3374E+02          9.8899E+00           1.000E+01 
      A0020              10.0000E+003.3874E+02          1.1941E+01           1.000E+01 
      A0021              10.0000E+004.9041E+02          1.4404E+01           1.000E+01 
      A0022              10.0000E+007.0941E+02          1.7359E+01           1.000E+01 
      A0023              10.0000E+001.0255E+03          2.0907E+01           1.000E+01 
      A0024              10.0000E+001.4816E+03          2.5165E+01           1.000E+01 
      A0025              10.0000E+002.1395E+03          3.0276E+01           1.000E+01 
      A0026              10.0000E+003.0884E+03          3.6411E+01           1.000E+01 
      A0027              10.0000E+004.4568E+03          4.3775E+01           1.000E+01 
      A0028              10.0000E+006.4296E+03          5.2614E+01           1.000E+01 
      A0029              10.0000E+009.2737E+03          6.3223E+01           1.000E+01 
      A0030              10.0000E+001.3373E+04          7.5958E+01           1.000E+01 
      A0031              10.0000E+001.9282E+04          9.1243E+01           1.000E+01 
      A0032              10.0000E+001.5086E+06          2.2363E+02           1.000E+01 

      CONNE
      A0000A0001                   15.0000E-029.1608E-030.0000E+00
      A0001A0002                   11.0839E-023.3834E-020.0000E+00
      A0002A0003                   15.0188E-024.4110E-020.0000E+00
      A0003A0004                   15.6743E-025.4665E-020.0000E+00
      A0004A0005                   16.6390E-026.6729E-020.0000E+00
      A0005A0006                   17.8574E-028.0923E-020.0000E+00
      A0006A0007                   19.3486E-029.7798E-020.0000E+00
      A0007A0008                   11.1155E-011.1795E-010.0000E+00
      A0008A0009                   11.3333E-011.4208E-010.0000E+00
      A0009A0010                   11.5954E-011.7099E-010.0000E+00
      A0010A0011                   11.9104E-012.0566E-010.0000E+00
      A0011A0012                   12.2890E-012.4724E-010.0000E+00
      A0012A0013                   12.7436E-012.9714E-010.0000E+00
      A0013A0014                   13.2894E-013.5701E-010.0000E+00
      A0014A0015                   13.9448E-014.2887E-010.0000E+00
      A0015A0016                   14.7315E-015.1511E-010.0000E+00
      A0016A0017                   15.6760E-016.1862E-010.0000E+00
      A0017A0018                   16.8097E-017.4286E-010.0000E+00
      A0018A0019                   18.1706E-018.9198E-010.0000E+00
      A0019A0020                   19.8041E-011.0710E+000.0000E+00
      A0020A0021                   11.1765E+001.2858E+000.0000E+00
      A0021A0022                   11.4118E+001.5437E+000.0000E+00
      A0022A0023                   11.6943E+001.8532E+000.0000E+00
      A0023A0024                   12.0334E+002.2247E+000.0000E+00
      A0024A0025                   12.4405E+002.6707E+000.0000E+00
      A0025A0026                   12.9290E+003.2059E+000.0000E+00
      A0026A0027                   13.5154E+003.8484E+000.0000E+00
      A0027A0028                   14.2193E+004.6196E+000.0000E+00
      A0028A0029                   15.0642E+005.5452E+000.0000E+00
      A0029A0030                   16.0784E+006.6563E+000.0000E+00
      A0030A0031                   17.2956E+007.9899E+000.0000E+00
      A0031A0032                   18.7567E+001.2363E+020.0000E+00

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Mikey Hannon its exactly logarithmic value mean

      However, I need one final advice from you

      How can I visualize this mesh, Is there any software, utility, or do I have to code it myself?

      a few pointers..please..

      • Mikey_Hannon
      • 5 yrs ago
      • Reported - view

      telegramboy That's a long answer, but you can get a good start here.  For simpler meshes like this one, "coding it yourself" isn't so bad, depending on your fluency with a scripting language like MATLAB or Python.

      • Uzoma_Ajugwe
      • 1 yr ago
      • Reported - view

      Hi Mikey. I am pretty much new to ToughReact, and I just stumbled on this gem. How do I create a mesh from scratch? When you talk about creating an input file, do you mean the flow.inp? is there a seperate software for creating a mesh? Pls help.

    • Reservoir Engineer
    • Alfredo_b
    • 5 yrs ago
    • Reported - view

    I used the reported input for MeshMaker to build the grid using the standard TOUGH2 V.2.0  internal grid generator (MESHM keyword in  TOUGH2 input file).

    Actually the produced MESH file is different than that generated by MeshMaker:

    ELEME ---    33    4    0   30   0.00000   500.100
    A1  1              10.7854E-010.1571E-01          0.2500E-01          -.5000E+01
    A1  2              10.7540E-010.1508E-01          0.6000E-01          -.5000E+01
    A1  3              10.5913E+000.1183E+00          0.1120E+00          -.5000E+01
    A1  4              10.1296E+010.2591E+00          0.2044E+00          -.5000E+01
    A1  5              10.2399E+010.4798E+00          0.3154E+00          -.5000E+01
    A1  6              10.4095E+010.8191E+00          0.4486E+00          -.5000E+01
    A1  7              10.6668E+010.1334E+01          0.6084E+00          -.5000E+01
    A1  8              10.1053E+020.2105E+01          0.8003E+00          -.5000E+01
    A1  9              10.1627E+020.3254E+01          0.1031E+01          -.5000E+01
    A1 10              10.2477E+020.4954E+01          0.1307E+01          -.5000E+01
    A1 11              10.3728E+020.7456E+01          0.1639E+01          -.5000E+01
    A1 12              10.5562E+020.1112E+02          0.2037E+01          -.5000E+01
    A1 13              10.8243E+020.1649E+02          0.2515E+01          -.5000E+01
    A1 14              10.1215E+030.2430E+02          0.3089E+01          -.5000E+01
    A1 15              10.1784E+030.3568E+02          0.3778E+01          -.5000E+01
    A1 16              10.2610E+030.5219E+02          0.4605E+01          -.5000E+01
    A1 17              10.3808E+030.7615E+02          0.5597E+01          -.5000E+01
    A1 18              10.5543E+030.1109E+03          0.6788E+01          -.5000E+01
    A1 19              10.8055E+030.1611E+03          0.8218E+01          -.5000E+01
    A1 20              10.1169E+040.2337E+03          0.9934E+01          -.5000E+01
    A1 21              10.1694E+040.3387E+03          0.1199E+02          -.5000E+01
    A1 22              10.2452E+040.4904E+03          0.1447E+02          -.5000E+01
    A1 23              10.3547E+040.7094E+03          0.1743E+02          -.5000E+01
    A1 24              10.5127E+040.1025E+04          0.2100E+02          -.5000E+01
    A1 25              10.7408E+040.1482E+04          0.2527E+02          -.5000E+01
    A1 26              10.1070E+050.2140E+04          0.3041E+02          -.5000E+01
    A1 27              10.1544E+050.3088E+04          0.3657E+02          -.5000E+01
    A1 28              10.2228E+050.4457E+04          0.4396E+02          -.5000E+01
    A1 29              10.3215E+050.6430E+04          0.5284E+02          -.5000E+01
    A1 30              10.4637E+050.9274E+04          0.6349E+02          -.5000E+01
    A1 31              10.6687E+050.1337E+05          0.7628E+02          -.5000E+01
    A1 32              10.9641E+050.1928E+05          0.9163E+02          -.5000E+01
    A1 33              10.7543E+070.1509E+07          0.3000E+03          -.5000E+01

    Looking also at the grid info printed in the standard TOUGH2 output, it seems that the grid built by TOUGH2 is actually representing what was intended, i.e. a logarithmic grid from 0.07 m till the radius of 100.0 m, and then a single element from 100.0 m to 500.1 m, with the node at a radius of 300.05 m.

     * * * * * M E S H  G E O M E T R Y * * * * *          VOLUME AND AREA ARE GIVEN FOR HEIGHT = 1 METER

     ELEM     REL           RCON           D              V             A

        1   0.25000E-01   0.50000E-01   0.25000E-01   0.78540E-02   0.31416E+00
        2   0.60000E-01   0.70000E-01   0.10000E-01   0.75398E-02   0.43982E+00
        3   0.11201E+00   0.15402E+00   0.42011E-01   0.59133E-01   0.96775E+00
        4   0.20445E+00   0.25487E+00   0.50426E-01   0.12955E+00   0.16014E+01
        5   0.31540E+00   0.37593E+00   0.60527E-01   0.23990E+00   0.23620E+01
        6   0.44858E+00   0.52123E+00   0.72652E-01   0.40954E+00   0.32750E+01
        7   0.60844E+00   0.69564E+00   0.87205E-01   0.66675E+00   0.43708E+01
        8   0.80031E+00   0.90499E+00   0.10467E+00   0.10527E+01   0.56862E+01
        9   0.10306E+01   0.11563E+01   0.12564E+00   0.16272E+01   0.72650E+01
       10   0.13071E+01   0.14579E+01   0.15081E+00   0.24770E+01   0.91601E+01
       11   0.16389E+01   0.18199E+01   0.18102E+00   0.37280E+01   0.11435E+02
       12   0.20372E+01   0.22545E+01   0.21728E+00   0.55623E+01   0.14165E+02
       13   0.25153E+01   0.27761E+01   0.26080E+00   0.82433E+01   0.17443E+02
       14   0.30891E+01   0.34021E+01   0.31304E+00   0.12152E+02   0.21376E+02
       15   0.37779E+01   0.41536E+01   0.37575E+00   0.17838E+02   0.26098E+02
       16   0.46047E+01   0.50557E+01   0.45101E+00   0.26097E+02   0.31766E+02
       17   0.55970E+01   0.61384E+01   0.54136E+00   0.38076E+02   0.38569E+02
       18   0.67882E+01   0.74380E+01   0.64980E+00   0.55429E+02   0.46734E+02
       19   0.82179E+01   0.89979E+01   0.77996E+00   0.80546E+02   0.56535E+02
       20   0.99341E+01   0.10870E+02   0.93620E+00   0.11687E+03   0.68300E+02
       21   0.11994E+02   0.13118E+02   0.11237E+01   0.16937E+03   0.82421E+02
       22   0.14467E+02   0.15815E+02   0.13488E+01   0.24521E+03   0.99371E+02
       23   0.17434E+02   0.19053E+02   0.16190E+01   0.35470E+03   0.11972E+03
       24   0.20997E+02   0.22940E+02   0.19433E+01   0.51275E+03   0.14414E+03
       25   0.25273E+02   0.27605E+02   0.23326E+01   0.74080E+03   0.17345E+03
       26   0.30405E+02   0.33205E+02   0.27998E+01   0.10698E+04   0.20863E+03
       27   0.36566E+02   0.39926E+02   0.33607E+01   0.15442E+04   0.25086E+03
       28   0.43960E+02   0.47994E+02   0.40339E+01   0.22284E+04   0.30156E+03
       29   0.52836E+02   0.57678E+02   0.48419E+01   0.32148E+04   0.36240E+03
       30   0.63490E+02   0.69301E+02   0.58118E+01   0.46368E+04   0.43543E+03
       31   0.76277E+02   0.83253E+02   0.69760E+01   0.66867E+04   0.52310E+03
       32   0.91627E+02   0.10000E+03   0.83733E+01   0.96412E+04   0.62832E+03
       33   0.30005E+03   0.50010E+03   0.20005E+03   0.75430E+06   0.31422E+04

    So, apparently MeshMaker is building a different grid than what would be expected for TOUGH2. Is there any special option involved in the MeshMaker run?

    Alfredo

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Alfredo Battistelli Yes you are right in the fact that TOUGH2 mesh generator is producing a different grid

      Apparently, it looks like the difference between Meshmaker v 1.5 and Tough2.0 is "How these calculate the middle node point that lies between 100 & 500.1"

      TOUGH2: using mean arithmetic 300 m = (100+500.1)/2

      Meshmaker: Logarithmic Mean: 224.0 m (= 10^( 0.5*(log(100) + log(500.1)) ) )

      anyways, I think its better to generate mesh using the inbuilt mesh software you are using, Avoid using Meshmaker,...ITS Really confusing sometimes

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Alfredo Battistelli I am using Hydrateressim which models Hydrate dissociation, its basically TOUGH+Hydrate predecessor

      The problem i am facing is grid independency test failure

      I run the problem with 10 grids and it shows progression of dissociation front

      I run with 20 grids, it shows no dissociation at all

      i run with 30 grids, it shows only little dissociation

      i am perplexed???? what to do? should I abandon git or what??

      the files are attached here, all test files are "Test_1Pk" (Depressurization kinetic)

      attached pairs:

      Test files +plot data (3 column for hydrate dissocation progression) 

      if you want the software email me: telegramkik@gmail.com

    • Mikey_Hannon
    • 5 yrs ago
    • Reported - view

    Depending on the problem you’re setting up (which I admittedly haven’t looked into yours in great detail), I would expect some changes in the simulation output with different mesh resolutions.  I don’t know if this will solve your specific problem, but the standard way to look into “grid independence” is to keep adding resolution to your mesh until the solution stops changing.

      • Castleberry
      • 5 yrs ago
      • Reported - view

      Mikey Hannon Thanks a lot for the comments

      I think maybe the problem is with the way Hydrateresim needs its mesh file(Its quite old version)

      Its successor (Tough+Hydrate) is much more updated and i ran the same grids and got GRID INDEPENDENCE STUDY....

      so i think its probably due to mesh problem...and comments about meshmaker inour previous thread discussion....add weight to this....maybe i m wrong

      i'll try to keep working on getting GIT with Hydrateressim and update if i succeed

    • Uzoma_Ajugwe
    • 1 yr ago
    • Reported - view

    Hello Dilan:

    Did you get clarity on this? Are you available for a brief Meeting on Teams or Zoom?

Content aside

  • 1 Likes
  • 1 yr agoLast active
  • 15Replies
  • 218Views
  • 5 Following