Skip to content

Commit

Permalink
Adding integration test for PostOpStressState feature
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jan 3, 2025
1 parent 3d66631 commit a4146ee
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/test_PostOpStressState.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pytest
from SOSAT import StressState
from SOSAT import PostOpStressState
from SOSAT.constraints import FaultConstraint
from scipy.stats import uniform

def test_PostOpStressState():

# depth in meters
depth = 1228.3
# density in kg/m^3
avg_overburden_density = 2580.0
# pore pressure gradient in MPa/km
pore_pressure_grad = 9.955

pore_pressure = pore_pressure_grad * (1.0 / 1000) * depth

ss = StressState(depth=depth,
avg_overburden_density=avg_overburden_density,
pore_pressure=pore_pressure,
nbins = 50)

fc = FaultConstraint()
ss.add_constraint(fc)

gamma_dist = uniform(0.4,(0.6-0.4))
dP = 15.0 # MPa
postOp_ss = PostOpStressState(ss, gamma_dist, dP)

postOp_ss.evaluate_posterior()

sig = postOp_ss.posterior[20,20]
sig == pytest.approx(0.001829)

0 comments on commit a4146ee

Please sign in to comment.