5.4 KiB
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
- Miguel Molero (original SimNDT)
- Stefan Bosse (SimNDT2 and SimNDT2b)
- 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
- Update the path to save the simulation data in the JOSN file under the key name ["Snapshot"]["Save_filepath"] (or ["Export"]["Save_filepath"]).
- 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!
- Pre-defined from built-in material library:
"Materials": [
{
"Name": "aluminium",
"Label": 0
},
{
"Name": "air",
"Label": 160
}
]
- 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>
andVL:<path-to-2dim-numpy-file>
andVT:<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
- numpy (enableNumPy=true), 2-dim (one file per time step) or 3-dim (enableVolume=true)
- 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
},