Skip to content

Commit

Permalink
Correct Residual Calc
Browse files Browse the repository at this point in the history
  • Loading branch information
daklauss committed Sep 10, 2024
1 parent da8d4bb commit 1431ea7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CADETPythonSimulator/unit_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ def compute_residual(
"""
# Inlet DOFs are simply copied to the residual.

self.residuals['outlet']['c_poly'] = self.states['outlet']['c_poly']
t_poly = np.array([1, t, t**2, t**3])
self.residuals['outlet']['c'] = self.c_poly @ t_poly
self.residuals['outlet']['viscosity'] = self.states['outlet']['viscosity']

class Outlet(UnitOperationBase):
Expand All @@ -540,7 +540,8 @@ def compute_residual(
Time at which to evaluate the residual.
"""
raise NotImplementedError()
self.residuals['inlet']['c'] = np.zeros(self.states['inlet']['c'].shape)
self.residuals['inlet']['viscosity'] = 0


class Cstr(UnitOperationBase):
Expand Down

0 comments on commit 1431ea7

Please sign in to comment.