CLI Getting Started
Software version: UVSim3D 4.0.0
The command-line solver is an optional tool for repeated calculations, scripted workflows and evaluation on external mesh points. For desktop lamp layout design, follow Getting Started.
Prepare the solver
Obtain the UVSim3DSolver distribution for your operating system. The solver is a separate executable from the desktop application.
Executable names depend on the precision configuration: UVSim3DSolver_fp64, UVSim3DSolver_mixed or UVSim3DSolver_fp32.
Windows executables have an .exe suffix. The examples below use UVSim3DSolver_fp64 and assume it is on PATH.
UVSim3DSolver_fp64 --helpThe solver takes a calculation configuration JSON file and a point or mesh file.
Its configuration format differs from a GUI .uvsim project and the GUI's Export Project JSON… output.
The tutorial below describes the solver input format.
Quick-start tutorial
Step 1: Prepare a mesh file
Create a simple text file nodes.txt containing the calculation points (x, y, z coordinates, in meters):
0.0, 0.0, 0.1
0.0, 0.0, 0.2
0.0, 0.0, 0.3Or use a CFD mesh in VTU/VTKHDF/CGNS format instead.
Step 2: Create a case file
Create my_reactor.json (JSON v3.0 format):
{
"version": "3.0",
"title": "My first UV reactor simulation",
"description": "Single LP lamp reactor",
"id": "reactor_001",
"reactorConfig": {
"lampSpecs": [
{
"id": "LP150W",
"lampType": "lp",
"description": "150W LP lamp",
"power": 150.0,
"eta": 0.35,
"arcLength": 0.8,
"diameter": 0.015,
"sleeveDia": 0.025,
"sleeveThickness": 0.002,
"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.0, 0.0, 0.0],
"direction": [0.0, 0.0, 1.0]
}
]
},
"solverConfig": {
"radiationModel": "msss",
"rootFindingMethod": "brents",
"enableShadowing": false,
"numThreads": 0,
"relativeTolerance": 1.0e-5,
"lampSegmentation": 1000,
"maxIteration": 50
}
}Step 3: Run the simulation
UVSim3DSolver_fp64 --config my_reactor.json --mesh nodes.txt --output results.txtStep 4: Check the results
Check the output file results.txt:
# UVSim3D Results
# nodes: 3, bands: 1
# x, y, z, band1, lamda = 254nm
0.000000, 0.000000, 0.100000, 125.456
0.000000, 0.000000, 0.200000, 98.234
0.000000, 0.000000, 0.300000, 76.891The last column is the UV fluence rate (W/m²) at each point.