modified: anasen_fem/garfield_sim.py mad
modified: anasen_fem/run.py
modified: anasen_fem/wires_gmsh2d_bc.py
made changes to both to resolve inconsistency between the mesh generated by GMSH (3nodes) and expected by garfield (10nodes)
This commit is contained in:
parent
dccea0c862
commit
40ec71a216
|
|
@ -42,7 +42,7 @@ else:
|
||||||
gas.LoadGasFile(gas_file)
|
gas.LoadGasFile(gas_file)
|
||||||
|
|
||||||
# --- 3. FIELD MAP SETUP ---
|
# --- 3. FIELD MAP SETUP ---
|
||||||
fm = ROOT.Garfield.ComponentElmer()
|
fm = ROOT.Garfield.ComponentElmer2d()
|
||||||
|
|
||||||
|
|
||||||
fm.Initialise("wires2d/mesh.header",
|
fm.Initialise("wires2d/mesh.header",
|
||||||
|
|
@ -58,6 +58,7 @@ fm.SetMedium(0, gas)
|
||||||
# --- 4. SENSOR AND DRIFT SETUP ---
|
# --- 4. SENSOR AND DRIFT SETUP ---
|
||||||
sensor = ROOT.Garfield.Sensor()
|
sensor = ROOT.Garfield.Sensor()
|
||||||
sensor.AddComponent(fm)
|
sensor.AddComponent(fm)
|
||||||
|
sensor.SetArea(-50.0, -50.0, -5.0, 50.0, 50.0, 5.0) #hardcoding the sesnsor area to define a psuedo 3d geometry
|
||||||
|
|
||||||
# Heavy Ion Drift (RKF) - Best for the general track
|
# Heavy Ion Drift (RKF) - Best for the general track
|
||||||
drift = ROOT.Garfield.DriftLineRKF()
|
drift = ROOT.Garfield.DriftLineRKF()
|
||||||
|
|
@ -69,7 +70,7 @@ aval.SetSensor(sensor)
|
||||||
|
|
||||||
# --- 5. EXECUTION ---
|
# --- 5. EXECUTION ---
|
||||||
# Starting position (e.g., near the IC wires at r=23mm or closer to Anodes)
|
# Starting position (e.g., near the IC wires at r=23mm or closer to Anodes)
|
||||||
x0, y0, z0, t0 = 35.0, 0.0, 0.0, 0.0
|
x0, y0, z0, t0 = 3.50, 0.0, 0.0, 0.0
|
||||||
|
|
||||||
print(f"Simulating heavy ion drift from r={x0}...")
|
print(f"Simulating heavy ion drift from r={x0}...")
|
||||||
drift.DriftIon(x0, y0, z0, t0)
|
drift.DriftIon(x0, y0, z0, t0)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ while val<178.3+0.1:
|
||||||
os.system("ElmerGrid 14 2 wires2d.msh -2d")
|
os.system("ElmerGrid 14 2 wires2d.msh -2d")
|
||||||
os.system("ElmerSolver wires2d.sif")
|
os.system("ElmerSolver wires2d.sif")
|
||||||
os.system("./paraview_plotter.py")
|
os.system("./paraview_plotter.py")
|
||||||
# os.system("python3 garfield_sim.py")
|
os.system("python3 garfield_sim.py")
|
||||||
os.system("cp wires2d.msh wires2d/mesh_files/wires2d%02d_%1.4f.msh"%(count,val))
|
os.system("cp wires2d.msh wires2d/mesh_files/wires2d%02d_%1.4f.msh"%(count,val))
|
||||||
os.system("cp wires2d.sif wires2d/sif_files/wires2d_%02d_%1.4f.sif"%(count,val))
|
os.system("cp wires2d.sif wires2d/sif_files/wires2d_%02d_%1.4f.sif"%(count,val))
|
||||||
os.system("cp wires2d/elfield_anasen_t0001.vtu wires2d/vtu_files/elfield_anasen_%02d_%1.4f.vtu"%(count,val))
|
os.system("cp wires2d/elfield_anasen_t0001.vtu wires2d/vtu_files/elfield_anasen_%02d_%1.4f.vtu"%(count,val))
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ gmsh.option.setNumber("Mesh.Algorithm", 6)
|
||||||
gmsh.model.mesh.generate(dim=2)
|
gmsh.model.mesh.generate(dim=2)
|
||||||
# gmsh.model.mesh.refine()
|
# gmsh.model.mesh.refine()
|
||||||
# gmsh.model.mesh.refine()
|
# gmsh.model.mesh.refine()
|
||||||
|
gmsh.model.mesh.setOrder(3)
|
||||||
gmsh.write("wires2d.msh")
|
gmsh.write("wires2d.msh")
|
||||||
gmsh.model.mesh.setOrder(1)
|
|
||||||
#gmsh.fltk.run()
|
#gmsh.fltk.run()
|
||||||
gmsh.finalize()
|
gmsh.finalize()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user