CADETProcess.processModel.Process#
- class CADETProcess.processModel.Process(cycle_time, _lock)[source]#
Bases:
EventHandlerClass for defining the dynamic changes of a flow sheet.
- Attributes:
- namestr
Name of the process object to be simulated.
system_statenp.ndarraynp.ndarray: State of the entire system.
- system_state_derivatenp.ndarray
Derivative of the state
See also
EventHandlerCADETProcess.processModel.FlowSheetCADETProcess.simulation.Solver
- add_concentration_profile(unit: str, time: ndarray, c: ndarray, components: list[str] | None = None, s: float = 1e-06, interpolation_method: Literal['cubic', 'pchip', None] = 'pchip') None[source]#
Add concentration profile to Process.
- Parameters:
- unitstr
The name of the inlet unit operation.
- timenp.ndarray
1D array containing the time values of the concentration profile.
- cnp.ndarray
2D array containing the concentration profile with shape (len(time), n_comp), where n_comp is the number of components specified in the components argument.
- componentslist[str] | None, optional
Component species for which the concentration profile shall be added. If None, the profile is expected to have shape (len(time), n_comp). If -1, the same (1D) profile is added to all components. Default is None.
- sfloat, optional
Smoothing factor used to generate the spline representation of the concentration profile. Default is 1e-6.
- interpolation_methodLiteral[“linear”, “cubic”, “pchip”, None], optional
The interpolation method to use. Options: - “cubic” : Cubic spline interpolation. - “pchip” : Piecewise cubic Hermite interpolation (default). - None : No interpolation, use raw time data.
- Raises:
- TypeError
If the specified unit is not an Inlet unit operation.
- ValueError
If the time values in time exceed the cycle time of the Process. If c has an invalid shape. If interpolation_method is unknown.
- add_flow_rate_profile(unit: str, time: ndarray, flow_rate: ndarray, s: float = 1e-06, interpolation_method: Literal['cubic', 'pchip', None] = 'pchip') None[source]#
Add flow rate profile to a SourceMixin unit operation.
- Parameters:
- unitstr
The name of the SourceMixin unit operation.
- timenp.ndarray
1D array containing the time values of the flow rate profile.
- flow_ratenp.ndarray
1D array containing the flow rate values over time.
- sfloat, optional
Smoothing factor used to generate the spline representation of the flow rate profile. Default is 1e-6.
- interpolation_methodLiteral[“linear”, “cubic”, “pchip”, None], optional
The interpolation method to use. Options: - “cubic” : Cubic spline interpolation. - “pchip” : Piecewise cubic Hermite interpolation (default). - None : No interpolation, use raw time data.
- Raises:
- TypeError
If the specified unit is not a SourceMixin unit operation.
- ValueError
If the time values in time exceed the cycle time of the Process.
- add_parameter_sensitivity(parameter_paths: str | list[str], name: str | None = None, components: str | list[str] | None = None, polynomial_coefficients: str | list[str] | None = None, reaction_indices: int | list[int] | None = None, bound_state_indices: int | list[int] | None = None, section_indices: int | list[int] | None = None, abstols: float | list[float] | None = None, factors: int | list[int] | None = None) None[source]#
Add parameter sensitivty to Process.
- Parameters:
- parameter_pathsstr or list of str
The path to the parameter(s).
- namestr, optional
The name of the parameter sensitivity. If not provided, the name of the first parameter will be used.
- componentsstr or list of str, optional
The component(s) to which the parameter(s) belong. Must only be provided if parameter is specific to a certain compoment.
- polynomial_coefficients: str or list of str, optional
The polynomial coefficients(s) to which the parameter(s) belong. Must only be provided if parameter is specific to a certain coefficient.
- reaction_indicesint or list of int, optional
The index(es) of the reaction(s) in the associated model(s), if applicable. Must only be provided if parameter is specific to a certain reaction.
- bound_state_indicesint or list of int, optional
The index(es) of the bound state(s) in the associated model(s), if applicable. Must only be provided if parameter is specific to a certain bound state.
- section_indicesint or list of int, optional
The index(es) of the section(s) in the associated model(s), if applicable. Must only be provided if parameter is specific to a certain section.
- abstolsfloat or list of float, optional
The absolute tolerances for each parameter. If not provided, a default tolerance will be used.
- factorsfloat or list of float, optional
The factors for each parameter. If not provided, a default factor of 1 will be used.
- Raises:
- CADETProcessError
Number of indices do not match for: - components - polynomial_coefficients - reaction - bound_state - sections - tolerances - factors
Component is not found. Unit is not found. Parameter is not found. Name is not provided (if number of parameters larger than 1). If sensitivity name already exists.
Notes
This functionality is still work in progress.
Todo
[ ] Check if compoment/reaction/polynomial index are required.
[ ] Specify time instead of section index;
- check_config() bool[source]#
Validate that process config is setup correctly.
- Returns:
- checkBool
True if process is setup correctly. False otherwise.
- check_cstr_volume() bool[source]#
Check if CSTRs run empty.
- Returns:
- flagbool
False if any of the CSTRs run empty. True otherwise.
- property component_system: ComponentSystem#
ComponentSystem: Component system of the process.
- property config: Dict#
dict[str, dict]: Parameters and initial state of the process.
- property flow_sheet: FlowSheet#
FlowSheet: flow sheet of the process model.
- Raises:
- TypeError:
If flow_sheet is not an instance of FlowSheet.
- property polynomial_parameters: Dict#
dict: Polynomial parameters of the process.
- property process_meta: ProcessMeta#
ProcessMeta: Process meta information.
- property section_dependent_parameters: Dict#
dict: Section dependent parameters of the process.
- property sized_parameters: Dict#
dict: Sized parameters of the process.