ANASEN_analysis/anasen_fem
Vignesh Sitaraman 018a92f647 modified: TrackRecon.C proton beam energy correction
modified:   anasen_fem/run.py
	modified:   anasen_fem/scalars.dat.names
	modified:   anasen_fem/scalars_weight.dat.names
2026-09-23 15:17:49 -04:00
..
junk modified: .gitignore 2026-03-16 14:22:35 -04:00
1dpotplot.py new file: anasen_fem/1dpotplot.py 1d potential plotter from A to C from elmer output 2026-06-05 11:05:40 -04:00
clean.sh modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
dielectrics.dat new file: anasen_fem/dielectrics.dat 2026-04-25 12:26:45 -04:00
dotproduct.py modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
garfield_sim.py modified: anasen_fem/garfield_sim.py mad 2026-04-27 17:59:42 -04:00
paraview_dotproduct.py modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
paraview_plotter.py modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
README.md modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
run.py modified: TrackRecon.C proton beam energy correction 2026-09-23 15:17:49 -04:00
scalars_weight.dat modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
scalars_weight.dat.names modified: TrackRecon.C proton beam energy correction 2026-09-23 15:17:49 -04:00
scalars.dat modified: anasen_fem/run.py 2026-04-01 17:42:53 -04:00
scalars.dat.names modified: TrackRecon.C proton beam energy correction 2026-09-23 15:17:49 -04:00
wires_gmsh2d_bc.py modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
wires2d_weight.sif modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00
wires2d.sif modified: anasen_fem/README.md added the Shockley-Ramo dot calculation capability adapted fom Sudarsan's branch with a new visusalisation scheme to show the +ve and-ve sides on a logscale 2026-09-23 12:14:05 -04:00

README for ANASEN fem simulations:

  • There are a few iterations of these simulations that already exist. Be sure to also locate and refer to them if necessary.
  • Install gmsh and its python api by running (Ubuntu 22.04 LTS)
		sudo apt install gmsh python3-gmsh 
  • Gmsh gives us the tools to create a meshgrid that samples the 2d space appropriately to plot the field/equipotential lines.

  • The output file typically has the .msh extension. This is read as input to Elmer, which is the FEM differential-equation solver.

  • Install Elmer via the following steps:

		sudo add-apt-repository ppa:elmer-csc-ubuntu/elmer-csc-ppa
		sudo apt install elmerfem-csc-eg
  • Install ParaView for visualizations by downloading from the Linux .tar.gz link at https://www.paraview.org/download/

    • The current version is tested to work on Paraview 6.1.0. The default version in Ubuntu 22.04 repositories has some trouble with scripting
  • v0.0.1, March 10 2026

    • 2d simulations of fields only. gmsh for meshing, elmer for fem, paraview to plot
    • Before running, open paraview_plotter.py to make the bash shebang (#!) point to the location of pvpython or pvbatch
    • python3 run.py should run everything in order, and is hopefully all the files are self-documenting
  • v0.0.2, September 2026

    • Adds the Ramo weighting field and the E . E_w dot product for one cathode wire.
    • wires_gmsh2d_bc.py now cuts the wires into the gas disk with occ.fragment instead of mesh.embed, so each wire boundary is a real edge of the domain. One cathode (optional 2nd argument, default 1) gets its own physical group, tag 40; the other 23 stay in tag 30.
    • Two solves, same mesh, identical apart from the potentials:
    file tag 40 output
    wires2d.sif` | V, like every other cathode | wires2d/elfield_anasen_t0001.vtu` |
    wires2d_weight.sif` | V, all else 0 V | wires2d/elfield_weight_t0001.vtu` |
    • dotproduct.py reads both and writes wires2d/dotproduct.vtu with DotProduct = E . E_w (V/m^2). It aborts if the node sets differ or if either field is all zeros — both are silent failures otherwise.
    • paraview_dotproduct.py renders it. DOT_MIN/DOT_MAX set the colour range and decide whether the picture shows anything.
    • paraview_plotter.py gains two views: the equipotentials over one quadrant, and streamlines over the same quadrant. Streamlines are drift paths up to diffusion, so they show which wire collects charge from where; SEED_POTENTIAL and SEED_STRIDE control them.
    • Six PNGs per z-locus, archived as before (<Stem>_z_<count>_<z>[_quarter].png). Field_ouput keeps its typo so the new files sort with the dozen already in png/.
    • STAGE in run.py: 1 = mesh + physical solve, 2 = weighting solve + dot product reusing stage 1's mesh, 0 = both. Stage 2 never re-meshes, so it applies to whichever z stage 1 ran last.
    • Do not pass -autoclean to ElmerGrid. It renumbers the physical groups (13/10/20/30/40 become 1/4/5/6/7), so every Target Bodies/Target Boundaries in the sifs matches nothing, Elmer solves nothing, and the potential comes out identically zero with no error.
    • mesh.recombine() and mesh.refine() are both off: recombination ran over half an hour on the barrel surface without finishing, and refine took the mesh to ~16M nodes.
    • Note on the solver stack: both sifs are the same file bar the potentials, so whatever FluxSolver does to Electric Field it does equally to both and the dot product stays consistent.
  • v0.0.3, planned TODO

    • Garfield to take Elmer results and perform charge-transport
    • Sweep the weighting solve over all 24 cathodes rather than one at a time