diff --git a/pygfunction/pipes.py b/pygfunction/pipes.py index 311c1038..58944462 100644 --- a/pygfunction/pipes.py +++ b/pygfunction/pipes.py @@ -1737,6 +1737,9 @@ def _format_inputs(self, m_flow, cp, nSegments): # Format mass flow rate inputs # Mass flow rate in each fluid circuit m_flow_in = np.atleast_1d(m_flow) + if not len(m_flow_in) == self.nInlets: + raise ValueError( + 'Incorrect length of mass flow vector.') self._m_flow_in = m_flow_in # Mass flow rate in pipes m_flow_pipe = np.tile(m_flow_in, 2) @@ -1745,6 +1748,11 @@ def _format_inputs(self, m_flow, cp, nSegments): # Format heat capacity inputs # Heat capacity in each fluid circuit cp_in = np.atleast_1d(cp) + if len(cp_in) == 1: + cp_in = np.tile(cp, self.nInlets) + elif not len(cp_in) == self.nInlets: + raise ValueError( + 'Incorrect length of heat capacity vector.') self._cp_in = cp_in # Heat capacity in pipes cp_pipe = np.tile(cp_in, 2)