# mpyfuzzy Evaluate simulation goodness using fuzzy logic. This tool analyzes simulation results by comparing them with validation data using statistical metrics (Pearson correlation coefficient and mean relative error) and applies fuzzy logic to determine an overall goodness score. The evaluation process: - Calculates Pearson correlation coefficient (PCC) for linear correlation - Calculates mean relative error (MRE) for deviation magnitude - Applies fuzzy logic rules to combine metrics - Determines overall goodness score - Outputs results for each validation field to CSV files Note that the simulation case has to be equipped with a valid [`case.yml`](../case-metadata) and a `validation` section. For more information refer to > Hänsch, S., Evdokimov, I., Schlegel, F., & Lucas, D. (2021). A workflow for > the sustainable development of closure models for bubbly flows. Chemical > Engineering Science, 244, 116807. ## Usage ```bash mpyfuzzy [options] case_directory ``` ## Examples ### Basic Evaluation Evaluate a case with default fuzzy logic parameters: ```bash mpyfuzzy ./my-simulation-case ``` ### Custom PCC Parameters Provide custom parameters for Pearson correlation: ```bash mpyfuzzy -pcc '{"low": 0.5, "medium": 0.7, "high": 0.9}' ./case ``` ### Custom MRE Parameters Adjust mean relative error thresholds: ```bash mpyfuzzy -mre '{"low": 0.1, "medium": 0.05, "high": 0.01}' ./case ``` ### Custom Goodness Parameters Define custom goodness classification: ```bash mpyfuzzy -goodness '{"poor": 0.3, "fair": 0.5, "good": 0.7, "excellent": 0.9}' ./case ``` ## Output Results are written to `postProcessing/mpyfuzzy/.csv` for each validation field. Example output: ```text field,pcc,mre,goodness alpha,0.95,0.023,0.87 velocity,0.89,0.045,0.76 pressure,0.92,0.031,0.82 ```