Code Monkey home page Code Monkey logo

rough_surfaces's Introduction

rough_surfaces

A Python3 module for the analysis, elastic contact and fluid flow simulation of rock fractures.

Platform CI Status Coverage
Linux, Python 3.6 Build Status codecov

Install/Contribute

Clone the repo and cd into it using a virtual environment

git clone https://github.com/plang85/rough_surfaces.git
cd rough_surfaces
python3 -m venv venv
source venv/bin/activate

and verify that the tests are passing

pip install -e .[test] 
pytest

do some damage and just PR against master.

To just use the module, it's still good practice to checkout the repo and use a venv, but then just do

pip install .

instead. As you can see recommenden practice is to use the head at all times (if you're adventureous).

Examples

Generation

We can generate an isotropic, self-affine surface like this

import rough_surface.params as rp
import rough_surface.generate as rg

surface_params = rp.SelfAffineParameters()()
N_power_of_two = 9
surface = rg.self_affine(surface_params, N_power_of_two)

where surface is essentially a two-dimensional numpy array with a lattice size attribute dxy.

Analysis

See example_analysis.py for a more complete overview and the provided plotting functions. In short, given a two-dimensional array h that represents discrete surface height uniformly spaced by dxy, the radially averaged power-spectrum can be obtained like this (this API is in flux)

import rough_surfaces.analyse as ra

spectrum = ra.radially_averaged_psd(surface)
invariants = ra.self_affine_psd_fit(*surface_spectrum)
print('Hurst = {0:.2f}'.format(invariants[1]))

An isotropic surface is characterized by a near-ideal straight line radially averaged PSD and same-slope curves for the angularly averaged spectra.


An anisotropic surface is characterized by a less linear radially averaged PSD and different-slope curves for the angularly averaged spectra.


Contact (elastic frictionless)

We can solve the elastic frictionless contact between two rough surfaces by solving the equivalent problem of a rigid composite surface against an elastic, flat body of composite properties

import rough_surfaces.contact as rc

nominal_stress = 1.0E7
E = 1.0E+9
nu = 0.3
contact = rc.contact_FFT(composite_surface, nominal_stress, E, nu, verbose=1)

For a more detailed snippet see example_analysis.py.



We can also use a high-level function to compute the stiffness over a range of stresses

nominal_stress = np.logspace(6, 8, 15)
stiffness = rc.stiffness(nominal_stress, surface, E, nu, err_lim=1.0E-8)


Flow (steady-state laminar flow fluid pressure)

Working on porting this still...

Publications

Lang, P. S., Paluszny, A., & Zimmerman, R. W. (2015). Hydraulic sealing due to pressure solution contact zone growth in siliciclastic rock fractures. Journal of Geophysical Research: Solid Earth, 120(6), 4080โ€“4101. http://doi.org/10.1002/2015JB011968

Lang, P. S., Paluszny, A., & Zimmerman, R. W. (2016). Evolution of fracture normal stiffness due to pressure dissolution and precipitation. International Journal of Rock Mechanics and Mining Sciences, 88, 12โ€“22. http://doi.org/10.1016/j.ijrmms.2016.06.004

Lang, P. S. (2016). Multi-scale modelling of coupled thermo-hydro-mechanical-chemical processes in fractured rocks. Doctoral Thesis, Imperial College. http://hdl.handle.net/10044/1/45644

rough_surfaces's People

Contributors

philippslang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rough_surfaces's Issues

Generating an anisotropic surface

Hello,

I have read your interesting code and found it reliable for creating a self-affine fractal surface for my project.
I have a question regarding generating an anisotropic surface. In the "example_generate.py", only one Hurst exponent is used along with an input of "self.anisotropy = 1.0" for generating an anisotropic surface. My question is that if I have got one Hurst exponent for the horizontal direction and another one for the vertical direction, how can I find the value for self.anisotropy?

Thank you.

Anisotropy implementation

Hi,
I wonder how you implemented anisotropy roughness as you showed in the front page. I only find data you generate in doc folder. I appreciate in advance for your help.

Yongfei

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.