2

Hello guys . Does anybody know how to simulate the deformation of the soil caused by fluidflow in both TOUGH and FLAC3D? Thanks

84 replies

null
    • Keurfon_Luu
    • 4 yrs ago
    • Reported - view

    Unfortunately, it is not as straightforward as it sounds.

    The "easiest" way that does not require access to TOUGH source code is to make FLAC3D call TOUGH at each time step and import the pressure and temperature from TOUGH into FLAC. For two-way coupling (stress-induced porosity/permeability changes), you should update TOUGH input files before calling TOUGH in FLAC3D.

      • Floriane_Youzan
      • 4 yrs ago
      • Reported - view

      Keurfon Luu can you please be more explicit ?

      • Keurfon_Luu
      • 4 yrs ago
      • Reported - view

      Floriane Youzan I didn't try the FLACTOUGH (FLAC calling TOUGH) implementation myself. I am suggesting it since the current implementation of TOUGHFLAC (TOUGH calling FLAC) alters TOUGH source code a lot which requires a really good knowledge of the Fortran language. It's even more complicated with TOUGH3 since you should now also consider that arrays are distributed in parallel. However, the TOUGHFLAC implementation is more optimized as it does not require to read and write TOUGH input/output files at each time step.

      Assuming that you have already setup your problem for TOUGH and FLAC3D independently, a quick algorithm would look like as below:

      1. Solve the mechanical state in FLAC3D to a time step Dt,

      2. Calculate stress-induced changes in porosity and/or permeability and update TOUGH input files (MESH and/or INCON) with these new values,

      3. Solve fluid and heat flow in TOUGH to time step Dt,

      4. Import pressure and temperature from SAVE file and update zone pore pressure and temperature in FLAC3D,

      5. Loop back to step 1 until end of simulation.

      FLAC3D has a Python interface which should make this a bit easier to implement compared to using FISH. For instance, you can call an external program in Python as follow:

      import subprocess
      
      subprocess.call(["tough3-eco2n", "INFILE"], shell=True)
      

      To update a zone pore pressure and temperature, I don't remember if there is a zone array for these properties, but you can loop over each zone and update the parameters as follow:

      import itasca as it
      
      for zone in it.zone.list():
          # Interpolate my_pp and my_temp from SAVE file
          zone.set_pp(my_pp)
          zone.set_temp(my_temp)
      

      Reading TOUGH input and output files can be done using toughio. You can install toughio in FLAC3D by running this command in a Windows console:

      cmd /C ""C:/Program Files/Itasca/FLAC3D700/exe64/python36/Scripts/pip.exe"" install toughio --user
      • Floriane_Youzan
      • 4 yrs ago
      • Reported - view

      Keurfon Luu Thank you

      • Floriane_Youzan
      • 4 yrs ago
      • Reported - view

      Keurfon Luu i am trying to solve the mechanical State in FLAC3D but I am not sure how to do it ! I found an example on FLAC about Groundwater but I am not sure it’s appropriate 

      • Keurfon_Luu
      • 4 yrs ago
      • Reported - view

      Floriane Youzan Not sure about what you are asking. Assuming that your mesh is generated (with all zone groups assigned if necessary), you simply have to assign constitutive models and properties to your zones, initialize the initial and boundary stress conditions (e.g. roller at the bottom) and then solve the mechanical state to equilibrium.

      • Floriane_Youzan
      • 4 yrs ago
      • Reported - view

      Keurfon Luu i am fairly new at FLAC3D so when you say solve nechanical state to DT , I don’t really know how to do it. Can you please recommend me an example in the FLAC manual that I can follow ? 
      thanks

      • Keurfon_Luu
      • 4 yrs ago
      • Reported - view

      Floriane Youzan I've attached a sample FLAC3D script. It shows the main commands to set up your model in FLAC3D.

      • Floriane_Youzan
      • 4 yrs ago
      • Reported - view

      Keurfon Luu thank youuu so much. May God bless you!!!

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Floriane Youzan hey, the .dat file you sent me previously, can you please tell me the mesh size you used ? I just wanna compare something.

      Thanks 

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu 

      hey, the .dat file you sent me previously, can you please tell me the mesh size you used ? I just wanna compare something.

      Thanks 

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan It's a 2D model (extruded to 3D):

      xlim = [-350000.0, 350000.0]

      zlim = [-3000.1, 0.0]

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu hello, this is the error I get when I try to run the model:

      Model is not current configured for FluidModule, see the MODEL CONFIGURE command.

      While processing line 4 of source C:/Users/LabUser/Documents/Itasca/flac3d700/My Projects/try.dat. Do you know what is it about?

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan Sorry for the late reply.

      I never encountered this issue. Could you send me your script?

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu no problem ! I just used the dat.file you sent me and changed the dimension of the mesh that’s it

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan I am not sure what Line 4 is... is it the command

      model configure fluid

      that does not work?

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu 

      ; Load mesh
      zone import '../mesh.f3grid'

      ; Hydraulic parameters
      zone fluid cmodel assign isotropic
      zone fluid property biot 1.0
      zone fluid property permeability 1.0e-17
      zone fluid property porosity 0.01
      zone gridpoint initialize fluid-modulus 1.0

      ; Mechanical parameters
      zone cmodel assign elastic
      zone property young 5e9
      zone property poisson 0.25

      ; Thermal parameters
      zone thermal cmodel assign isotropic
      zone thermal property conductivity 1.8
      zone thermal property expansion 0.0
      zone thermal property specific-heat 1500

      ; In situ stress
      zone initialize stress-xx 0.0 gradient 0 0 22170.6
      zone initialize stress-yy 0.0 gradient 0 0 22170.6
      zone initialize stress-zz 0.0 gradient 0 0 22170.6
      zone initialize density 2260
      model gravity 0 0 -9.81

      ; In situ pressure and temperature
      zone gridpoint initialize pore-pressure 1.e5 gradient 0 0 -9810.0
      zone gridpoint initialize temperature 10.0 gradient 0 0 -0.025

      ; Mechanical boundaries
      zone gridpoint fix velocity-y
      zone gridpoint fix velocity-z range position-z -3000.1
      zone gridpoint fix velocity-x range position-x -350000.0
      zone gridpoint fix velocity-x range position-x 350000.0

      ; Disable large strain (only FLAC3D v7)
      model large-strain off

      ; Solve model for mechanical equilibrium
      model solve mech ratio 1.0e-8

       

      I used the exact same script but I changed the mesh to mine that's what I did

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan You have to call

      model configure fluid

      before using

      zone fluid something

      Same for thermal, you have to call

      model configure thermal

      before using

      zone thermal something

      See my original script.

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu I thought that is what I did. when you say call you mean write that before I execute the whole code

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan Put it at the beginning of the script. In my original sample script, it starts with

      model configure fluid
      model configure thermal
      
      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu hello, I am a little but lost. the mechanical boundaries yoou have in your data file. does it match your mesh? I mean I cant just use it for my mesh right? I have to change it around right

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan Of course.

      In my sample problem, I applied roller boundary conditions everywhere except at the surface. To do so, I prevent lateral grid points from moving horizontally:

      zone gridpoint fix velocity-x range position-x -350000.0
      zone gridpoint fix velocity-x range position-x 350000.0

      And grid points at the bottom of the mesh from moving vertically:

      zone gridpoint fix velocity-z range position-z -3000.1

      Since the sample problem is invariant in y, I fixed the velocity along the Y axis:

      zone gridpoint fix velocity-y
      

      but you shouldn't do that if your mesh is 3D.

      Note that the mesh is 2D (XZ plane) with x in the range [-350000.0, 350000.0] and z in the range [-3000.1, 0.0].

      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu okay thank you. Like I told you earlier I am trying to use both tough and flac for the simulation. I already solved it in TOUGH to the equilibrium state and I got some data from the SAVE file . However I don’t really know how to use the information I got From Tough in FLAC To solve the problem to equilibrium there too. Do you have an idea?

      • Keurfon_Luu
      • 3 yrs ago
      • Reported - view

      Floriane Youzan You can read your SAVE file in FLAC3D using toughio.

      save = toughio.read_output("SAVE")

      This returns a namedtuple with a data dictionary that contains the primary variables X1, X2 ... up to X4. The number of primary variables and their meanings depend on the EOS you are using. For instance, for EOS3, X1 corresponds to pressure (or gas pressure if two-phase) and X3 to temperature. You can then update FLAC3D zones' pressures and temperatures using the instruction:

      for i, zone in enumerate(it.zone.list()):
          zone.set_pp(save.data["X1"][i])
          zone.set_temp(save.data["X3"][i])
      
      • Floriane_Youzan
      • 3 yrs ago
      • Reported - view

      Keurfon Luu I am having trouble running the python code because I have to pip install toughio which I did but it is not working. I attached the error

Content aside

  • 2 Likes
  • 1 yr agoLast active
  • 84Replies
  • 834Views
  • 6 Following