Add MFront material properties in constitutive_relation block with ogs6py


Is it possible to add the following block “material_properties” with ogs6py to build a prj file using Python?


Hi Simon,

besides using ogs6py for construction prj-files, you can also include xml files into prj-files (docs) or use xml patch files for modifying a prj file (docs).


@SRaude, as you observed, ogs6py is not complete in all aspects, yet. Some time ago I did the following to use ogs6py with a material model it didn’t support:

from ogs6py import ogs
ogs_project = "example.prj"
model = ogs.OGS(PROJECT_FILE=ogs_project)
props = {
    "name": "relative_permeability",
    "type": "RelativePermeabilityVanGenuchten",
    "residual_liquid_saturation": "0.0",
    "residual_gas_saturation": "0.0",
    "exponent": "0.4",
    "minimum_relative_permeability_liquid": "1e-25"
medium_id = 0
model.add_block(blocktag="property", parent_xpath=f"media/medium[@id='{medium_id}']/properties",
                taglist=list(props.keys()), textlist=list(props.values()))

Maybe you can adapt this for your needs, if it’s not already too late.

1 Like