paroto.validation.validation_utils#

Utility functions for breakdown voltage model validation.

Functions#

evaluate_model(model_class, inputs)

Evaluate a breakdown voltage model with given inputs.

sweep_model(model_class, sweep_param, sweep_values, ...)

Sweep a model parameter and collect breakdown voltages.

compute_statistics(model_values, exp_values)

Compute statistical metrics for model validation.

print_statistics(stats[, units, model_name])

Print validation statistics in standard format.

print_section_header(title[, level])

Print a formatted section header.

torr_cm_to_pa_m(pd_torr_cm)

Convert Torr·cm to Pa·m.

voltage_to_field_kv_cm(V, d_m)

Convert voltage to electric field in kV/cm.

create_default_inputs([p, d, T])

Create default input dictionary for breakdown models.

Module Contents#

paroto.validation.validation_utils.evaluate_model(model_class, inputs)#

Evaluate a breakdown voltage model with given inputs.

This is a lightweight wrapper for running OpenMDAO models in validation scripts. It creates a minimal OpenMDAO Problem, sets inputs, runs the model, and extracts the breakdown voltage output.

Warning

Function is AI generated, not ready for production.

Workflow#

  1. Create new OpenMDAO Problem

  2. Instantiate the model class

  3. Add model as subsystem with promoted variables

  4. Setup the problem (allocate arrays, check connections)

  5. Set all input values from the inputs dictionary

  6. Run the model (compute outputs)

  7. Extract and return breakdown_voltage

param model_class:

Breakdown voltage model class to instantiate (e.g., PaschenSimpleModel)

type model_class:

class

param inputs:

Dictionary mapping input names to values. Typical keys: - ‘gas_properties_pressure’: pressure in Pa - ‘gap_distance’: electrode gap in m - ‘preheat_temperature’: gas temperature in K - Additional model-specific inputs (e.g., ‘gas_ionization_potential’)

type inputs:

dict

returns:

V_breakdown – Breakdown voltage in V

rtype:

float

Examples

>>> from paroto.models.breakdown_voltage import PaschenSimpleModel
>>> inputs = {
...     "gas_properties_pressure": 101325.0,  # 1 bar
...     "gap_distance": 0.01,  # 1 cm
...     "preheat_temperature": 300.0,  # room temp
... }
>>> V = evaluate_model(PaschenSimpleModel, inputs)
>>> print(f"Breakdown voltage: {V:.2f} V")

See also

sweep_model

Evaluate model across a range of parameter values

create_default_inputs

Generate standard input dictionary

paroto.validation.validation_utils.sweep_model(model_class, sweep_param, sweep_values, fixed_inputs)#

Sweep a model parameter and collect breakdown voltages.

This function performs a parametric sweep by varying one input parameter while holding all others constant. It’s the validation equivalent of a Design of Experiments (DOE) for a single variable.

Warning

Function is AI generated, not ready for production.

Workflow#

For each value in sweep_values:
  1. Copy fixed_inputs dictionary

  2. Override the sweep_param with current sweep value

  3. Call evaluate_model() to compute breakdown voltage

  4. Store result

Return array of all breakdown voltages

Use Cases#

  • Generate Paschen curves (sweep pressure at fixed gap)

  • Temperature sensitivity analysis (sweep temperature)

  • Gap distance effects (sweep gap at fixed pressure)

  • Validation against experimental data

param model_class:

Breakdown voltage model class (e.g., PaschenTemperatureCorrectedModel)

type model_class:

class

param sweep_param:

Name of parameter to sweep. Must match OpenMDAO input name: - ‘gas_properties_pressure’: for pressure sweeps - ‘gap_distance’: for gap sweeps - ‘preheat_temperature’: for temperature sweeps

type sweep_param:

str

param sweep_values:

Array of values for swept parameter. Units must match model expectations.

type sweep_values:

ndarray

param fixed_inputs:

Fixed input values that remain constant during sweep. Should NOT include sweep_param (it will be overridden).

type fixed_inputs:

dict

returns:

V_breakdown – Breakdown voltages (V) at each sweep point. Same length as sweep_values.

rtype:

ndarray

Examples

>>> # Example 1: Pressure sweep at fixed gap (Paschen curve)
>>> from paroto.models.breakdown_voltage import PaschenSimpleModel
>>> pressures = np.linspace(50000, 200000, 20)  # 0.5 to 2 bar
>>> fixed = {"gap_distance": 0.01, "preheat_temperature": 300.0}
>>> V_array = sweep_model(
...     PaschenSimpleModel, "gas_properties_pressure", pressures, fixed
... )
>>> # V_array now contains 20 breakdown voltages
>>> # Example 2: Temperature sweep at fixed pressure/gap
>>> temperatures = np.linspace(300, 1000, 15)  # K
>>> fixed = {"gas_properties_pressure": 101325.0, "gap_distance": 0.01}
>>> V_temps = sweep_model(
...     PaschenTemperatureCorrectedModel, "preheat_temperature", temperatures, fixed
... )
>>> # Example 3: Gap distance sweep for scaling analysis
>>> gaps = np.logspace(-3, -1, 30)  # 1 mm to 10 cm
>>> fixed = {"gas_properties_pressure": 101325.0, "preheat_temperature": 300.0}
>>> V_gaps = sweep_model(PaschenSimpleModel, "gap_distance", gaps, fixed)

Notes

  • This function creates a new OpenMDAO Problem for each sweep point. For large sweeps or complex models, consider using OpenMDAO’s native DOE drivers for better performance.

  • The function is serial (no parallelization). For production use, implement parallel evaluation.

  • Memory footprint is O(N) where N = len(sweep_values).

See also

evaluate_model

Evaluate model at a single point

create_default_inputs

Generate standard input dictionary

paroto.validation.validation_utils.compute_statistics(model_values, exp_values)#

Compute statistical metrics for model validation.

Warning

Function is AI generated, not ready for production.

Parameters:
  • model_values (ndarray) – Model predictions

  • exp_values (ndarray) – Experimental values

Returns:

metrics – RMSE, MAE, R², max error

Return type:

dict

paroto.validation.validation_utils.print_statistics(stats, units='V', model_name=None)#

Print validation statistics in standard format.

Warning

Function is AI generated, not ready for production.

Parameters:
  • stats (dict) – Statistics from compute_statistics()

  • units (str) – Units for error metrics

  • model_name (str, optional) – Model name to display

paroto.validation.validation_utils.print_section_header(title, level='=')#

Print a formatted section header.

Warning

Function is AI generated, not ready for production.

Parameters:
  • title (str) – Section title

  • level (str) – Character for separator (‘=’ or ‘-‘)

paroto.validation.validation_utils.torr_cm_to_pa_m(pd_torr_cm)#

Convert Torr·cm to Pa·m.

Warning

Function is AI generated, not ready for production.

Parameters:

pd_torr_cm (float or ndarray) – Pressure-distance product in Torr·cm

Returns:

pd_pa_m – Pressure-distance product in Pa·m

Return type:

float or ndarray

paroto.validation.validation_utils.voltage_to_field_kv_cm(V, d_m)#

Convert voltage to electric field in kV/cm.

Parameters:
  • V (float or ndarray) – Voltage in V

  • d_m (float) – Gap distance in m

Returns:

E – Electric field in kV/cm

Return type:

float or ndarray

paroto.validation.validation_utils.create_default_inputs(p=101325.0, d=0.01, T=300.0)#

Create default input dictionary for breakdown models.

Warning

Function is AI generated, not ready for production.

Parameters:
  • p (float) – Pressure in Pa (default: 101325 = 1 bar)

  • d (float) – Gap distance in m (default: 0.01 = 1 cm)

  • T (float) – Temperature in K (default: 300 K)

Returns:

inputs – Standard input dictionary

Return type:

dict