Skip to content

Commit

Permalink
Add SolutionArray :set_mixture_fraction method.
Browse files Browse the repository at this point in the history
  • Loading branch information
decaluwe committed Apr 14, 2022
1 parent e7b931b commit be54e47
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions interfaces/cython/cantera/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,25 @@ def set_equivalence_ratio(self, phi, *args, **kwargs):
self._phase.set_equivalence_ratio(phi[index], *args, **kwargs)
self._states[index][:] = self._phase.state

def set_mixture_fraction(self, mixture_fraction, *args, **kwargs):
"""
See `ThermoPhase.set_mixture_fraction`
Note that ``mixture_fraction`` either needs to be a scalar value or
dimensions have to be matched to the `SolutionArray`.
"""

# broadcast argument shape
mixture_fraction, _ = np.broadcast_arrays(mixture_fraction,
self._output_dummy)

# loop over values
for index in self._indices:
self._phase.state = self._states[index]
self._phase.set_mixture_fraction(mixture_fraction[index], *args,
**kwargs)
self._states[index][:] = self._phase.state

def collect_data(self, cols=None, tabular=False, threshold=0, species=None):
"""
Returns the data specified by ``cols`` in an ordered dictionary, where
Expand Down

0 comments on commit be54e47

Please sign in to comment.