Skip to main content

NetworkManager Reference Guide

Component: NetworkManager Purpose: Quick reference for common operations and patterns Date: October 2025 Status: Living Document


Table of Contents

  1. Quick Start
  2. Common Operations
  3. Property Processing
  4. V&V Mode
  5. Troubleshooting

1. Quick Start

1.1 Parse and Import Network

cd epanetconsolecore/NetworkManager
dotnet run

Requirements:

  • appsettings.json configured with database connection
  • EPANET INP file path specified in configuration
  • PostgreSQL database accessible

1.2 V&V-Only Mode (Validation)

# Copy V&V configuration
copy NetworkManager.VVOnly.appsettings.json appsettings.json

# Run validation
dotnet run

2. Common Operations

2.1 Import New Network

Steps:

  1. Update appsettings.json with INP file path
  2. Verify database connection string
  3. Run NetworkManager
  4. Check logs for success/errors
  5. Verify data in database

2.2 Re-import After Changes

Note: Re-running NetworkManager will update existing data

Safe Practice:

  1. Backup database first
  2. Review changes in INP file
  3. Run NetworkManager
  4. Validate updated data
  5. Run V&V mode to verify

3. Property Processing

3.1 Default Value Filtering

Only non-default values are stored in LinkProperty/NodeProperty tables.

Link Defaults:

  • EN_KWALL: 0.0
  • EN_LEAK_AREA: 0.0
  • EN_INITSTATUS: 1.0 (OPEN)
  • EN_PUMP_HCURVE: 0.0 (no curve)
  • EN_PUMP_ECOST: 0.0 (no energy cost)

Node Defaults:

  • EN_EMITTER: 0.0 (no emitter)
  • EN_INITQUAL: 0.0 (initial quality)
  • EN_TANK_KBULK: 0.0 (tank bulk reaction)

3.2 Status Properties

Critical: Use EN_INITSTATUS (4), NOT EN_STATUS (11)

  • EN_INITSTATUS: User configuration ✅ Store in database
  • EN_STATUS: Simulation result ❌ Don't store

4. V&V Mode

4.1 Enable V&V Mode

Method 1: Use pre-configured file

copy NetworkManager.VVOnly.appsettings.json appsettings.json

Method 2: Edit appsettings.json

{
"V&V": {
"EnableV&VOnlyMode": true,
"V&VOnlyMode": {
"SkipParsing": true,
"ValidateExistingData": true
}
}
}

4.2 V&V Reports

Output:

  • Console: Real-time validation with ✅/⚠️/❌ indicators
  • Log file: Detailed logging
  • Report file: Comprehensive validation report with timestamp

Validation Checks:

  • Record counts and relationships
  • Data quality and ranges
  • Business rule compliance
  • Database connectivity

5. Troubleshooting

5.1 Common Issues

Problem: "Invalid INP file" Solution: Verify INP file path is correct and file is valid EPANET format

Problem: "Database connection failed" Solution: Check connection string in appsettings.json, verify PostgreSQL is running

Problem: "Too many LinkProperty entries" Solution: Verify EpanetPropertyDefaults is being used to filter defaults

Problem: "Missing configuration data" Solution: Ensure configuration seeding completed successfully

5.2 Validation Checklist

After import, verify:

  • ✅ Node counts match INP file
  • ✅ Link counts match INP file
  • ✅ Patterns imported correctly
  • ✅ Curves imported correctly
  • ✅ Controls imported correctly
  • ✅ Options match INP file
  • ✅ LinkProperty/NodeProperty only have non-defaults

Use V&V Mode for automatic validation!


Related Documentation:

  • Architecture: NETWORKMANAGER_ARCHITECTURE.md
  • Design Specs: NetworkManager-design-specs.md
  • Summary: NetworkManager-summary.md

Status: ✅ Living Document Last Updated: October 2025