Last updated: 2025-10-06 6 min read

Examples and Applications

Example 1: Single VUV/UV lamp reactor

Scenario: a vertical cylindrical reactor with a single 42W VUV/UV lamp

File: samples/validation_case3/validation_case3_mpss.json

Key config (JSON v3.0):

json
{
    "version": "3.0",
    "reactorConfig": {
        "lampSpecs": [
            {
                "id": "LP_VUV_UV",
                "lampType": "lp",
                "power": 42.0,
                "eta": 0.2607,
                "arcLength": 0.278,
                "uvBands": [
                    {"lambda": 185, "relativeEnergy": 0.04109, ...},
                    {"lambda": 254, "relativeEnergy": 0.95891, ...}
                ]
            }
        ],
        "lampLayout": [
            {"lampId": "LP_VUV_UV", "position": [0.0, 0.0, 0.0], "direction": [0.0, 1.0, 0.0]}
        ]
    }
}

Run:

bash
cd samples
UVSim3D_DP --config validation_case3_mpss.json --mesh case3_mesh.txt --output case3_results.txt

Expected output: irradiance values of 50-200 W/m² near the lamp, decreasing with distance

Example 2: Multi-lamp reactor (24 lamps)

Scenario: an industrial photoreactor with 24 lamps in a cylindrical array

File: samples/upw-reactor-24lamps-demo.json

Key config (JSON v3.0):

json
{
    "version": "3.0",
    "reactorConfig": {
        "lampSpecs": [
            {
                "id": "LP150W",
                "lampType": "lp",
                "power": 150.0,
                "eta": 0.35,
                "arcLength": 0.8,
                "uvBands": [
                    {"lambda": 254, "waterRI": 1.33, "waterUVT": 0.95, "relativeEnergy": 1.0, "sleeveRI": 1.5, "sleeveUVT": 0.90, "gef": 1.0}
                ]
            }
        ],
        "lampLayout": [
            {"lampId": "LP150W", "dimming": 1.0, "position": [0.15, 0.0, 0.5], "direction": [0.0, 0.0, 1.0]},
            {"lampId": "LP150W", "dimming": 1.0, "position": [-0.15, 0.0, 0.5], "direction": [0.0, 0.0, 1.0]}
            // ... 22 more lamps (referencing the same lampSpecs)
        ]
    },
    "solverConfig": {
        "lampSegmentation": 1000,
        "numThreads": 0
    }
}

Run:

bash
UVSim3D_DP --config upw-reactor-24lamps-demo.json --mesh reactor_mesh.vtu --output fluence_24lamps.vtu

Example 3: Spatial filtering for a region of interest

Scenario: a large mesh, but you're only interested in the central region

Config:

json
{
    "spatialFilter": {
        "enabled": true,
        "xMin": -0.1,
        "xMax": 0.1,
        "yMin": -10.0,
        "yMax": 10.0,
        "zMin": -10000,
        "zMax": 10000
    }
}

Benefit: if the filter excludes 90% of the points, computation runs 10x faster

Example 4: MPSS vs MSSS comparison

Run the same case with both models:

bash
# MPSS
UVSim3D_DP --config validation_case1_mpss.json --mesh mesh.vtu --output result_mpss.vtu

# MSSS
UVSim3D_DP --config validation_case1_msss.json --mesh mesh.vtu --output result_msss.vtu

General difference: for typical disinfection lamps, MSSS is more accurate; MPSS can be a good fit for short lamps or other special cases. For quantitative validation against literature, see the "MPSS/MSSS Validation" document.

Example 5: Case file validation (dry run)

Scenario: check a case file's syntax and parameter validity before running the actual calculation

Run:

bash
# Quick validation (skips mesh loading and calculation)
UVSim3D_DP --config my_new_reactor.json --dry

# Quick validation without a log file
UVSim3D_DP --config my_new_reactor.json --dry --log off

When to use it:

  • checking for syntax errors after writing a new case file
  • validating JSON structure
  • validating parameter ranges (e.g. whether relativeEnergy sums to 1.0)
  • checking for duplicate lamp IDs

Example output:

code
[info] === Loading Simulation Configuration ===
[info] SUCCESS: JSON loaded successfully!
[info] Lamps: 4
[info] Bands: 2
[info] Validating Configuration Done.
[info] === Dry Run Mode ===
[info] Configuration validated successfully.
[info] Dry run completed - skipping mesh loading and calculation.