0

Specifying material types for stratified heterogeneous reservoir

Dears,

I am trying to model CO2 injection in heterogeneous aquifer that is composed of 23 layers with different porosity, permeability, and capillary pressure data. I have defined 23 material types corresponding to the reservoir layers. I find a problem to specify the material types to the corresponding grid cells in my model. The model is 2D (79*120).  So I need to define the material type for every cell manually which is very difficult task. I wonder if there is easy way to do that!.

 

Thanks in advance

7 replies

null
    • Keurfon_Luu
    • 3 yrs ago
    • Reported - view

    You can write a program or script to automate this task. toughio can do that:

    import toughio
    
    # Read file with block ELEME (e.g. MESH)
    parameters = toughio.read_input("MESH")
    
    # Loop over elements
    for label, element in parameters["elements"].items():
        x, y, z = element["centers"]
    
        # Assign material name depending on element's depth
        if 0.0 >= z > -10.0:
            element["material"] = "mat01"
        elif -10.0 >= z > -20.0:
            element["material"] = "mat02"
        elif -20.0 >= z > -30.0:
            element["material"] = "mat03"
        # and so on
    
    # Write your file back with modified materials
    toughio.write_input("MESH")  # Make sure to have a copy of the original file!
    

    Note that if you create your mesh directly with toughio, you can automatically assign materials that are within a specific boxed domain (see https://tough.forumbee.com/t/60h36fd?r=x2h3l0f).

      • Refaat_G_Hashish
      • 3 yrs ago
      • Reported - view

      Keurfon Luu Thanks for your reply. I find the following message error during running the code.

      • Refaat_G_Hashish
      • 3 yrs ago
      • Reported - view

      Keurfon Luu Attached is the Mesh file.

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Refaat G Hashish My bad. It should be "center" rather than "centers".

      • Refaat_G_Hashish
      • 3 yrs ago
      • Reported - view

      Keurfon Luu I have run it again however I find the following error message.

      • Refaat_G_Hashish
      • 3 yrs ago
      • Reported - view

      Keurfon Luu I have the problem solved. The last line has to be as follow.

      toughio.write_input("MESH", parameters)  # Make sure to have a copy of the original file!

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Refaat G Hashish Sorry, my bad again. I need more sleep.

Content aside

  • 3 yrs agoLast active
  • 7Replies
  • 100Views
  • 2 Following