Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error pointed out by Jinliang in SOC interpolation function #1314

Merged
merged 5 commits into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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
Expand Down
Loading