joergbuchwald / ogs6py

Python-API for the OpenGeoSys (http://www.opengeosys.org) software.
BSD 3-Clause "New" or "Revised" License
16 stars 23 forks source link

added support for all curently available material properties #44

Closed joergbuchwald closed 2 years ago

joergbuchwald commented 2 years ago

Fixes #43. The interface to the Linear property has changed a bit:

model.media.add_property(medium_id="0",
                            phase_type="AqueousLiquid",
                            name="density",
                            type="Linear",
                            reference_value="999.1",
                            independent_variables={"temperature": {
                                "reference_condition":273.15,
                                "slope":-4e-4},
                                "phase_pressure": {
                                "reference_condition": 1e5,
                                "slope": 1e-20
                                }})

Other multilevel properties like Exponential and Function can be accessed similarly:

model.media.add_property(medium_id="0",
                            phase_type="AqueousLiquid",
                            name="density",
                            type="Exponential",
                            reference_value="999.1",
                            offset="0.0",
                            exponent={"variable_name": "temperature",
                                "reference_condition":273.15,
                                "factor":-4e-4})
model.media.add_property(medium_id="0",
                            phase_type="AqueousLiquid",
                            name="density",
                            type="Function",
                            expression="999.1",
                            dvalues={"temperature": {
                                "expression":0.0},
                                "phase_pressure": {
                                "expression": 0.0}})
codecov[bot] commented 2 years ago

Codecov Report

Merging #44 (362d7cb) into master (91fd62f) will decrease coverage by 1.02%. The diff coverage is 52.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   72.37%   71.35%   -1.03%     
==========================================
  Files          21       21              
  Lines        1278     1316      +38     
==========================================
+ Hits          925      939      +14     
- Misses        353      377      +24     
Impacted Files Coverage Δ
ogs6py/classes/media.py 69.41% <52.72%> (-26.34%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 91fd62f...362d7cb. Read the comment docs.