SIDEL_ScriptsManager/app/backend/script_groups/hammer/docs/test_configurations.md

3.5 KiB

Example Configuration for Testing Export Features

Test Parameters

Use these parameters to quickly test the export functionality:

Basic System Configuration

{
  "pipe_length": 250.0,
  "pipe_diameter": 0.065,
  "wall_thickness": 0.003,
  "roughness": 1.5e-6,
  "flow_rate": 20000.0,
  "pump_pressure": 8.0,
  "fluid_density": 1150.0,
  "fluid_temperature": 25.0,
  "bulk_modulus": 2.2e9,
  "young_modulus": 200e9,
  "closure_time": 3.0,
  "damper_enabled": false,
  "simulation_time": 12.0
}

System with Damper Configuration

{
  "pipe_length": 300.0,
  "pipe_diameter": 0.065,
  "wall_thickness": 0.003,
  "roughness": 1.5e-6,
  "flow_rate": 25000.0,
  "pump_pressure": 10.0,
  "fluid_density": 1200.0,
  "fluid_temperature": 30.0,
  "bulk_modulus": 2.2e9,
  "young_modulus": 200e9,
  "closure_time": 2.0,
  "damper_enabled": true,
  "damper_volume": 80.0,
  "damper_precharge": 6.0,
  "damper_gas_percentage": 65.0,
  "damper_position": 270.0,
  "damper_connection_diameter": 0.05,
  "damper_connection_length": 0.5,
  "simulation_time": 15.0
}

Critical High-Risk Scenario

{
  "pipe_length": 500.0,
  "pipe_diameter": 0.08,
  "wall_thickness": 0.002,
  "roughness": 2.0e-6,
  "flow_rate": 40000.0,
  "pump_pressure": 15.0,
  "fluid_density": 1300.0,
  "fluid_temperature": 40.0,
  "bulk_modulus": 2.0e9,
  "young_modulus": 180e9,
  "closure_time": 0.5,
  "damper_enabled": false,
  "simulation_time": 20.0
}

Testing Steps

  1. Open the Water Hammer Simulator at http://localhost:5002/script-group/5
  2. Load Test Configuration: Copy one of the configurations above and paste into the form
  3. Run Calculation: Click "Calculate" button
  4. Test PDF Export:
    • Click "Export as PDF" button
    • Verify professional report generation
    • Check all plots and tables are included
  5. Test Obsidian Export:
    • Click "Export as Obsidian ZIP" button
    • Extract ZIP file and verify structure
    • Open markdown file in text editor
    • Verify image references work

Expected Results

PDF Export Should Include:

  • Title page with project information
  • System parameters table
  • Analysis results table
  • Three high-quality plots:
    • Pressure transient analysis
    • Flow rate evolution
    • System parameters summary
  • Safety assessment and recommendations

Obsidian ZIP Should Contain:

  • Main markdown file with complete analysis
  • attachments/ folder with three PNG images
  • Proper ![[]] image references
  • Tables in Markdown format
  • Risk assessment with emoji indicators

Troubleshooting Tests

Test Missing Dependencies

  1. Temporarily rename matplotlib: pip uninstall matplotlib
  2. Try to export - should show helpful error message
  3. Reinstall: pip install matplotlib

Test Large Data Sets

  1. Use the critical scenario configuration
  2. Set simulation_time to 30.0 seconds
  3. Verify export still works with larger datasets

Test File Permissions

  1. Check that exports folder is created: {data_dir}/exports/
  2. Verify files are generated with unique timestamps
  3. Confirm automatic cleanup of temporary files

Performance Notes

  • PDF generation typically takes 2-5 seconds
  • Obsidian ZIP export is faster (1-3 seconds)
  • Plot generation is the most time-consuming step
  • Larger simulation times will increase processing time

Use these configurations to thoroughly test the export functionality