Hi all,
I am following the provided examples to define heterogeneous Neumann BC. I would like to define such a boundary condition for the horizontal stress component, based on the help of a python script:
I have two questions.
-
The python script is accepted by OGS as follows:
class BCRight_sigma(OpenGeoSys.BoundaryCondition):
def getFlux(self, t, coords, primary_vars):
x, y, z = coords
value=grad_sigma(x,y)[0]
Jac = [0.0,0.0,0.0] # value does not depend on primary variable
return (True, value, Jac)
where grad_sigma is a function that returns
return something*(-y), something_different*y
Has anyone experience with this approach? I already obtained corresponding IC thanks to constrained displacement BCs, now I would like to match these IC with meaningful BC, replacing the constrained displacement with constrained stresses.
To provide the full stress tensor as BC, is it enough to give the different components in the .prj file?
- How do I access material ID from the python scripts, is there a quick way, similar to coords for the spatial coordinates?