SimNDT2 batch processor
Go to file
2025-09-15 09:50:23 +02:00
aux Fri 29 Nov 2024 04:38:58 PM CET 2024-11-29 16:39:04 +01:00
bin Fri 29 Nov 2024 04:38:40 PM CET 2024-11-29 16:38:43 +01:00
build Fri 29 Nov 2024 04:39:06 PM CET 2024-11-29 16:39:10 +01:00
demo/plate1n Mon 15 Sep 09:47:09 CEST 2025 2025-09-15 09:50:23 +02:00
doc Sat 30 Nov 00:57:08 CET 2024 2024-11-30 00:57:12 +01:00
ParamJSON Thu 5 Jun 16:28:15 CEST 2025 2025-06-05 16:29:36 +02:00
src Mon 15 Sep 09:44:42 CEST 2025 2025-09-15 09:46:53 +02:00
tools Mon 15 Sep 09:46:50 CEST 2025 2025-09-15 09:48:39 +02:00
all_requirements.txt Fri 29 Nov 2024 04:39:34 PM CET 2024-11-29 16:39:37 +01:00
main_requirements.txt Fri 29 Nov 2024 04:39:39 PM CET 2024-11-29 16:39:43 +01:00
README.md Mon 15 Sep 09:43:56 CEST 2025 2025-09-15 09:45:45 +02:00

SimNDT2b

The batch processor version of SimNDT Version 2

The batch processor reads the entire simulation scenario from a json file and performs a simulation. Output can be saved in numpy format by enabling snapshots. Either each snapshot step is svaed in one file, or the snapshots (matrix of specific field variables) are accumulated in a three-dimensional volume, saved in on numpy file.

Authors

  1. Miguel Molero (original SimNDT)
  2. Stefan Bosse (SimNDT2 and SimNDT2b)
  3. Sanjeev Kumar (SimNDT2b)

Prerequisits

python2
cffi==1.14.5
Cython==0.29.22
matplotlib==2.0.0
numpy==1.16.6
opencv-python==3.4.9.31
Pillow==6.2.2
pyopencl==2019.1.2
PyOpenGL==3.1.0
PySide==1.2.2
pytools==2019.1.1
scipy==1.2.3
jsonpickle==2.2.0

Batch processing run

  1. Update the path to save the simulation data in the JOSN file under the key name ["Snapshot"]["Save_filepath"] (or ["Export"]["Save_filepath"]).
  2. Run and save simulation command: python main.py "path_to_json_file"
python2 $TOP/src/main.py ParamJSON/simndt_paramas_alu_hole_20mm.json 

JSON Format

Material Libarary

All materials are labelled with an integer index number (0, positive) and a name. The simulation set-up uses only the index number of a material:

Note: The included material list determines the simulation model with respect to minimal grid distance and time step distance. Therefore, include only materials used in this simulation!

  1. Pre-defined from built-in material library:
  "Materials": [
    {
      "Name": "aluminium",
      "Label": 0
    },
    {
      "Name": "air",
      "Label": 160
    }
  ]
  1. User-defined by providing material parameters (Rho: density, VL/VT: long. and transv. velocities in m/s):
  "Materials": [
    {
      "Name": "mysteel",
      "Label": 130,
      "VL": 5850,
      "VT": 3220,
      "Rho": 7800      
    },

Import

Material

  • Im:<path-to-2dim-numpy-file> (front-end)
  • Iabs:<path-to-2dim-numpy-file> (front-end)
  • Rho:<path-to-2dim-numpy-file> and VL:<path-to-2dim-numpy-file> and VT:<path-to-2dim-numpy-file> containing Rho, VL, and VT matrix (back-end, engine)
  "Import": {
     "Im": "/tmp/simulation-materials-Im.npy"
  }
  "Import": {
     "Rho": "/tmp/simulation-materials-Rho.npy",
     "VL": "/tmp/simulation-materials-VL.npy",
     "VT": "/tmp/simulation-materials-VT.npy"
  }

Export

Material

Exports material matrix

enableMaterial:true,Material:XX

  • Iabs: Material label matrix w/o boundaries, front-end
  • Im: Material label matrix with boundaries (same size as field matrix), front-end
  • RV: Rho,VT,VL material matrix set, back-end (engine)
  • RC: Rho,C11,.. material matrix set, back-end (engine)

Signals

enableSignals:true,Field:XX

  • Export sensor signals (derived from Field XX)

  • Fields: "Vx","Vy","[Vx,Vy]","Txx","Txy","Tyy","[Txx:Txy:Tyy]","Dx","Dy","[Dx,Dy]","SV"

Sensor Placement

  • Paramters (margin offsets and delta increment): [ox,oy,dx,dy]
  • Sensor matrix shape (number of columns and rows): [sx,sy]
  • Default:
ox=dx=round(xn/(sx+1.0))
oy=dy=round(yn/(sy+1.0))
for x in range(0,sx):
  for y in range(0,sy):
    S[y,x]=D[oy+y*dy,ox+x*dx]
  • User setting:
  "sensorPlacement":[ox,dx,oy,dy],
  "sensorShape":[sx,sy]

All parameter values in grid coordindates! E.g., plate 500x500, 1mm grid distance, but field grid is 187x187 points (depends on other simulation and material settings)!

Output Formats

  1. numpy (enableNumPy=true), 2-dim (one file per time step) or 3-dim (enableVolume=true)
  2. csv (only single sensor signals, no 2-dim fields), one row per time step

Field

  • Tension Txx, Txy, Tyy
  • Velocity Vx, Vy
  • Displacement Dx, Dy
  • SV

Example Sensor Field

  • Optional: The material grid is exported (Rho, VL, VT), too
  "Export": {
    "Step": 100,
    "Save_filepath": "/tmp/",
    "Filename": "simulation",
    "Extension": ".png",
    "dB": 60,
    "Color": 0,
    "Field": "Txx",
    "Material": "RV",
    "enableFields": false,
    "enableNumPy": true,
    "enableCsv": true,
    "enableSignals": true,
    "enableImages": false,
    "enableMaterial": true,
    "enableVolume": true,
    "enableView": false,
    "sensorShape": [],
    "sensorPlacement": [],
    "sensorSize": 0
  }

Example Single Sensor

Note: The sensor settings have no inmpact on the simulation model and the simulation, it is just a field selection rule.

  • sensor position ist (56,180) mm
  • more than one sensor can be sampled (saved)
  "Export": {
    "Step": 20,
    "Save_filepath": "./data",
    "Filename": "fields-sensor-56-180",
    "Field": "Txx",
    "enableFields": false,
    "enableNumPy": false,
    "enableCsv": true,
    "enableSignals": true,
    "enableImages": false,
    "enableVolume": true,
    "enableView": false,
    "sensorShape": [1,1],
    "sensorPlacement": [56,0,180,0],
    "sensorSize": 0
  }

Simulation

  • dx and dt are optional and set static simulation constraints and must be lower than computed minimal req. dx/dt
  • Entire simulation time in Seconds
  • Maximum frequency to be sampled in Hz (minimum value is given by the stimulus base frequency and time step)
  • Point cycle sets the snapshot interval saving field (sensor) values, i.e., each PointCycle step
  "Simulation": {
    "PointCycle": 10,
    "SimulationTime": 150e-6,
    "TimeScale": 1.0,
    "MaxFreq": 120000.0,
    "Order": 2,
    "Device":"CPU",
    "dx" : 0.001,
    "dt" : 1e-7
  },