diff --git a/idaes/models_extra/power_generation/unit_models/soc_submodels/common.py b/idaes/models_extra/power_generation/unit_models/soc_submodels/common.py index fe0736b67f..4dc4fb66d5 100644 --- a/idaes/models_extra/power_generation/unit_models/soc_submodels/common.py +++ b/idaes/models_extra/power_generation/unit_models/soc_submodels/common.py @@ -182,11 +182,12 @@ def _interpolate_2D( phi_bound_1: expression for the value of the quantity to be interpolated at the 1 bound derivative: If True estimate derivative - method: interpolation method currently only CDS is supported Returns: expression for phi at face """ + # TODO add tests to ensure this function works as designed + # Also, user beware, use of CV_Bound enums is untested icu = ic - 1 icd = ic if ic == ifaces.first(): @@ -203,7 +204,7 @@ def _interpolate_2D( if not derivative: cf = faces.at(ic) lambf = (cd - cf) / (cd - cu) - return (1 - lambf) * phi_func(icu) + lambf * phi_func(icd) + return (1 - lambf) * phi_func(icd) + lambf * phi_func(icu) else: # Since we are doing linear interpolation derivative is the slope # between node centers even if they are not evenly spaced